Skip to content

Fix complete-copy ordering, CuTe tensor pickling and GB300 package naming - #129

Merged
lukealonso merged 3 commits into
mainfrom
gb300-preparation-fixes
Nov 5, 2026
Merged

lukealonso merged 3 commits into
mainfrom
gb300-preparation-fixes

Conversation

@original-el8

@original-el8 original-el8 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Three preparation and packaging corrections on main 0009b89, one commit each.

Complete-copy ordering (ignition/preparation/compilation.py). 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 main'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. 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 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 a gb300 revision. Orbit already reports gb300 for compute capability 10.3. GB300_DEVICES lists 0x31c3 beside the GB10 and GB202 tables, PLATFORMS includes gb300, the mixed-platform and missing-identity errors no longer enumerate platforms, and docs/cli-design.md and docs/package-format-design.md list gb300.

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 main 0009b89 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:

    Package Serial 8 concurrent [gMASK] in 27 repro replies
    main 24/32 (3 empty) 20/32 (3 empty) 3
    main, speculation disabled 32/32 32/32 0
    main + this PR's copy ordering 32/32 32/32, identical to serial 0

    The 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.py and tests/preparation/test_unavailable_resources.py on an RTX PRO 6000 (SM120): 41 passed, 1 skipped. test_bf16_add_out_preserves_pooled_aliases_under_native_replay requires the qualification Cargo feature, which the installed extension lacks. On main, the descriptor round trip fails with PicklingError: args[0] from __newobj__ args has the wrong class.

  • helios package::naming tests (features runtime-package,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.

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 main too. Exports of other recipes with the copy-ordering change, a GB300 export on this revision, and a heliopause build (its naming changes are comments and one error string).

@eduffd eduffd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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's tests/test_compilation.py, pre-fix compilation.py, CUDA tests enabled: 7 failed, 32 passed, 1 skipped. (compilation.py is unchanged between 56f5702a and acbf2858, 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] and test_complete_copies_stay_fused_unless_an_opaque_call_takes_their_destination. The token_count case 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.py hunk applied (ad994b6e is 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 the qualification Cargo 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.

@original-el8
original-el8 force-pushed the gb300-preparation-fixes branch from 5ea8689 to 90ca430 Compare November 5, 2026 13:25
@original-el8 original-el8 changed the title Fix deferred-copy views, CuTe tensor pickling and GB300 package naming Replace CuTe runtime tensors in forward metadata and name GB300 packages Nov 5, 2026
@original-el8

Copy link
Copy Markdown
Collaborator Author

Rebased onto main 0009b89 with the deferred-copy ordering commit (ad994b6e) removed. main corrects the same misread in cbb7d9d, which preserves runtime tensor base offsets when rebuilding opaque invocation views and keeps explicit copies for offset or strided operands, and in #158 for self-reading copies.

The removed commit's eight test_opaque_calls_read_the_written_destination_of_a_complete_copy cases, including token_count, pass against main 0009b89 on an RTX PRO 6000 (SM120). Its test_complete_copies_stay_fused_unless_an_opaque_call_takes_their_destination fails on main only at the structural assertion that one copy executes as an opaque call (main executes none); its value checks pass.

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 main.

…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
@original-el8
original-el8 force-pushed the gb300-preparation-fixes branch from 90ca430 to 8d51552 Compare November 5, 2026 16:00
@original-el8 original-el8 changed the title Replace CuTe runtime tensors in forward metadata and name GB300 packages Fix complete-copy ordering, CuTe tensor pickling and GB300 package naming Nov 5, 2026
@original-el8

Copy link
Copy Markdown
Collaborator Author

Correction to the earlier rebase comment: main's cbb7d9d does not cover #133. The copy-ordering commit is back on this branch (b7c44e1), ahead of the other two, rebased onto main 0009b89.

GLM-5.3-Flash TP4 packages on four DGX Spark (GB10) hosts, exported from main 0009b89 with and without the copy-ordering commit and served with 5 draft tokens and adaptive verification, give these results on a check of 8 record lookups and 24 200-integer counts (serial, then 8 concurrent):

  • main: 24/32 and 20/32, with repeated or skipped numbers, empty replies, and literal [gMASK] in 3 of 27 batched-speculation repro replies.
  • main with speculation disabled: 32/32 and 32/32.
  • main + the copy-ordering commit: 32/32 and 32/32, no [gMASK].

The operand-view unit cases pass on main as well, so they do not reproduce this case; the failing copy in the speculative graphs has not been isolated. Details are in the PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants