Skip to content

feat(dsv41): add general SM121 records for non-div-16 tile counts - #63

Merged
bertholomus merged 1 commit into
bertholomus:deepseek-v41-zig-tp2from
cbertucci33:dsv41-kit-nondiv16-sm121
Nov 22, 2026
Merged

bertholomus merged 1 commit into
bertholomus:deepseek-v41-zig-tp2from
cbertucci33:dsv41-kit-nondiv16-sm121

Conversation

@cbertucci33

Copy link
Copy Markdown

What this changes

Adds two general SM121 AOT records for DeepSeek-V4.1, with their cubins, for launches whose tile count is not a multiple of 16.

  • _index_score 052d6c1ceb0c0134932d80c70ab723b84d5d13784d79962cbb47a4560c82c02d
  • _score_keys 9ab1ce45d139729e01bf8351bd87df01bed63459cd2c0d8072656fd178e6e88f

No existing record, cubin or manifest entry is modified.

Why

At n=600000, nt=ceil(n/64)=9375, which is not divisible by 16. The current TP2 kit has 366 records; its matching float-score _index_score record 34247d211cd2... and its _score_keys HAS_TMAX=1 record df85d0b39e2d... both require n.div16 and nt.div16. Neither fits, and aot.Set.find returns MissingTritonVariant. The eager fallback in #62 cannot help: the variant is absent, not merely uncaptured.

The two new records are general in n and nt while keeping the existing pointer-alignment, dtype and constexpr constraints. Their argument names, types and constexprs match the current wrappers in zig/src/families/dsv41/tri_index.zig (indexScore and scoreKeys).

Provenance

  • Kernel source: src/tensorfold/families/deepseek_v41/cuda/kernels.py at Git 8e0966e2b09250abe2f6d9cc51edc20630e6eb1a, SHA256 723c3af1c9c1608f7c6439eb4e05d1cadfc7e633727a3b71f10552a67dd4a530.
  • Compiler: Triton 3.7.1+gitf797708c.nv26.7, CUDA 13.3 ptxas, aarch64, SM121.
  • Produced through the existing Recorder, triton_aot_manifest.py and aot_pack.py; the two selected records are the ones with n.div16=false and nt.div16=false.

The current Zig branch no longer carries the Python engine source. These are the tested cubins, with provenance above, not a claim of byte-reproducible regeneration from the current branch. A rebuild needs the pinned source and compiler.

Evidence

  • Fragment test: python3 -B tools/dsv41-zig/kit/test_nondiv16.py checks both records, parameter flags, metadata and cubin bytes. Against the current TP2 kit: 366 records, no hash collision.
  • Candidate kit with these records merged, actual Zig AOT loader on two GB10 GPUs:
    • 122 full-output validations and 80 negative-dispatch checks per GPU;
    • n=1, 64, 129, 262144, 599936, 599999, 600000, 600001, 600064, 600065, R=3/6;
    • eager, one capture and two replays with changed base/visibility, normal and TF_AOT_WEAKEST=1 policies;
    • exact CPU reference, prefix/suffix guards, and rejection of unsupported alignment, dtype, constexpr and ABI.
  • Host suite on this branch: zig build test --summary all passes (baseline run, no code change in this PR).

These are synthetic kernel and dispatch results, not full-inference qualification. They do not resolve the initiating CUDA error 1/901, and this float-score case is separate from the integer-key case in MiaAI-Lab issue #65.

How to use

The README includes a minimal merge snippet. Append the two records, copy the two cubins, then run pack_kit.py and verify_kit.sh to rebuild and check MANIFEST/SHA256SUMS.

Questions

  1. Is tools/dsv41-zig/kit/nondiv16-sm121/ the right home for the artifacts, or should they land as a kit bump in the TP2 and TP4 recipe repositories?
  2. Is the provenance above sufficient, or do you want a rebuild from a specific current source pin before review?

The same two SM121 cubins apply to both the TP2 and TP4 kits; only the manifest record sets differ.

…The current kits gate the float-score _index_score record and the\n_score_keys HAS_TMAX record on n.div16 and nt.div16. At n=600000,\nnt=9375, no record fits and Set.find returns MissingTritonVariant;\nan eager retry cannot supply the absent variant.\n\nAdd two general SM121 records compiled from the unchanged kernel\nsource, with their cubins and a metadata test. Existing records and\npayloads are untouched.\n\nSource: kernels.py at 8e0966e, SHA256 723c3af1...\nToolchain: Triton 3.7.1+gitf797708c.nv26.7, CUDA 13.3, SM121.\n
@bertholomus

Copy link
Copy Markdown
Owner

Thank you @cbertucci33 — this fills exactly the gap you named on 16 November: at n=600000, nt=9375, neither the kit's float-score _index_score record nor the HAS_TMAX=1 _score_keys record fits (both require divisible-by-16), so the eager fallback in #62 cannot help — the variant is absent, not merely uncaptured. General records that keep the existing alignment, dtype and constexpr constraints, with nothing existing modified, are the right shape.

We are reviewing it now, together with your two questions — whether the recorded provenance is sufficient or a rebuild from a pinned source should come first, and whether the same two cubins serve the TP2 and TP4 kits — and will follow up in this thread.

@bertholomus bertholomus added the enhancement New feature or request label Nov 20, 2026
@bertholomus

Copy link
Copy Markdown
Owner

Thank you @cbertucci33 — and credit for finding this gap on 11-16: at n=600000 the kit carries no non-div-16 float-score variant, so the #62 fallback cannot help there. Accepted. Your two questions: (1) the recorded provenance is enough for these tested artifacts — the pinned kernel source, the file hashes and the compiler you list stand as recorded; no rebuild is needed first. (2) Appending the same two records covers both kits; we will do that append and verify it on each kit ourselves before a kit carrying them is served, so the TP4 carry is our step, not yours. Before it merges, our checks run on the exact head, and the result will be posted here.

@bertholomus
bertholomus merged commit ea64a87 into bertholomus:deepseek-v41-zig-tp2 Nov 22, 2026
@bertholomus

Copy link
Copy Markdown
Owner

Merged — thank you @cbertucci33! The decided checks ran on your exact head c752a8c3 before the merge: the kit metadata guard, the host suite unchanged vs the branch baseline, a build, and fmt on the PR files — all pass, with the records verified against both served kits and no collision. Squashed onto deepseek-v41-zig-tp2 as ea64a870. It is not in a release yet.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants