Repository navigation
Conversation
|
The zig, zig-b and zig-windows failures were |
|
I trial-merged zig build test-drama-host check-drama-cuda-host test-drama-metal-quant-host \
test-drama-nvfp4-reference-host test-drama-prefill-host -Dcpu=apple_m1 -j5 --summary allThere is an overlap to account for if #4153 lands alongside it. The combined trial merge conflicts in four files at the kernel name table, launch registry and contract setup. Keeping Igor Lessio - AIFLOW LABS |
…olution.patch's resolution
…, pre-feature main rebuilt offline (not for merge)
…, pre-feature main rebuilt offline (not for merge)
The net change of ashhart#4144 at a57d9c2 over its merge base f35bfa4, as one commit: merge a57d9c2 carries its own change to zig/src/core/contract/registry_joins.zig.
a57d9c2 to
70e78d0
Compare
…ion.patch's resolution
The net change of ashhart#4144 at a57d9c2 over its merge base f35bfa4, as one commit: merge a57d9c2 carries its own change to zig/src/core/contract/registry_joins.zig.
70e78d0 to
b3e7673
Compare
|
Thank you @plotarmordev. 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. |
Conflicts in registry_media.zig, drama3/cuda/kernels.zig, contract_drama3.zig and contract_tests.zig: d3_router_compact then d3_cfg_mix in the name table, the F enum and cuda_pending; ashhart#4144's compact router and its unmasked d3_router control join this PR's Set, which replaces ashhart#4144's Group.
…r's log tail (not for merge)
…ion.patch's resolution
|
@AIFlowML Thanks for the combined trial merge and checking the four-file overlap. #4153 carries your resolution (keeping I ran the combined tree on a GB10 (job
|
… checked PCM measurements (not for merge)
…he pre-feature tree still matches (not for merge)
…correct-the-gb10-claim Drama 3 CUDA (ashhart#4144): correct the GB10 claim, stop gating on main's codec-chunk byte compare, then a clean combined GB10 run
What this changes
Drama 3 on CUDA now loads a compact NVFP4 checkpoint as stored — the published
plotarmordev/drama-3-NVFP4-Prunedand the 5,900-expert variant — instead of refusing them. Before,zig/src/families/drama3/cuda/weights.zigaccepted only.fp8gexperts, so these checkpoints could not load at all. Now the loader stages a layer's held NVFP4 experts packed in slot order (never widened),d3_router_compactmasks the router to the held ids and picks their slots, and a layer that dropped no experts keeps the original unmasked router. FP8 decode output is byte-identical to before the change; the win is device memory.adf3e74ca, "drama3 metal: a listed expert the checkpoint does not store fails before any weight is mapped") that the CUDA loader calls into —weights.zig'squant.checkStored(&held, sh.map)andheld.total(). It is a-xcherry-pick of a commit already merged on my fork; upstream needs it or the CUDA loader does not build.atc overlap --json: reports no overlapping open pull request; the scan was incomplete at its time limit (otherPullRequestsLimit). The new files are all underzig/src/families/drama3/cuda,zig/tests/cuda/contract_drama3_router.zig,zig/kernels/cuda/drama3_moe.cuhandtools/zig/drama3_*, which no other open PR touches.Checks on this head
edbfbff7ac97f4ec077f5d3159c78d0a7d5df7be.python3 tools/zig/lean_check.py, on the base and on this head: 221 problems on both, zero new.zig build test test-goldenatedbfbff7a, macOS 27 arm64 (Apple M5 Ultra), Zig 0.17.0: 897/900 steps, 470/486 tests passed, 15 skipped, 1 failed. The failure isstage net: an unknown host is refused(zig/src/fabric/stage/net.zig:195): it expectsAddressUnresolvedand getsAddressInUsebecause this machine's resolver answers.invalidnames with a fake198.18.xaddress.zig/src/fabric/is untouched by this branch and the test fails identically on the basee3fb56cbhere — a resolver quirk, not this change.nvfp4_test(slot-order staging, FP64 decode contract) and thed3_router_compactcontract test run without a GPU.Receipt
drama3-generate. Metal is touched only by the one shared loader commit.edbfbff7a, Zig 0.17.0, nvcc 13.0, an NVIDIA GB10 (sm_121); the publishedplotarmordev/drama-3-NVFP4-PrunedGPTQ checkpoint as stored.nvfp4_testsuite decodes the staged experts against the FP64 rounding contract.tools/zig/drama3_compact_gb10.shhas not passed on the GB10; it stops at the compact--replay 1step, at the codec-chunk comparison. Up to there everything is exact: FP8 greedy codes match the pre-feature base byte for byte, and the replay's frames, graph replay, poison/reset and chunk-1 PCM match. Then the same 17 frames decoded in chunks of 4 are not byte-identical to chunks of 1 (error: ReplayMismatch). The cause is main's CUDA codec, not this diff:replay.zig,cuda/codec.zig,cuda/tts.zig,cuda/blas.zigandgenerate.zigare the same blobs ate3fb56cb(main before this PR),edbfbff7anda57d9c23, four GB10 runs fail identically there (top-852321a95766,top-d1a42040bb89,top-0e0b87a98a6a,top-cc8aa7c48955; details in /Users/Shared/agent-work/tensorfold-out/4144-replay/REPORT.md), and plain maine3fb56cbalone fails the same way in jobtop-171f7969b5e0(FP8 checkpoint,--codec,--replay 1: codec chunk 1 passes twice, then chunk 4ReplayMismatchatreplay.zig:81), proving the codec-chunk mismatch is main's own, not this diff. The batched-prefill, kernel-contract and limits steps after it have not run on the GB10 yet.8aabdc78) keeps every exact check exact, namely frames, graph replay, poison/reset and PCM chunk 1 against chunk 1, and reports PCM at codec chunks 4 and 16 against chunk 1 as max abs and RMS difference, for information and not as a gate. That difference is a known property of main's CUDA codec:decodeChunkruns each layer as a cuBLAS GEMM whose N is the chunk's frame count, and cuBLAS picks its kernel by shape. An option for the maintainer is a chunk-invariant codec, with a fixed algorithm per layer.plotarmordev/drama-3-NVFP4-Prunedvariants; no new weights here.Measured on the GB10 in the same job, compact NVFP4 against FP8:
Kernel contract, only when a GPU kernel is new or changed
d3_router_compact— the masked variant ofd3_router; none replaces an engine kernel.contract_drama3_router.zigrunsd3_routerunmasked as the control; it must fail gate 3, and does.SUMMARYline and exit status:tools/zig/drama3_compact_gb10.shrunstf-cuda-test kernel-contract 'compact router'(gates 1–4 and the unmasked control) andkernel-contract-limits; eachRECORD drama3 d3_router_compactline lands in the receipt.Checklist
No visible change: nothing this PR changes shows on screen.
How to check
9e2a9bd7a93d3c6cd333d6db10a1bd05d7478145a57d9c23d40693cd5f10a1fabb1b2d27e52d7661Test results:
zig build test test-goldenatedbfbff7ac97(older head): 470 passed, 1 failed, 15 skippedzig build test-cuda-hostatadf3e74ca71a(older head): 10 passed, 0 failed, 0 skippedpython3 tools/zig/drama3_limits_gate_test.pyatedbfbff7ac97(older head): 8 passed, 0 failed, 0 skippedzig build test-goldenatedbfbff7ac97(older head): 377 passed, 0 failed, 0 skippednice -n 10 zig build test test-goldenatedbfbff7ac97(older head): 470 passed, 1 failed, 15 skippednice -n 10 zig build testatedbfbff7ac97(older head): 470 passed, 1 failed, 15 skippedzig build test-qwen35-modelopt-admission-hostata57d9c23d406: 1 passed, 0 failed, 0 skippedzig build test-drama-host check-drama-cuda-host test-drama-metal-quant-host test-drama-nvfp4-reference-host test-drama-prefill-hostata57d9c23d406: 5 passed, 0 failed, 0 skippedzig build test-golden test-kernel-contractata57d9c23d406: 2 passed, 0 failed, 0 skippedzig build test --test-timeout 10mata57d9c23d406: 15560 passed, 1 failed, 138 skippedpython3 -m unittest discover -s tools/zig -p host_tests_test.py -vata57d9c23d406: 0 passed, 0 failed, 13 skipped#4144 and #4153 together: the combined tree, checked on a GB10
I merged both branches over current main, resolving them the way @AIFlowML described in #4144 (comment). I then ran the host tests and one GB10 job on the result.
210e3b0c59e1d2910492fc6e0277a0f887f0591ea57d9c23d40693cd5f10a1fabb1b2d27e52d7661, merged first:62273c2ed28606689b4323f585e08a71e380391bb60aef3e03f466b62d93576f9632016e8ba8d35d, merged over it, giving the combined tree:972dbd4f310c60883bc9f6628125a0809c912cdac4ac3fe4f85cf234486cc78bbae88ec6c7fa2a64, which is the combined tree plus the job scriptdocs/recipes/drama3-cuda/combined-gb10.shand nothing else. It is onplotarmordev/TensorFoldbranchtrial/4144-4153-combinedand is not for merge.The resolution
Four files conflict, as Igor found:
registry_media.zig,drama3/cuda/kernels.zig,tests/cuda/contract_drama3.zigandtests/cuda/contract_tests.zig.d3_router_compactand thend3_cfg_mixkeep the same order in the kernel name table, theFenum andcuda_pending.Setowns the drama3 contract registrations. It gained the compact router and its unmaskedd3_routercontrol, registered between the norm rows and the CFG mix, and Upstream PR: Drama 3 on CUDA loads a compact NVFP4 checkpoint as stored #4144'sGroupis gone.The resolution on its own is
resolution.patch. I checked it on #4153's branch, both with #4144's merge and with #4144 squashed onto main. In each case I rangit merge main(four conflicts), applied it withgit apply resolution.patch, and got a tree identical to972dbd4f.Host tests on the combined tree (macOS arm64, Zig 0.17.0)
zig build test-drama-host check-drama-cuda-host test-drama-metal-quant-host test-drama-nvfp4-reference-host test-drama-prefill-host --summary all: 19/19 steps, 63/63 tests passed.python3 -m unittest -v tools/zig/drama3_limits_gate_test.py: 8 passed.python3 tools/zig/test_drama_guidance_check.py: 7 passed.zig build compile-cuda-tests -Dtarget=x86_64-linux --summary all: 10/10 steps succeeded.GB10 (TOP's Spark, sm_121, nvcc 13.0): job
top-aaf334ae7ce0, exit 1tf-cuda-test kernel-contract 'compact router' 'd3_cfg_mix':d3_router_compactpasses nonfinite, repeat and shapes (6 shapes exact).d3_cfg_mixpasses nonfinite (3 non-finite and 4094 finite outputs match the float64 classes), repeat and shapes (5 shapes, worst 0.433 of the bound).CONTROL cuda drama3 compact router control: d3_router, unmasked: red at shapes, as planted.d3_cfg_mix's pending record:FAIL limits live drama3 d3_cfg_mix: 256 threads launched, the driver allows 1024; 12 registers, 0 + 0 shared bytes (recorded 0, 0). The summary reads(filtered) SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 1 controls: 1 red as planted, 0 missed; 1 limit problems. This is the pending record waiting for its first nvcc receipt. The record to add is 12 registers, 0 static shared bytes, 256 threads.error: FileNotFoundfromdrama3-generate --model /assets/drama3-pilot/models/drama-3-NVFP4-Pruned. It never reached therouted experts heldline. The published checkpoint shipstokenizer.json, so the copy in the pilot folder is missing or incomplete. This is not the merge. The FP8 checkpoint loaded on the same tree:routed experts held 10240 of 10240; routed experts NVFP4 in 0 of 40 layers; compact routers in 0 of 40 layers,RESULT drama3 OK frames=116 … rtf=1.42.tools/zig/drama_guidance_check.pyon the FP8 checkpoint with a synthetic reference voice:"pass": true, "problems": [].d3_cfg_mix's limits record, rerun on the GB10
#4153 now records what that job measured for
d3_cfg_mixincuda_pending: 12 registers, 0 static shared bytes, 256 threads (sm_121, nvcc 13.0). That is commitf2c1c032fd9fb810d7ae4a782059276228789bd9, and nothing else in the kernel or its gates changed.top-6e269b37764catf2c1c032, exit 0:tf-cuda-test kernel-contract 'd3_cfg_mix'passes nonfinite, repeat and shapes as before, and the limits check now readsPASS limits live drama3 d3_cfg_mix: 256 threads launched, the driver allows 1024; 12 registers, 0 + 0 shared bytes (recorded 12, 0). Summary:(filtered) SUMMARY 1 kernels: 1 pass gates 1-4, 0 fail, 0 known findings; 0 controls: 0 red as planted, 0 missed; 0 limit problems; gates 39 ms, limits 0 ms.top-7e8a48a1639dat16272c0d5e8f05138de450db3f239d00ad662a39, exit 0. This isf2c1c032merged over Upstream PR: Drama 3 on CUDA loads a compact NVFP4 checkpoint as stored #4144 (62273c2e, froma57d9c23) withresolution.patch, asc578e8e8, plus the job script. It is ontrial/4144-4153-combinedand is not for merge.kernel-contract 'compact router' 'd3_cfg_mix'passes both kernels' gates, and the unmaskedd3_routercontrol is red at shapes, as planted. Summary:(filtered) SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 1 controls: 1 red as planted, 0 missed; 0 limit problems; gates 43 ms, limits 0 ms.The compact checkpoint, restaged on TOP
plotarmordev/drama-3-NVFP4-Prunedis in TOP's pilot folder at/assets/drama3-pilot/drama-3-NVFP4-Pruned.fetch hf toprefuses it: that command copies a Spark's Hugging Face cache to the Mac. So the job checks the Desk's put itself, withsha256sum -cagainst the publishedMANIFEST.sha256(revisionf3de2250). All 8 shards,model.safetensors.index.jsonandtokenizer.jsonreadOK.top-69fda464a7b5at1acbb3b5d1e89ed284232119104826fbd8110256, exit 1. This is16272c0dplusdocs/recipes/drama3-cuda/combined-gb10.shand nothing else. The16272c0dmerge had kept87ca3a66's tree, which dropped that script. The script now points--modelat the restaged folder, checks the sha256s and requiresrouted experts held 7369 of 10240. It is ontrial/4144-4153-combinedand is not for merge.(filtered) SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 1 controls: 1 red as planted, 0 missed; 0 limit problems; gates 45 ms, limits 0 ms.routed experts held 7369 of 10240; routed experts NVFP4 in 40 of 40 layers; compact routers in 36 of 40 layers. Generation then fails witherror: ReplayMismatch, so there is noRESULTline.--replay 1resets and regenerates greedily, andfamilies/drama3/replay.zigrequires byte-identical output. On the GB10 the compact path gave different bytes on the second pass."pass": true, "problems": [].top-127ed43127ffat922d9020df54307eef3606952eb8e33d0a9af770, exit 1. This is1acbb3b5with the job script changed and nothing else.MANIFEST.sha256against the published file's own hash (f447d4ba…), then runssha256sum -c MANIFEST.sha256underset -e, so any mismatch would have ended the job there. The job went on to build and run, so all 21 lines matched. The door keeps only the log's tail, which drops the printed OK count.--replay 1check, so each reports on its own.(filtered) SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 1 controls: 1 red as planted, 0 missed; 0 limit problems; gates 45 ms, limits 0 ms.routed experts held 7369 of 10240; routed experts NVFP4 in 40 of 40 layers; compact routers in 36 of 40 layers, thenRESULT drama3 OK frames=76 eos=true audio_s=3.53 prompt_rows=31 ref_frames=0 encode_ms=0.0 prefill_ms=849.4 first_audio_ms=965.6 total_ms=3157.0 fps=32.94 rtf=1.53 device_peak_gb=21.72.--replay 1fails again witherror: ReplayMismatch, the same as intop-69fda464a7b5."pass": true, "problems": [].Still open: #4144's compact path loads and generates on the GB10, but it does not replay byte-identically (
ReplayMismatchat--replay 1, twice). That replay is a gate in #4144's owntools/zig/drama3_compact_gb10.sh. #4144 reports that script passing atedbfbff7, before it merged main intoa57d9c23. The next GPU run should be that script ata57d9c23alone, to tell #4144's main merge from #4153's.#4144's whole GB10 check on the combined tree, with codec-chunk PCM reported instead of gated
#4144 at
8aabdc780197cf5544d9911d931d68e2f0480f9f(one-line comment fix over2519ef8fc5b7ac69544a102e77349a439b691bed) keeps every exact check intools/zig/drama3_compact_gb10.shexact: FP8 codes against the pre-feature tree, and the replay's frames, graph replay, poison/reset and PCM chunk 1 against chunk 1. The only stop it accepts is the chunk-4 PCM byte compare inreplay.zig(main's own cuBLAS-shape-dependent CUDA codec; proven on plain maine3fb56cbin jobtop-171f7969b5e0). It then decodes the compact run at codec chunks 1, 4 and 16, requires byte-identical frames, and reports PCM at chunks 4 and 16 against chunk 1 as max abs and RMS in 16-bit steps, for information only.a0c1f48a9427da04a7f2dd7cc9e32956722b1260, which is Upstream PR: Drama 3 semantic guidance (CFG) on CUDA #4153f2c1c032with Upstream PR: Drama 3 on CUDA loads a compact NVFP4 checkpoint as stored #41448aabdc780merged in usingresolution.patch's resolution. Its four resolved files are byte-identical toc578e8e8's. The pre-feature tree is main37fa51d2merged withf2c1c032(treec5d6fe9064bb7050a8f85432c7b6e799e4335d98), rebuilt in the job fromcombined-base.patchas commitd7b15e1711f2880119a7a8bc5856b3ea8106c769.top-b46176ce1b50atc3ced5af251e1754fce7ab044b24445e97f6746cexited 0, but nvcc warnings from the subsequent guidance build pushedRECEIPT.txtout of the door's 200-line log tail. PrintingRECEIPT.txtlast incombined-gb10.shresolved that.top-f47e9ab508b0atd273d1517ada405364743f6a0bd3df0c8915e3b0also exited 0, but its manifest check ransha256sum -c MANIFEST.sha256inside anechosubstitution, so a shard mismatch would not have stopped it.combined-gb10.shnow runs that check as its own command underset -e(checked locally: a tampered file stops the script with exit 1).top-41f63db6cf5aatc523dd1deb830aabd2f867344a40c6507d487b73onplotarmordev/TensorFoldbranchtrial/4144-4153-combined(not for merge;d273d1517plus that script change), exit 0:/assets/drama3-pilot/drama-3-NVFP4-Pruned:MANIFEST.sha256against its published hashf447d4ba…, then every line of it, each underset -e. Both passed: the job went on to build and run.tools/zig/drama_guidance_check.py):{"pass": true, "problems": []},CHECK guidance PASS.RECEIPT.txt(verbatim from jobtop-41f63db6cf5a):8aabdc780(macOS 27 arm64, Zig 0.17.0):python3 -m unittest -v tools/zig/drama3_limits_gate_test.py: 8 passed, 0 failed.zig build test-drama-host check-drama-cuda-host test-drama-metal-quant-host test-drama-nvfp4-reference-host test-drama-prefill-host test-golden --summary all: 24/24 steps succeeded, 54/54 tests passed; server goldens 69/69 and 324/337 (0 unexpected differences).zig build test test-golden: not green, exit 1: 925/931 steps succeeded (4 failed), 1763/1793 tests passed, 27 skipped, 3 failed. The same four steps fail at base70e78d03, and Upstream PR: Drama 3 on CUDA loads a compact NVFP4 checkpoint as stored #4144 changes no Zig file:vision.test.the release's vision_config parses to the defaultsand the same test underfamilies.deepseek_v41.metal.vision: the test expectsUnsupportedVisionfor a head count of 0,check()returnsZeroHeads. Upstream main still has it; the fork's main fixes the test inf5423d498, outside this PR.stage net: an unknown host is refused: this Mac's resolver answersno-such-host.invalidwith198.18.5.202(a proxy's fake-IP range), solistenreachesbindand returnsAddressInUse.tensorfold-nativecheck thatmemcpycomes from libSystem.Review fix: a replay stop at chunk 4 or 16, in a tested gate
#4144 at
2c09de9ddd6df2e6583f0bbebee9e659d6370e42moves the replay stop check intotools/zig/drama3_replay_gate.sh. It passes only when the log ends inerror: ReplayMismatchand the codec lines read1 1 4(the chunk 4 PCM compare failed) or1 1 4 16(chunk 4 matched, chunk 16 failed). A stop at the frames (1), at PCM chunk 1 against 1 (1 1), at the fork lane's chunk 1 PCM (1 1 4 16 1) or on any other error still fails. A fork-lane frame mismatch after chunk 16 prints the same log as a chunk 16 PCM one, becausereplay.zigprints nothing between them, so the gate cannot tell those two apart. Each PCM measurement now runs as its own command underset -e, so a missing or short PCM stops the run instead of leaving an emptyINFOline.python3 -m unittest -v tools/zig/drama3_replay_gate_test.py tools/zig/drama3_limits_gate_test.py: 14 passed (6 replay gate, 8 limits gate).534ba5271b497ebd75c2fbc806e28a8f83097424merges Upstream PR: Drama 3 on CUDA loads a compact NVFP4 checkpoint as stored #41442c09de9ddintoc523dd1de. Then4cc7f9b58603b5921e23b42846621fddea6956c5regeneratescombined-base.patchso that the pre-feature tree also drops the gate and still matches treec5d6fe9064bb7050a8f85432c7b6e799e4335d98. Both are onplotarmordev/TensorFoldbranchtrial/4144-4153-combinedand are not for merge. Jobtop-2e6793417079at534ba5271stopped at that patch, before any build.top-e2c133e77bb3at4cc7f9b58, exit 0:/assets/drama3-pilot/drama-3-NVFP4-Prunedpassed:MANIFEST.sha256: OK, and all 8 shards, the index and the tokenizer files readOK.{"pass": true, "problems": []},CHECK guidance PASS.RECEIPT.txt(verbatim):zig build test test-goldenexits 1. 925/931 steps succeeded (4 failed), and 1763/1793 tests passed, with 27 skipped and 3 failed. These are the same four steps that fail at base70e78d03:vision_configUnsupportedVisionagainstZeroHeadstests, fixed on the fork's main inf5423d498;no-such-host.invalid, fixed inafc998ed7;memcpylibSystem guard, fixed inc3d801235.