Skip to content

cuda experts: a bf16 format for a checkpoint's own bf16 experts - #1630

Open
BobClawblaw wants to merge 2 commits into
ashhart:mainfrom
BobClawblaw:cuda-experts-bf16
Open

BobClawblaw wants to merge 2 commits into
ashhart:mainfrom
BobClawblaw:cuda-experts-bf16

Conversation

@BobClawblaw

Copy link
Copy Markdown
Contributor

What this changes

A bf16 format for the grouped experts (experts_bf16.cu): a checkpoint's own bf16 weights in mma-fragment blocks,
relu^2 up and fp32 or bf16 down, in the decode form (items of 16 pairs) and the prompt form (items of 64). A row's sums
chain one mma per 16 inputs in input order, so its bits never depend on the rows beside it, its tile or its form. Used
by Nemotron 3.5 Transcribe, which ships its experts in bf16. Nothing else selects it. Stacked on #1629.

Receipt

  • Environment: one GB10 (sm_121), nvcc 13.0 and 13.2.
  • tf-cuda-test bf16-experts: the repack from both source layouts, up and both downs against float64, every row's
    bits the same at any row count and in both forms.
  • SUMMARY bf16 experts: 6 kernels, 6 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed
  • Full contract on the stack's top: SUMMARY 452 kernels: 452 pass gates 1-4, 0 fail, 6 known findings; 325 controls: 325 red as planted, 0 missed; 321 limit problems (the stack on main d33dcfc; none of the limit problems is in this stack's launches). The stack then rebased onto 3f0a715 without conflicts; the three sets, zig build test and the Transcribe clips were re-run there.
  • Shared code: experts.zig gains the bf16 format arm; other formats' dispatch is unchanged. One existing test moved
    to experts_refuse_test.zig to keep the file under 600 lines.

Overlap

atc overlap lists #1445 and #1446 as conflicting, in the shared registration lists (registry.zig, cuda_kernels.zig, kernels.zig, kernel-contract.md, tests/cuda/main.zig); whichever lands second rebases.

@BobClawblaw

Copy link
Copy Markdown
Contributor Author

Rebased onto d377fcc. The conflicts were the contract registrations shared with main's new sets (MOSS-Image's CUDA set, the EXL3 load-ahead controls): both sides kept, the bf16 experts' records, limits entry and family set added beside main's.

Checked: fmt, lean (0 new) and zig build test on this commit one rebase earlier (288a2df1f; main's one commit since changes only a cache persistence test), and on the stack's pushed top. The kernel-level runs (bf16-experts and the full CUDA kernel contract on a GB10, the full contract again on an RTX 5090) are listed on #1632, which this stack ends in.

@BobClawblaw

Copy link
Copy Markdown
Contributor Author

Rebased onto fbbc20d with the rest of the stack (#1632 met main's YaRN contextCeiling hook). No change to this PR's content; checked with fmt, lean (0 new) and zig build test on the same commit one rebase earlier, and on the stack's pushed top.

@ashhart

ashhart commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thanks @BobClawblaw. Since your last rebase, main's a4b3b060c put GB10's grouped affine-4 set into tests/cuda/contract_family_sets.zig's Sets (its init now takes affine4 and cap). Could you rebase onto current main, adding bf16_experts beside main's sets and keeping main's init signature, and post the full CUDA contract summary again? Then it can land ahead of #1631 and #1632. Commit 1 applies cleanly as is.

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.

2 participants