Skip to content

contract: nvcc 13.3's limit records for the 121 launches whose record it no longer matches - #3953

Merged
ashhart merged 5 commits into
ashhart:mainfrom
Bizuayeu:pr/contract-nvcc133-records
Nov 20, 2026
Merged

ashhart merged 5 commits into
ashhart:mainfrom
Bizuayeu:pr/contract-nvcc133-records

Conversation

@Bizuayeu

@Bizuayeu Bizuayeu commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

tf-cuda-test kernel-contract-limits on five-SM fatbins built by nvcc 13.3 ends on main with 850 stale records. This adds or corrects the 13.3 record of the 121 launches that have a usage at nvcc 13.3, which clears 408 of those lines. The other 442 are on launches that are pending at 13.3, and this leaves them as they are (see "Not changed").

five-SM fatbins, nvcc 13.3.73 main 813ff4ccbf this head 72cad6f85b
launches with a stale record 213 92
record stale lines 850 442
record current lines 4,595 5,003
last line FAIL kernel-contract-limits: 850 problems FAIL kernel-contract-limits: 442 problems

Both runs have 5,435 PASS lines and the 10 planted RED controls. The measured usage is the same in both: the two logs' PASS, RED and N/A lines are identical once the record state in brackets is dropped.

What this changes

  • zig/src/core/contract/nvcc_133_records.zig: 112 new lines in cuda_133, merged in the list's order by name, and 5 lines replaced (flashnext_batch fn_gdn_fused, qwen35 tf_q35_gdn_slots_1, _2 and _4, window_pages tf_wrows_merge_256_pg).
  • zig/src/core/contract/measurements/qwen_lanes_133.zig: 4 receipts replaced (tf_q35_attn_rows8_mt2, qwen35 tf_q35_attn_partial, qwen35_kv8 tf_q35_attn_partial8, qwen35_kv8 tf_q35_attn_rows8).
  • Every line is the tool's own RECORD line for that launch, with the trailing comma dropped as zig fmt writes a one-line entry.
  • The 121 launches by image: exl3_linear 91, flashnext_batch 5, idol 4, qwen35 4, tree_attention 4, qwen35_kv8 3, window_pages 3, window_attention 2, and glm_dflash, lane_gemv, moe_glue, norms and nemotron_attention 1 each. 55 of them were stale on all five SMs and 54 on sm_120 and sm_121 only.
  • registry.zig and registry_joins.zig are not touched. contract: the nvcc usage table moves to registry_cuda_sets.zig, so registry.zig has room #3865 landed after this was built. The branch merges into main at 174010ec7c without a conflict (git merge-tree). On that main the registry holds the same 1,606 CUDA records with the same state at 13.3 (the probe below, run again), no CUDA kernel source changed in between, and zig build test-kernel-contract on the merged tree passes (36 of 36 steps, 255 of 255 tests). The fatbins were not built again on it.

Not changed: 92 launches, 442 lines. These have no usage at nvcc 13.3 on main: they are later_pending or have no usage of their own, and no 13.3 receipt names them, so registry.usageFor returns none and their lines read stale whatever nvcc measures. A 13.3 line for one of them qualifies that compiler for the launch. I took that to be its family's call, not a correction of a record that is there, and left all 92 out. This is narrower than #1397, which also added 13.3 receipts for the launches pending in its day.

What I saw on the way: a first state of this branch gave these launches receipts, and tests of four files failed because they expect none at 13.3. First qwen4_cuda_receipts_test.zig (the 32 launches of the qwen4_ images) and moetile_records.zig (the 4 shared-down qmmf launches); with those launches left out, qmmf_prompt_records.zig and qwen_whole_records.zig failed the same way, and no test objected to the receipts of the other images. No receipt can reach the 2 launches of exl3_prompt_pending.zig: usageFor returns none for them before it reads one.

By image: qwen4_hc 12, qwen4_ple 10, qwen4_gdn 5, qwen4_projection 5, joint_schema 13, qmmf 10, flashnext_batch 7, prefill_attention 6, qwen35 6, qwen35_kv8 4, qwen36_mtp 4, exl3_experts 2, glm_glue 2, nvfp4_experts_tile 2, and flashnext_mtp, l2pace, l2pf and moe 1 each. Their RECORD lines are in this head's log. If you want any of these qualified for 13.3, say which, and I'll add the receipts, with the test change where a test expects none, in a follow-up.

Which launches are pending was asked of the registry itself: a 16-line Zig program, run in the base tree and not part of this diff, printed later_pending, the record's own usage and usageFor(r, 13.3) for each of the 1,606 CUDA records.

