Repository navigation
native: Qwen3.5-2B on CUDA attests the execution witness's first path, every weight byte read once the server is ready - #2956
Conversation
|
A question on the weights read: it uses one worker thread, so it takes one core and one stream of disk reads away from serving. On the A100 box in the receipt, 1.6 GiB took about 20 s, limited by the disk (84 MB/s at 28% utilisation, the process at 78% of one core). More workers would finish sooner on a faster disk but compete more with decode. Should it stay at one, or follow a setting? |
|
Thanks @kotevcode. The core of this is right: the shards are stamped before the load, every byte is read once the server is ready with no digest cache, the stamps are checked again around the read, and an idle reload stamps and reads its own engine again. Off, nothing changes. Some asks before it leaves draft:
On your question: keep one worker and no setting. It's off the request path and bounded by the checkpoint, and your decode-during-hash rows are level. We'll run a GB10 check on our side once these are in.
|
|
Thanks. All four are in 5043d29:
One worker, no setting: kept. |
|
Thanks @kotevcode, 5043d29 covers the code asks:
The PR's own CI passed on this head. Merged onto today's main here, Before it leaves draft:
Once it's restacked and out of draft, we'll run the GB10 check we promised.
|
5043d29 to
b7a99ed
Compare
|
Restacked as asked, onto #2901's head bd15bd6 and #2903's current commits; it's still on #2901's base, not main. #2903's two commits (a7bbda5, 7795508) change the same lines, with the same messages, as the copies here, which are now 93282c1 and c1c1d28. The rebase had no conflicts, and the branch's diff over #2901 is unchanged. I also took the stray warning out of the build summary (b7a99ed). The malformed The description now links the #2958 A100 receipt (https://gist.github.com/kotevcode/5b4d26cd284c1f04878862f4c1611b93) for resumed = fresh, and for drafted =
|
|
Thanks @kotevcode. The restack is clean. #2903's two commits come over with the same changes, and #2901's As promised, we'll run the GB10 check on this head next: Qwen3.5-2B MLX 4-bit with It lands after #2896, #2901 and #2903, in that order. GitHub won't start CI while the stack conflicts with main in
|
|
I reran the three focused host targets and compiled the CUDA native runner at zig build test-disk-identity-host test-execution-witness-cuda-host test-execution-witness-host check-native-cuda-host -Dcpu=apple_m1 -Doptimize=ReleaseSafe -j3 --summary allExit 0 with 87/87 tests passed and a Linux ARM64 runner built. The trial into Igor Lessio - AIFLOW LABS |
b7a99ed to
b8af3ea
Compare
…nd engine info they now take, and the changelog keeps ashhart#2956's line
|
Thanks for the rebase. One commit on top, e66634d: b8af3ea doesn't build On M5 Max, Zig 0.17.0: |
…s, or why it is unknown
… idle manager can take the lock and park on a busy runner
…nner booted under an hour ago still parks
…, every weight byte read once the server is ready
…reads hash_failed when it cannot stamp; excluded servers never read the weights, and --kv-cache, --prompt-precision and --rope-yarn are excluded
…iled warning out of the test output
…nd engine info they now take, and the changelog keeps ashhart#2956's line
e66634d to
e0bd06b
Compare
…ne info they now take, and the changelog keeps #2956's line
|
Thank you @kotevcode. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
What this changes
With
--execution-witness, native Qwen3.5-2B on CUDA at one rank, every module MLX affine 4-bit and text only now readsknownon the pathqwen3_5-2b/cuda/tp1/mlx-q4g64/text. Every other engine still readsunsupported_path, and without the flag nothing changes.Before the weights load, the engine stamps
config.json, the index, every shard the index names and a captured kernel set'saot.jsonand cubins (cuda_witness.Witness.open). A file it cannot stamp makes the witness readhash_failed; the model still serves. After the load,bindchecks the loaded geometry is the 2B's uniform affine 4-bit layout and takes the GPU's and the family's facts; any other size, quant or format gets no hook and staysunsupported_path.Once the server is ready (and again after each
--idle-unloadreload, for the new engine), one thread reads every shard byte in full, with no digest cache. If a stamp moved between the load and the end of the read, or a Hugging Face snapshot's shard differs from its blob name, the witness readsfiles_changed. Shutdown stops the read at its next block.components.engineis a SHA-256 over the path, the checkpoint's structure (canonicalconfig.json, the index, shard names, sizes and headers), every shard's bytes, and the components a kept state's key binds, written through native: the CUDA kept-state identity is written once through any hasher, its keys unchanged #2903'scuda_disk.componentsso the two lists can't drift: the embedded kernel images, a captured cubin set, the GPU's name, compute capability and driver, the family's resolved facts and the resolved profile values. Then the SM count, the context window, the stream count and the staggered segments.The witness passes
std.crypto.hash.sha2.Sha256straight tocomponents, soaot_identity's captured set takes the SHA-256 branch, as noted on native: the CUDA kept-state identity is written once through any hasher, its keys unchanged #2903.docs/api.mdnames the supported path and what it binds.Issue: Refs Opt-in coherent execution witness for exact-response cache qualification #2741 (part 2 of 3: the first attested path; part 3 binds each reply to the witness).
Base: main at 1b39456, where native: the CUDA kept-state identity is written once through any hasher, its keys unchanged #2903 and server: "execution_witness": true binds a reply to the witness at admission and at its end, with its prompt, resolved request and tokens #2958 (with server: --execution-witness serves a read-scoped snapshot of what runs, or why it is unknown #2901's commits) have landed. As Ash rebased it: server: --execution-witness serves a read-scoped snapshot of what runs, or why it is unknown #2901's remaining edc80d2, 5bd661c and 6d12299, this PR's 4a9bd61, 3adc501 (the review fixes) and d0b215d (the
hash_failedtest keeps its expected warning out of the build summary), Ash's b8af3ea, and e66634d (server: "execution_witness": true binds a reply to the witness at admission and at its end, with its prompt, resolved request and tokens #2958's tests givestartandbumpthe arguments this PR adds, and the changelog line is back).Checks on this head
python3 tools/pr_check.py --base upstream/main --pr 2956: lean 167 and 167 on the base and this head, 0 new; 0 errors, 0 warnings.zig build test-execution-witness-cuda-host(new step): 19 passed, 0 failed, 0 skipped. Only dense Qwen with the flag, one rank, text and nothing learned wants the path; the loaded 2B's geometry gets a hook and other sizes, quants and formats none; a same-size, same-header shard rewrite changes the weights digest and a stamp moved since open readsfiles_changed; a captured cubin, a resolved profile value or the device changes the engine digest; each engine hashes once it is begun, and a reloaded one reads every byte again.zig build test-disk-identity-host: 36 passed.zig build test-execution-witness-host: 49 passed.zig build test-key-scopes-host: 41 passed.zig build test-model-idle-host: 89 passed.zig build check-native-cuda-hostbuilds.zig build test-cuda-host: 446 of 446 steps, 7986 passed, 0 failed, 50 skipped.zig fmt --check build.zig zigandgit diff --checkpass.Receipt
"draft": falseand resumed against fresh, with the flag on: server: "execution_witness": true binds a reply to the witness at admission and at its end, with its prompt, resolved request and tokens #2958's A100 receipt, https://gist.github.com/kotevcode/5b4d26cd284c1f04878862f4c1611b93 (same A100 and checkpoint; this PR's previous head with server: "execution_witness": true binds a reply to the witness at admission and at its end, with its prompt, resolved request and tokens #2958's commits on top; the review commits since don't touch generation).--execution-witnesscomes with server: --execution-witness serves a read-scoped snapshot of what runs, or why it is unknown #2901; this PR gives it a supported path.zig build -Dgpu=sm_80;mlx-community/Qwen3.5-2B-MLX-4bit@93760be4f1f69842a46bc13dbdc0f19e291392a3andTensorFold/Qwen3.8-27B-MLX-4bit@22d8d538154e0e5b6f8dcb1fcc74a60a0798104c,--context 8192 --no-thinking --api-key, the default prompt cache, a fresh process per start.unsupported_path). Not run: other SMs, HIP, Metal, Windows.bench_concurrent.py --alone --serialat 1 and 8 streams passed in every cell for main, branch and branch with the flag, both while the hash runs and after it (9/9 alone at 1, 72/72 at 8, 3/3 serial, 0 unequal). Each prompt gave onetoken_sha256across all three: code579bcb3b…, chat12faa747…, the cold 7,680-token prompt924e91cc…; 27B's cold promptf89b1fd0….--execution-witness; medians, alternating ABC, BCA, CAB./health200, s (n=3)/health200 toknown, s (n=3)known,ttft_s(n=3)/health200, during the hash,ttft_s(n=3)ttft_s(n=10)unsupported_path, nothing hashed)/health200, s (n=3)ttft_s(n=3)The first three cold first-token rows put C 15 to 17 ms above A and B; ten more alternating rounds put C 2 ms below B (Mann-Whitney p=0.88) and B 11 ms above A (p=0.45), so I read it as noise between builds, not the hash. Every C start gave the same
contentandcomponents.engine, and a differentwitnessandinstance.knownat epoch 1, thenparked; the request that wakes it is answered in about 5 s, throughreloadingandpendingat epoch 2, with the same tokens as before the park. Epoch 2 readsknownabout 25.7 s after that request, with the samecontent,components.engineandinstanceand a newwitness.files_changed(3 of 3);--visiongivesfeature_excludedwith"feature": "--vision";--tp 2is refused at startup for this family, as on main.tools/bench_openai.py: 256 tokens, 3 reps, temperature 0, 9 samples per config: fibonacci-raw 835.1 / 834.2 / 834.4 and gpu-chat-no-think 414.6 / 414.1 / 414.2 tok/s (A / B / C).tools/bench_cache.py --require-cold, 7,680-token prompt: above, every runcache_state: cold,cached_tokens: 0.Checklist
The title and description match the head commit, including the receipt and the stack.
New tests fail before the change, pass after it, and skip cleanly without their dependency.
Comments and docstrings are one line. No measurements or history in the source.
No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
Drafted output equals
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. Concurrent equals solo, and main, branch and branch with the flag give the same tokens (receipt above). With the flag on, drafted equals"draft": falseand a resumed prompt (4,096 of 5,786 tokens cached, with--prompt-cache-gib 4) equals a fresh one in server: "execution_witness": true binds a reply to the witness at admission and at its end, with its prompt, resolved request and tokens #2958's A100 receipt, run on this PR's previous head with server: "execution_witness": true binds a reply to the witness at admission and at its end, with its prompt, resolved request and tokens #2958's commits on top: https://gist.github.com/kotevcode/5b4d26cd284c1f04878862f4c1611b93No precision traded for speed. If the bits change, the description says which sums change and why.
Decode and prompt processing are no slower than main at one stream and the widest admitted (8); greedy only, and no
--drafterrun, since the flag refuses one.