Repository navigation
Qualify durable KV changes on Qwen3.5 0.8B - #185
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
i386
left a comment
There was a problem hiding this comment.
Commented at head c2ea35015a (draft) — lanes red in the smoke step; needs author attention before this can qualify anything.
At this head the macOS/Metal and ARM64/CUDA13 package lanes fail inside ci-smoke: the smoke server never becomes reachable (repeated curl: (7) Failed to connect to the local port, then cleanup Operation not permitted). Whether that's the draft's KV changes breaking serve startup or a runner-env issue is not yet distinguishable from the log alone — worth a local just smoke run at this head to split the two. No review beyond that until the draft stabilizes; happy to do the content pass when it's ready for one.
|
@i386 The required
I have left this author declaration unchecked while working through CI. |
Skippy Lab Qualification: PassedCommit: Native Spark lab qualification. Latest successful main: run 46152803372, attempt 1, commit
TPS comes from three separate warmed, uncached probes at concurrency 1, each generating exactly 128 tokens. The scored correctness answers and each probe's 64-token warmup are excluded. Each rate is total tokens / total server-reported phase time, not an average of request rates. Client elapsed times and raw responses are retained in throughput-probe.json. These bounded samples are not sustained benchmarks or controlled speedup comparisons. Legacy short-answer receipts and missing or invalid probe evidence show as Unavailable. Deltas use unrounded rates from matching PR-profile smoke receipts on the latest successful main run, including the nightly smoke evidence. Positive means faster. Changed workload inputs, different serving host classes, unequal phase token counts or missing evidence show Unavailable. Physical Spark placement and runtime conditions can differ; deltas are descriptive, not controlled speedup claims. Smoke checks cover GPU startup, deterministic endpoint repeats and bounded streaming. They do not establish an AgentX performance score. Nightly history and saved performance baselines are published separately; a saved baseline can be older than the latest successful main run used here. Native build and qualification output streams into each configuration’s Actions log, with per-attempt copies in Saved evidence. Any capture gaps are reported in the log and saved diagnostics. GitHub evidence copies expire after 30 days. |
Original problem
PR #34 recorded 22.94 s p95 time to first token on the 0.8B Spark AgentX row. This draft pins the current local KV changes for a controlled follow-up on the same machine.
Diagnostics
Four 900-second AgentX trials on the original Spark reproduced the L3 latency regression. L3-on recorded 405 background spills and zero L3 restores. For 66 matched turns per pair with equal output token counts and prompt counts within one token, p95 first-token latency rose from 3.43 s to 15.51 s and from 3.41 s to 14.54 s. The largest matched stalls occurred in prefill on cache misses with resident KV eviction. The earlier Metal replay recorded two L3 restores that replaced cold prefills. PR #34
Fix
The scheduler retains the reusable checkpoint and copies at most 8 MiB of resident KV or recurrent state per step. It checks for foreground work between steps. Cache eviction can release resident cells immediately, which cancels an unfinished capture. The spill worker assembles completed slices and writes the pack. Transposed-V payloads use the existing fixed-size packing path.
Compatibility
The current draft uses native ABI 0.1.95 and split protocol generation 19. Rebuild the runtime and deploy it to all workers together. The L3 pack format and prefix key algorithm stay compatible. The cache identity includes the native ABI, so checkpoints written by older ABIs are bypassed and can be refilled under the current runtime.
Validation
KV performance rerun at
c2ea350Exact source
c2ea35015ab843bf76c942ddd63c845207f243d4. JY jobjob_ab7nywz4wpdqjxxcompleted six 900-second AIPerf 0.13.0 profiles onspark-000280at one lane and 65,536 context. All profiles validated with zero request errors and clean shutdown. The retained profiles and traces were checksum-verified.For 0.8B, the previous L3 p95 first-token time was 14.39 s. L3 still adds 16.9% to current p95 first-token time and lowers same-token active throughput by 1.6–1.7%. For 27B, the previous default with a 256 MiB L1 limit delivered 4.24 tok/s at 81.04 s p95 first-token time. The current default reused about 627,000 prompt tokens in each trial through L1, with zero L3 restores.
The 180-request Apple M5 Max replay across Qwen3.5 0.8B, 2B, 4B, and Qwen3-Coder 30B-A3B matched prior output text and token counts. Vanilla llama.cpp used pinned source
8954f194837d2ec4d5f67f20c81b84abe63883ba. All 12 persisted restart requests missed L3, compared with 12 hits in the prior replay. A timing control recovered disk reuse by giving the original prompt an idle capture window. A window after its extension persisted a different prefix.Cross-tier qualification passed 4 of 8 cells on Metal and Spark CUDA. Qwen3 4B and Qwen3-Coder 30B-A3B failed on both backends and reproduced on same-node retries. A local Metal intervention reduced the transposed-V pack counts from 332,100 to 10 on 4B and from 221,616 to 7 on Coder. Both diagnostic cells passed. That intervention is from a separate diagnostic checkout.
Workspace formatting, focused checks, warning-denying all-target Clippy, and 2,108 offline Rust tests passed on the pinned source. Full disk-cache qualification remains failed.
Earlier same-Spark L3 control at
4124dafcargo fmt --all --checkandgit diff --checkpassed for the snapshot.cargo check --locked --offline,cargo clippy --locked --offline --all-targets -- -D warnings, andcargo test --locked --offlinepassed locally forskippy-cache,skippy-ffi,skippy-runtimeandskippy-servingwithskippy-serving/dynamic-native-runtime. There were 2,217 passing tests and 56 ignored tests.job_ansv6yeb091nbsxsucceeded onspark-000280at exact head4124daf363b091984099f6adc286e93436dd281f. All four AIPerf 0.13.0 trials completed and cleaned up normally with zero request errors. The pinned Qwen3.5 0.8B model and corpus ran at 65,536 context and one lane in L3 off, on, on, off order. L1 was enabled and L2 was disabled throughout.TTFT, throughput, and inter-token latency are means of two trial summaries per setting. Median background spill time was 876 ms and 887 ms in the two L3-on trials. There were no L3 restore timing samples.
Full nightly matrix
GitHub Actions run
45139906229completed with failure at4124daf363b091984099f6adc286e93436dd281f. Six configurations passed native qualification, one produced diagnostic profiles after a cleanup failure, and five failed before profiling. All six qualified rows missed the 1% performance target. Workflow runMeasured rows ran two AIPerf 0.13.0 AgentX trials configured for 900 seconds at 65,536 context and concurrency one on NVIDIA GB10. All retained profiles had zero request errors. Values are means of two trial summaries. Parentheses show the change from the pinned baseline. The comparisons use the audited model inputs, corpus, driver and formulas because the saved contract fingerprints differ. Pinned baseline run
The five startup failures occurred in the local numerical correctness check, before AgentX. All four split formations terminated with the leader failed and worker cancelled. The retained Flash standalone profiles are diagnostic because server cleanup required a forced process-group shutdown.
CI repair validation
Ported main’s checkout-local pinned-model downloader and its process-exit cleanup fix after the CUDA smoke failed creating
/home/runner/.cache/huggingfaceand the Metal smoke reportedOperation not permitted. The cleanup probe now rechecks whether the child exited, retaining detection of live descendants and permission errors for a live child.SKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just ci-automation,bash -n scripts/ci-model-fetch.sh, andgit diff --checkpassed on macOS ARM64. Fresh package/device checks remain pending in CI. Existing incomplete feature acceptance tasks remain incomplete.Native cache validation
The v1 shared Cargo/sccache inputs omitted the native patch recipe, allowing native artifacts from another source tree to be reused. Ported main’s source-bound dependency/extra-file identity and cold-build directory fix. Native patch edits/removals now invalidate dependency caches; Rust-only changes retain their permitted dependency reuse.
SKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just automation-contractsandgit diff --checkpassed on macOS ARM64, including the native-cache regressions. Fresh model/device qualification is pending on the new head.CI repair validation —
b3657e8b6e1a411cdbc95ab7d83e909d13c9e934Refreshed the durable-KV qualification stack through current #34/#113/#9 and main
cc2a27435e798649a9cb938d600d39722e4a2263. Retained the Qwen3.5 0.8B control, borrowed-chunk imports and batched native page reads while incorporating current native package CI and formation/deadline fixes.The shared accounting fix occupies core 0071; the two branch-specific patches are now 0072–0073. Its ABI patch is model-support 0026. Native ABI is 0.1.92, distinct from parent 0.1.90 and the sibling checkpoint API 0.1.91. Regenerated bindings, API reference and recipe metadata agree. Runtime bundles require rebuilding for the new ABI/recipe; the borrowed-page and wire/hash contracts are preserved.
Validation:
just --command cargo fmt --all;LLAMA_STAGE_BACKEND=cpu just --command cargo check --workspace --all-targets;LLAMA_STAGE_BACKEND=cpu just lint;LLAMA_STAGE_BACKEND=cpu just test: passed, including both Rust workspaces, integration/doc tests and the native facade tests.LLAMA_STAGE_BACKEND=cpu just native-contract-build: passed. The focusedskippy_async_state_contractsand its two generated synthetic fixtures passed 3/3, exercising partial-chunk rejection, full chunk import/export parity, sampler graph reservations and single-count pooled-output accounting.LLAMA_STAGE_BACKEND=cpu just --command cargo test -p skippy-apiandLLAMA_STAGE_BACKEND=cpu just skippy-ffi-bindgen-check: passed again after the final native/recipe correction.SKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just automation-run automation native-generator contracts api-doc --checkand... just ci-automation: passed. Cold text-only replay verified all 180 patches with the same native tree.git diff --check: passed. All-workflow actionlint used narrow local 1.7.12 compatibility exceptions for the documented GitHub cache-mode and queue: max keys; repository rules remain intact.Fresh exact-head hosted/native checks and real-model/device qualification are pending. Local CPU synthetic tests do not establish the Qwen hardware/performance claim. Contributor declarations remain unchanged.
Split preparation rendezvous repair
The follow-up to main's peer lifecycle improvements is included at
060feedb15c410740a5975303a13af1a981cc3b6. The failed #239 split attempt showed a late-starting peer remained invisible during model admission and stage planning. Control now exposes the matching formation/source/attempt in thepreparingphase during those operations. Native-child readiness, listener ownership and completion evidence remain required; timeouts and qualification policy are unchanged.Validation for this head:
git diff --check,just --command env PYTHONPATH=scripts /tmp/skippy-ci-repair/automation-venv312/bin/python scripts/tests/inference_peer.py(12 tests), andSKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just ci-automationall passed. The new real-loopback regression covers both roles and both preparation operations, rejects premature readiness, and verifies cleanup on preparation failure. Exact-head hardware qualification is pending CI.Transposed-V packing and shared build repair
At
bf8181a, transposed-V checkpoints take the existing fixed-size packing path. This bounds manifest and index sizes and preserves the native payload and restore descriptor. Token-window packing remains available for contiguous token rows.The diagnostic patch passed the two previously failing Metal and Spark CUDA fixtures. CUDA job
job_r8e243ebh0fvnr0restored the Qwen3 4B 537-token checkpoint with 10 segments. Jobjob_gjqs8cgejc5t8a0restored the Coder 533-token checkpoint with 7 segments. Both exercised two L3 hits and the subsequent L2 hit.The longer Coder Metal diagnostic committed five growing transposed-V checkpoints from 1,035 to 8,203 tokens. It wrote 2,021 MiB of pack payload in total. The final checkpoint used 97 segments and 33 KiB of manifest and index metadata. Measured export intervals reached 610 ms, so that evidence leaves request scheduling and no-gap restart reuse open.
The stack also fixes a duplicate
max_request_tierinitializer in the release CLI feature path. Formatting, the focused all-target check, warning-denying all-target Clippy, and 1,583 CPU-backed Rust tests passed for the changed crates. The earlier split failure had a cancelled worker with zero attempts. At bf8181a, the Qwen3.6 split smoke passed and both native formation members exited successfully. Package verification was queued on that head. Package CI · Inference smoke.Bounded capture validation at
6c76700549cf726fcc1ef5ffc4f384e3ae6883b8The Apple M5 Max no-gap replay recovered 12/12 L3 restart hits across four models. All 60 response texts and token counts matched the reference. The run used full Metal offload, the original requests, a 4 GiB disk cache, and a 6 GiB free-space floor. The earlier replay at
c2ea350missed all 12 restarts.The transposed-V Coder replay wrote 2,021.16 MiB of new pack payload over five growing turns. The final 8,203-token checkpoint used 97 segments and was visible about 0.75 s after the response finished. The full transposed checkpoint is rewritten at each boundary.
Local checks passed for the four changed Rust crates with dynamic native loading. Workspace formatting, all-target checking, warning-denying Clippy, bindgen regeneration and freshness checks, API reference validation, and a fresh Metal build and package passed. The Rust suite passed 2,059 tests with 55 ignored, including integration and documentation test runs. The generated Qwen3.5 resident test and Gemma2 sliding-window test passed. A separate real-Qwen Metal fork probe passed byte-range equality, then reached a 0.000230312347 logits delta. The preceding ABI 0.1.92 build showed the same delta under the same probe.
The dense and attention MoE Metal gates passed on this commit. The two hybrid gates failed because the candidate published an extra 384-token checkpoint ahead of the intended 532-token checkpoint. Qwen3.6 split smoke passed with both native formation members terminal. Inference smoke · Package CI
Canonical capture and lookup at
cde35417e191da10dbdce5551d7f563ae61dac55The scheduler treats shared-grid checkpoints as an idle fallback. The canonical chat checkpoint takes precedence when both are offered during a request. The durable index hashes the query's token stream once and continues to look up the longest candidate first using the existing prefix keys.
Exact-source Metal replay passed 12/12 restart hits across the four original models, with matching outputs and token counts for all 60 responses. The longest native capture call was 2.62 ms. Coder's three live returns after pressure reprefilled the prompt. All three subsequent restarts reused 5,539 tokens from L3. The growing Coder replay wrote 2,021.16 MiB across five checkpoints, with 97 segments at 8,203 tokens. The longest native capture call there was 2.37 ms.
Workspace formatting, focused all-target checking, warning-denying Clippy, and 1,822 Rust tests passed. Both hybrid Metal gates passed against the pinned vanilla llama.cpp reference. The dense Metal retry follows an L2 promotion failure on the first attempt. Four CUDA cases and the two AgentX comparisons on
spark-000280are admitted. Inference smoke · Package CICombined qualification at
6fbcd30ba18b3c9837439d8a5a30aa6330132e6bEviction reclaims resident cells immediately. A scheduled export revisits the resident entry between slices of up to 8 MiB. The scheduler checks for queued requests between slices, and the spill worker assembles and writes completed captures. Paused captures release their spill-channel ownership so the scheduler can shut down. Complete standalone prompts can start bounded capture while requests are active.
All four Metal cache gates passed on the earlier
f2f85883candidate. The published combined head uses the updated upstream and is undergoing exact-commit qualification. Its native queue applied from a depth-one checkout of the upstream pin and produced the same native tree as the locally resolved queue. This fixes the patch-application failure that stopped the first four combined CUDA jobs before compilation.All eight cache gates passed on this commit across four CUDA and four Metal fixtures on lab machines. Dense Metal also passed on the local Mac. Each passed the independent report verifier and L2 replay read zero disk payload bytes. The 48 GiB M5 Pro Mac mini completed the 6,766-token LongRetrieval case with 4.81 s cold prefill and 24.01 ms warm prefill, serving 6,765 cached tokens on the warm replay. The pinned llama.cpp reference completed the case with 4.86 s prefill. JY job
job_ahsd4dr5a2jwxanretained checksum-verified evidence. The 16 GiB MacBook Air attempt timed out during the cache-enabled seed and warm requests. The cold request and the cross-tier L3 restores completed on that device.The original Mac no-gap replay recovered all 12/12 L3 restart hits. All 60 response texts and token counts matched. The original cache configuration was kept at 4 GiB with a 6 GiB free-space floor.
The scheduler test queued a request during a capture slice and verified that it ran before the next slice. The longest native capture span in the Mac replay was 69.94 ms. An in-flight span overlapped a request arrival by up to 0.175 ms. The 8 MiB bound limits work per slice. These timings describe the measured run.
Five longer Coder turns matched their reference outputs and wrote 1.97 GiB of pack payload. The final 8,203-token checkpoint wrote 769.03 MiB across 97 segments and was observed about 1.10 s after the response. Transposed-V checkpoints still rewrite the full payload.
The full local linked workspace suite passed 4,978 tests with 325 ignored. The Metal native build, 11 selected native tests, installed package-tool smoke and offline CI automation also passed. The local shared host, runtime, archive, and GPU smoke recipes passed for the exact
darwin-aarch64-metalproduct. The standalone CUDA attempt built the Linux ARM64 CLI and stopped at the toolkit check because the host compiler is CUDA 13.0 and the product is pinned to 13.1.2. The independent retry in the repository’s pinned CUDA 13.1.2 toolchain image passed the shared Linux ARM64 host, runtime, archive, fixture and device-smoke recipes onspark-000464in JY jobjob_8ph4f14tma845g6. The packaged Qwen3-0.6B smoke generated four tokens with 29/29 layers offloaded to the GB10. The retained smoke receipt matches the product archive SHA-256. The GitHub Linux ARM64 CUDA 13 package job also passed. Its uploaded archive, embedded product and runtime manifests, and four-token GPU smoke receipt were verified against the exact PR head. The GitHub macOS ARM64 Metal package job passed on the same commit. Its uploaded archive and embedded runtime were checksum-verified, and the packaged Qwen3 smoke generated four tokens with 29/29 layers offloaded. The shared CI workflow finished green. Qwen3.6 35B-A3B split smoke passed in GitHub Actions. Both native stages confirmed peer completion across all 40 layers, and three requests plus streaming smoke passed. The 0.8B L1-only vs L3 comparison passed both 1% thresholds on the originalspark-000280. The 27B L1 reuse check passed on the same machine in JY jobjob_va4knd4td9ef1cn. Both 900-second profiles used L3 with the default 256 MiB L2 and 1 GiB resident recurrent budget. Each completed 18 requests with zero errors and clean shutdown. Verified request and trace joins identified 12 resident L1 hits per arm, serving 627,083 cached prompt tokens in each. The earlier same-node coupled-budget default served zero cached prompt tokens. The earlier recovered setting served 627,093 with L2 disabled. The final default preserves resident reuse with L2 and L3 active. On a second spare GB10,spark-001095, the 27B replay completed both 900-second trials with disk and L2 enabled, a 1 GiB resident checkpoint limit, zero errors and clean shutdown. Verified trace and request joins found 12 resident L1 hits in each arm, serving 627,083 and 627,093 cached prompt tokens. Package CI · Inference smokeThe Qwen3.5 0.8B comparison on the original
spark-000280passed at this commit in JY jobjob_cjxn1cnr2zgxkwy. Four 900-second AIPerf 0.13.0 arms used the pinned AgentX corpus, one lane, 65,536 context, L2 off and a 24 GiB cap for L3. All four profiles validated with zero request errors and clean shutdowns.The throughput comparison uses 148 matched request pairs with the same trace turn and output count and prompt counts within one token. The two mirrored pairs contributed 87 and 61 matches and gained 0.56% and 1.70% in output rate. On those matched requests, p95 TTFT fell from 3,887 to 2,879 ms and the median paired TTFT difference was +76.78 ms. Each arm had seven rows without token counts, which were excluded from the matched analysis. The stated 1% thresholds cover trial p95 TTFT and matched throughput.
The spare Qwen3.5 0.8B replay on
spark-000945passed both descriptive 1% limits in JY jobjob_z056gc3xf6vh3mp. All four 900-second AgentX arms completed with zero request errors and clean server shutdown. One lane and 65,536 context were used throughout, with L2 disabled and L3 capped at 24 GiB in the disk arms.The pooled rate uses 95 request pairs with the same trace turn and output count and prompt counts within one token. The mirrored pairs contributed 26 and 69 matches. Their throughput changes were +1.09% and −1.67%, so the pooled throughput pass is close to the limit.
Acceptance criteria