Repository navigation
Fix complete-copy ordering, CuTe tensor pickling and GB300 package naming - #129
Conversation
22d5a91 to
5ea8689
Compare
eduffd
left a comment
There was a problem hiding this comment.
GB300 hardware verification of ad994b6e (the compilation ordering fix)
Context: the live GLM-5.3 TP2 deployment in #133 exported its package on 2026-10-28 from a checkout that includes 317c1ecc but not this fix. I verified this fix on Spark1, the host that exported that package, running this PR's own test file against the preparation code before and after it.
- Spark1 checkout at HEAD
acbf2858+ this PR'stests/test_compilation.py, pre-fixcompilation.py, CUDA tests enabled:7 failed, 32 passed, 1 skipped. (compilation.pyis unchanged between56f5702aandacbf2858, so this is the same pre-fix state the branch's fix applies to.) The failures:test_opaque_calls_read_the_written_destination_of_a_complete_copy[offset_view|sub_view_read|token_count|triton_reader|write_then_read]andtest_complete_copies_stay_fused_unless_an_opaque_call_takes_their_destination. Thetoken_countcase is the misread itself:Mismatched elements: 1/1 (100.0%), Greatest absolute difference: 15 at index (0,). - Same tree with only this PR's
ignition/preparation/compilation.pyhunk applied (ad994b6eis the only commit on the branch that touches that file):1 failed, 38 passed, 1 skipped. - That remaining failure is
test_bf16_add_out_preserves_pooled_aliases_under_native_replay, which needs thequalificationCargo feature. After rebuilding the extension with that feature on the same host, it passes against this branch's code:1 passed in 2.43s. The extension was restored to the plain-feature build afterward.
Test environment notes for anyone rerunning: ~/.triton/cache on that host is root-owned, so the CUDA-gated tests need a writable TRITON_CACHE_DIR, and the plain-feature installed wheel blocks the native replay case at a feature gate.
CI state as read today: native (ubuntu-24.04) passes; native (windows-2022) failed after 6h0m17s, and --log-failed returned no failed log lines, so it reads as a runner timeout rather than a test failure. I could not diagnose it from the artifacts and flag it for whoever merges.
Scope: this branch carries three commits, this compilation ordering fix, the CuTe forward-metadata placeholders, and GB300 package naming by PCI device id. My verification covers only the first. I did not run the other two.
Consequence: packages exported from revisions that include 317c1ecc but not ad994b6e, including the live glm53-spark-tp2-packed-202610281245 deployment, can contain the misread views. The corrected field-report rerun and the scoping answers are in the follow-up comment on #133.
5ea8689 to
90ca430
Compare
|
Rebased onto The removed commit's eight The #133 deployment was exported from 56f5702, which contains 317c1ec but not cbb7d9d. Packages exported from revisions that contain cbb7d9d do not need the removed change. The two remaining commits are not on |
…gion Storage lowering leaves a complete aten.copy_ into persistent storage to Inductor's post-graph writeback, and Inductor substitutes the copy's source for its destination in later opaque storage calls. A complete copy is now deferred only when no later opaque storage call takes an operand in its destination region, in addition to the existing requirements of a contiguous offset-0 source that does not read the destination and is not rewritten later. Other complete copies execute in order as opaque storage calls. Without this rule, GLM-5.3-Flash packages give wrong output whenever MTP speculation runs: repeated or skipped tokens, replies that exhaust their token limit inside reasoning, and literal [gMASK] tokens in reasoning and content. The same packages are correct with speculation disabled. Compatibility: no package format or contract change. Packages exported without this change can contain the misordered copies and should be exported again. Validation: - tests/test_compilation.py on an RTX PRO 6000 (SM120): 39 passed, 1 skipped. test_bf16_add_out_preserves_pooled_aliases_under_native_replay requires the qualification Cargo feature, which the installed extension lacks. - GLM-5.3-Flash TP4 packages on four DGX Spark (GB10) hosts, exported from main 0009b89 with and without this change and served through Orbit with flare 0009b89, 5 draft tokens and adaptive verification. A check of 8 record lookups and 24 200-integer counts, run serially and then 8 at once: without the change 24/32 and 20/32 correct, with 3 empty replies in each pass; with it 32/32 and 32/32, with identical serial and concurrent answers. The package without the change passes 32/32 in both passes with speculation disabled. scripts/repro_glm_batched_speculation.py (cached at 8 and 16 concurrent requests, three uncached 96K-token prompts): literal [gMASK] in 3 of 27 replies without the change and in none with it. Not established: which copy and storage call in the GLM speculative graphs produce the wrong values. The unit cases in tests/test_compilation.py that read a copied destination through operand views pass with and without this change, apart from the check that only the copy an opaque call reads runs in order. Other recipes were not exported with this change. Design-Signed-Off-By: flare-02; design-review=a38f
Forward-metadata pickling rejects b12x bindings that keep CuTe DLPack descriptors of their scratch views, such as the TMEM KDA prefill binding. A cutlass.cute.runtime._Tensor reports cute.Tensor as its __class__, so default pickling cannot reduce it, and export stops with a PicklingError. The pickler treats these descriptors as process-local resources, like compiled kernels and streams, and replaces them with placeholders that raise if forward tracing accesses them. Compatibility: no package format or contract change. Validation: tests/preparation/test_unavailable_resources.py pickles a descriptor through forward_metadata and checks the placeholder. Without the change the test fails with "PicklingError: args[0] from __newobj__ args has the wrong class"; with it, both tests in the file pass. The test runs on CPU. Design-Signed-Off-By: flare-02; design-review=a38f
Package naming and Hub revision detection map NVIDIA PCI device ids to the platform identifiers gb10 and gb202. The GB300 GPU (PCI device 0x31c3, SM103) maps to neither, so export cannot name a GB300 cache entry and revision detection cannot select a gb300 revision, while Orbit already reports gb300 for compute capability 10.3. - helios: GB300_DEVICES lists 0x31c3, platform_from_pci maps it to gb300, and PLATFORMS includes gb300. - flare: the --revision help lists gb300, and the mixed-platform error no longer names specific platforms. - heliopause: export comments and the missing-identity error no longer list specific platforms. - docs: cli-design.md and package-format-design.md list gb300 among the revision and platform identifiers. Compatibility: no package format or contract change. Exports on GB300 are named gb300-tp<N>-<UTC timestamp>. Validation: helios package::naming tests with features runtime-package and frontend, 6 passed; the PCI-id test asserts that 0x31c3 maps to gb300 only for the NVIDIA vendor id. flare hardware and hub revision tests, 4 passed. NVML on a DGX Station GB300 reports PCI id 0x31c310de. A GB300 export and a heliopause build were not run on this revision. Design-Signed-Off-By: flare-02; design-review=a38f
90ca430 to
8d51552
Compare
|
Correction to the earlier rebase comment: GLM-5.3-Flash TP4 packages on four DGX Spark (GB10) hosts, exported from
The operand-view unit cases pass on |
Three preparation and packaging corrections on
main0009b89, one commit each.Complete-copy ordering (
ignition/preparation/compilation.py). Storage lowering leaves a completeaten.copy_into persistent storage to Inductor's post-graph writeback, and Inductor substitutes the copy's source for its destination in later opaque storage calls. A complete copy is now deferred only when no later opaque storage call takes an operand in its destination region, in addition tomain's requirements of a contiguous offset-0 source that does not read the destination and is not rewritten later. Other complete copies execute in order as opaque storage calls. Without this rule, GLM-5.3-Flash packages give wrong output whenever MTP speculation runs: repeated or skipped tokens, replies that exhaust their token limit inside reasoning, and literal[gMASK]tokens (#133). The same packages are correct with speculation disabled.CuTe runtime tensors in forward metadata (
ignition/preparation/forward_metadata.py). Forward-metadata pickling rejects b12x bindings that keep CuTe DLPack descriptors of their scratch views, such as the TMEM KDA prefill binding. Acutlass.cute.runtime._Tensorreportscute.Tensoras its__class__, so default pickling cannot reduce it and export stops with aPicklingError. The pickler replaces these descriptors with process-local placeholders, as it does for compiled kernels and streams.GB300 platform identifier (
helios,flare,heliopause, docs). Package naming and Hub revision detection map NVIDIA PCI device ids to platform identifiers, and GB300 (PCI device 0x31c3, SM103) has none, so export cannot name a GB300 cache entry and revision detection cannot select agb300revision. Orbit already reportsgb300for compute capability 10.3.GB300_DEVICESlists 0x31c3 beside the GB10 and GB202 tables,PLATFORMSincludesgb300, the mixed-platform and missing-identity errors no longer enumerate platforms, anddocs/cli-design.mdanddocs/package-format-design.mdlistgb300.Compatibility: no package format or contract change. GLM packages exported without the copy-ordering change can contain the misordered copies and should be exported again. Exports on GB300 are named
gb300-tp<N>-<UTC timestamp>.Validation
GLM-5.3-Flash TP4 on four DGX Spark (GB10) hosts: packages exported from
main0009b89 with and without the copy-ordering change, served through Orbit with flare 0009b89, 5 draft tokens and adaptive verification. A check of 8 record lookups and 24 200-integer counts, run serially and then 8 at once:[gMASK]in 27 repro repliesmainmain, speculation disabledmain+ this PR's copy orderingThe repro replies come from
scripts/repro_glm_batched_speculation.py: cached at 8 and 16 concurrent requests, and three uncached 96K-token prompts.tests/test_compilation.pyandtests/preparation/test_unavailable_resources.pyon an RTX PRO 6000 (SM120): 41 passed, 1 skipped.test_bf16_add_out_preserves_pooled_aliases_under_native_replayrequires thequalificationCargo feature, which the installed extension lacks. Onmain, the descriptor round trip fails withPicklingError: args[0] from __newobj__ args has the wrong class.heliospackage::namingtests (featuresruntime-package,frontend): 6 passed; the PCI-id test asserts that 0x31c3 maps togb300only for the NVIDIA vendor id.flarehardware and hub revision tests: 4 passed. NVML on a DGX Station GB300 reports PCI id0x31c310de.Not run or not established: which copy and storage call in the GLM speculative graphs produce the wrong values; the operand-view unit cases pass on
maintoo. Exports of other recipes with the copy-ordering change, a GB300 export on this revision, and aheliopausebuild (its naming changes are comments and one error string).