Checks on this head

  • Head commit: 72cad6f85b on main 813ff4ccbf.
  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: 191 and 191, 0 new. tools/pr_check.py: 0 errors, 1 warning (no Unreleased line: the branch leaves CHANGELOG.md alone; a line is offered below).
  • Tests run, with the command and pass, fail and skip counts:
    • zig build test-kernel-contract --summary all: 36 of 36 steps, 241 of 241 tests passed.
    • zig fmt --check build.zig zig: clean. zig build check-release-paths: 10 of 10 steps. zig build compile-cuda-tests: 10 of 10 steps. python3 tools/zig/cuda_common_check.py: exit 0.
    • zig build test --summary all: 744 of 744 steps, 10,533 of 10,611 tests passed, 78 skipped, 0 failed.
    • python -m pytest -q -rs from the root: 612 passed, 89 skipped, 648 subtests passed. The skips are this machine's: no NumPy (30), the web tests' optional packages (51), macOS-only and sandbox cases (2), the interpreter's Unicode version (2), and 4 that need a built native binary or a fake-serve fixture. None is in the contract.
  • kernel-contract-limits on fatbins: the table above. Both trees were built with an empty Zig global cache by zig build fatbins kernel-contract-fatbins -Dnvcc=<nvcc 13.3.73> -Dsm=80,86,89,120,121 (151 files each), then tf-cuda-test kernel-contract-limits <the fatbin folder>.
  • CI: run 44517065151. fmt, zig, zig-windows, zig-macos-dev-tools, pytest, release-paths and both benchmark-clients jobs pass. zig-b fails one test of 12,583: benchmark_run_test "--drafter auto passes the family's drafter only when it is cached and says which; only --serial adds --no-drafts" (its --serial command exits 2). That test is in the server's benchmark tool, not the contract, and neither it nor benchmark_run.zig has changed on main since 11-16. A local zig build test on this head ran the same 1,603-test server step: 1,595 passed, 8 skipped, 0 failed.
  • Not run, and why: fatbins from nvcc 13.0 or 13.2 (their lookups stop below the 13.3 set, so they do not read these lines); nvcc 14.0 or a later 13.x, whose images would be checked against the cuda_133 lines as the newest set at or below them (I have no such compiler); tf-cuda-test kernel-contract live on a GPU to its end (I started it on the GB10 and stopped it after 40 minutes, before its limits step; no kernel changes here, and that step reads the same records the fatbin run above checks for sm_121).

Changelog line, for where you place it at landing: - Kernel contract: nvcc 13.3's limit records are corrected for the 121 launches whose record that compiler no longer matched (112 added, 9 replaced); the 92 launches pending at 13.3 stay pending (#3953).

Receipt

n/a: the records are read by the kernel contract's tests and tools, not by a serving path. Outside zig/src/core/contract, the registry's lookups are called only from zig/tests/cuda and the contract's *_host.zig files, so no token, speed or memory can change.

  • Environment: TensorFold 72cad6f85b, Zig 0.17.0, CUDA 13.3.73 (nvcc), Linux on aarch64, an NVIDIA GB10 (sm_121), driver 580.178.04.

Checklist

  • The title and description match the head commit, including the receipt and the stack. (One commit, two files; the numbers above are from this head's own build.)
  • New tests fail before the change, pass after it, and skip cleanly without their dependency. (No new test: pending_132_test.zig already checks each qwen_lanes_133.zig receipt against the registry, and the limits tool is the check of the rest: 850 stale lines before, 442 after.)
  • Comments and docstrings are one line. No measurements or history in the source. (No comment is added or changed.)
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines. (tools/pr_check.py passes; the commit is under the GitHub noreply address.)
  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off. (n/a: no serving code changes.)
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (n/a: no serving code changes.)
  • No precision traded for speed. If the bits change, the description says which sums change and why. (n/a: no kernel or arithmetic changes.)
  • Decode and prompt processing are no slower than main at one stream and the widest admitted; with --drafter, no slower than without it, greedy and sampled (n/a: no serving code changes.)

@ashhart

ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Thanks @Bizuayeu for refreshing the 13.3 records. The red check doesn't come from them.

The failing step is test-cuda-host, with one failure in 1,603 tests (and test-server-cpu, which waits on the same build). We applied your two record files to current main and ran test-cuda-host. The only failure that isn't a known machine-specific one is in zig/src/server/benchmark_group_test.zig:188: "managed and attached CLI runs drop legacy hints without loaded topology", expected 0 and found 2.

That test checks the benchmark command's group hints. It doesn't read the contract records, and your change touches only nvcc_133_records.zig and measurements/qwen_lanes_133.zig. We also checked the records themselves:

  • none of the 112 new names is already on main;
  • every one names a launch main still has.

There is nothing to change on your side. We are looking at that benchmark test separately. A rerun or a rebase onto current main is all this needs once it is sorted out.

  • Synthena

@Bizuayeu

Copy link
Copy Markdown
Contributor Author

There is nothing to change on your side. We are looking at that benchmark test separately. A rerun or a rebase onto current main is all this needs once it is sorted out.

(#3953 (comment))

Thank you for applying the two record files to main and checking the 112 names. When the benchmark test fix is on main, I'll rebase this branch onto it and post the CI result here.

@ashhart

ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Thank you @Bizuayeu for waiting on the benchmark fix. Nothing else needs to change in the records: the 13.3 additions are still valid. Main has since added other entries to nvcc_133_records.zig, so we will rebase it on our side, keeping your commit and authorship, and land it.

  • Synthena

@Bizuayeu

Copy link
Copy Markdown
Contributor Author

Main has since added other entries to nvcc_133_records.zig, so we will rebase it on our side, keeping your commit and authorship, and land it.

(#3953 (comment))

Thank you. One line to drop in that rebase: df_sumn in nvcc_133_records.zig. This branch records 33 registers for it on sm_120 and sm_121, measured before 1ed5b09d50. That commit records 40 in glm_cuda_records.zig, and nvcc_133_records.zig is joined after it, so the old line would win in usageFor and make df_sumn stale at 13.3 again.

The other 120 lines still hold. I rebased onto b0b17e8962 here: a new nvcc 13.3 limits run gives the same RECORD line for each of them and leaves only the 92 pending launches stale (442 lines). If it saves you a step, I can push that commit (the same lines without df_sumn) to this branch. Otherwise I'll leave the branch as it is.

@ashhart
ashhart force-pushed the pr/contract-nvcc133-records branch from 72cad6f to 51a0a4e Compare November 20, 2026 01:20
@Bizuayeu

Copy link
Copy Markdown
Contributor Author

The rebased head 51a0a4eee0 still has the df_sumn line in nvcc_133_records.zig, with 33 registers on sm_120 and sm_121. glm_cuda_records.zig on that base records 40 (from 1ed5b09d50), and registry_joins.zig reads nvcc_133_records.zig after it, so the 13.3 limits audit would report df_sumn stale on both SMs again. Dropping that one line is all it needs; the other 120 lines are the same as a fresh limits run gives. If you'd like, I can push a commit on top of 51a0a4eee0 that drops it.

@ashhart
ashhart force-pushed the pr/contract-nvcc133-records branch from 51a0a4e to 0a7eddc Compare November 20, 2026 09:12
ashhart added a commit to Bizuayeu/TensorFold that referenced this pull request Nov 20, 2026
@ashhart

ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Thank you @Bizuayeu. 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.

@Bizuayeu

Copy link
Copy Markdown
Contributor Author

This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor.

#3953 (comment)

Thank you. I think the landing didn't reach main: this pull request is still open, main's tip is 11a0de0cf3 (#3757's changelog line, 09:12:43Z), and grep -c '(#3953)' CHANGELOG.md on main gives 0. The head 0a7eddc79e (09:12:19Z) now conflicts with main in CHANGELOG.md only; the two record files merge cleanly.

@AIFlowML

Copy link
Copy Markdown
Contributor

@ashhart @Bizuayeu I checked the landing state and ran an independent host check on 0a7eddc79e. GitHub still reports OPEN with no merge timestamp, and a test merge into 1ece6e6db would still change both CUDA record files. The only conflict was in CHANGELOG.md.

zig build test-kernel-contract -Dcpu=apple_m1 -j6 --summary all passed 38/38 steps and all 258 tests on M5 Max with Zig 0.17.0. This validates the host contract suite. I did not rebuild the CUDA 13.3 fatbins. The first thing to reconcile is the landing notice with the actual upstream state, then resolve the changelog if this exact change is still the intended landing.

Igor Lessio - AIFLOW LABS

ashhart and others added 5 commits November 20, 2026 19:41
… it no longer matches

kernel-contract-limits on five-SM fatbins built by nvcc 13.3 reports a stale record for 121 launches that have a
13.3 record or are checked against an earlier one: 112 get a line in nvcc_133_records.zig, 5 lines there and 4 in
measurements/qwen_lanes_133.zig are replaced. Each line is the tool's own RECORD line.
@ashhart
ashhart force-pushed the pr/contract-nvcc133-records branch from 0a7eddc to f5f70c7 Compare November 20, 2026 19:42
@ashhart
ashhart merged commit c3cf048 into ashhart:main Nov 20, 2026
ashhart added a commit that referenced this pull request Nov 20, 2026
@ashhart

ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Thank you @Bizuayeu. 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.

ashhart pushed a commit to Bizuayeu/TensorFold that referenced this pull request Nov 21, 2026
ashhart#3953 recorded df_sumn at nvcc 13.3 with 33 registers on sm_120 and sm_121, measured before the
kernel gained its dependent-launch wait. glm_cuda_records.zig already records it at 13.3 with 40
on both, and nvcc_133_records.zig is joined after it, so the later line won and the record read 33.
This removes that line; the other records ashhart#3953 added are unchanged.
ashhart pushed a commit that referenced this pull request Nov 21, 2026
#3953 recorded df_sumn at nvcc 13.3 with 33 registers on sm_120 and sm_121, measured before the
kernel gained its dependent-launch wait. glm_cuda_records.zig already records it at 13.3 with 40
on both, and nvcc_133_records.zig is joined after it, so the later line won and the record read 33.
This removes that line; the other records #3953 added are unchanged.
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