Skip to content

qwen3_5 cuda: a plain BF16 checkpoint loads as a decision backbone, chat refused by name (#2324 step 1) - #2383

Open
laudney wants to merge 10 commits into
ashhart:mainfrom
laudney:pr-clef-cuda-1
Open

laudney wants to merge 10 commits into
ashhart:mainfrom
laudney:pr-clef-cuda-1

Conversation

@laudney

@laudney laudney commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor
Cloudflare/clef-flash (BF16) on one GB10 main this PR
serve the checkpoint UnsupportedQwenQuantization (no plain-BF16 path) refused by name in 0.44 s, before the weights load: "the joint schema head (POST /v1/systemone) is not served on CUDA by this build" (QwenJointHeadNotServed) until plan step 3
The same weights without joint_head_config.json same "BF16 Qwen3.5 serves as a decision backbone only: this checkpoint has no joint_head_config.json" (QwenBf16DecisionOnly)
--drafter, --slide, --vision, --kv-cache fp8, --prompt-precision int8 on it same as the row above each refused by its own name; on the GB10 --drafter gives "--drafter: a BF16 Qwen3.5 decision backbone drafts nothing; serve without --drafter"
A quantized Qwen3.5 checkpoint that ships joint_head_config.json opens for chat refused: "the joint schema head needs the BF16 checkpoint: this one is quantized" (QwenHeadNeedsBf16), as on HIP
capabilities --json "decisions": {} unchanged: "decisions": {}; the BF16 listing comes with plan step 3, where /v1/systemone serves
Final-norm rows vs transformers FP32, mean abs error (40 records) — 1.258e-2 / 1.002e-2 / 9.757e-3 / 9.447e-3 per length band; transformers BF16 1.321e-2 / 1.011e-2 / 9.724e-3 / 9.464e-3
Rows at prompt cuts of 512, 1,024 and 4,096 — 0 of 239,538 rows differ (byte-identical)
TensorFold/Qwen3.8-27B-MLX-4bit tokens, decode, prompt — token-identical to main; speeds within run-to-run noise (tables below)

What this changes

Plan step 1 of #2324: the CUDA Qwen3.5 engine loads the publisher's plain BF16 checkpoint as a decision backbone, as on HIP (#2046), and refuses chat and every flag the joint schema head is not qualified with by a named error before any device work. Its norms scale by 1 + w in FP32 (HF's raw Qwen3.5 norm weights), and a readout piece can keep its final-norm rows with no head (Keep.rows), which plan step 2 consumes.

Checks on this head

  • Head commit: 7311c7ef8. Engine code is 58d77dc3c, which the receipts ran, less the CUDA decision_formats listing (0be7071d2), which no open path reads.
  • Lean checker on base 0d7152955 and on this head: 252 and 252, 0 new.
  • Tests run:
    • CUDA suite on the GB10 (zig build test-cuda with the device tests): 565/565 steps, 7339/7400 tests passed, 61 skipped.
    • zig build test test-golden (host, Linux x86_64): first run 7353/7414 passed, 60 skipped, 1 failed in test-cuda-host; the failure did not repeat: the two binaries it reported pass alone with the same seed 0xd7652ec0 (114/114; 1,110/1,112, 2 skipped), and a second full run exits 0.
    • On 7311c7ef8: zig build test-cuda-host test-qwen35-modelopt-admission-host exits 0.
    • zig build test-qwen35-modelopt-admission-host: 117/117, with the Clef-shaped BF16 configs (decision-only, every refusal, tied and MoE refused, slots in the BF16 lane).
    • tf-cuda-test qwen-norm-shift: both shift kernels within one BF16 ulp of FP64 (1 + w) x inv over 5 rows of 4,096 and 30 heads of 256; the unshifted kernels on raw w fail the same gate (controls red); the gate rejects NaN and inf on its own fixture first.
    • tf-qwen35-cuda <clef> rows-last and rows-cuts: the last row of Keep.rows equals the head path's final-norm row; pieces of 16 to 512 give 0 differing rows.
    • zig fmt --check build.zig zig and git diff --check: pass.
  • CI: not started. GitHub runs no pull_request workflow while the PR conflicts with main, and the only conflict is CHANGELOG.md (main 8bf5dbc35; the merged registry.zig is 599 lines).
  • Not run, and why: Metal and HIP are not reached (CUDA Qwen3.5 files and one CUDA kernel file only). CUDA SMs other than sm_121 ran the limits check only (records below).

Receipt

  • Environment: base 0d7152955, head 8f60977cf (receipt binaries from 58d77dc3c); Zig 0.17.0; CUDA 13.4 for the builds and runs, nvcc 13.0 for the launch records; NVIDIA GB10 (sm_121, 128 GB shared memory, Linux aarch64); checkpoints Cloudflare/clef-flash fb4417d31c1d0f9e7e77f1141b40aaede7491e00 and TensorFold/Qwen3.8-27B-MLX-4bit 22d8d538154e0e5b6f8dcb1fcc74a60a0798104c.

  • Paths and platforms: the CUDA Qwen3.5 engine. A BF16 checkpoint takes the new parse, preflight count, refusals and shift norms; every served CUDA Qwen3.5 checkpoint (MLX, ModelOpt NVFP4, compressed-tensors, EXL3) passes through the same open, forward and finish, so the 27B rows below cover the existing path. Ran: GB10. Not run: other CUDA GPUs (records only).

  • Rows vs transformers, tools/clef_backbone_rows.py over 40 records of the public corpus, pooled mean abs error of the final-norm rows against transformers FP32:

    Prompt tokens TensorFold CUDA transformers BF16
    245-1,024 1.258e-2 1.321e-2
    1,025-4,096 1.002e-2 1.011e-2
    4,097-10,240 9.757e-3 9.724e-3
    10,241-16,384 9.447e-3 9.464e-3

    The top-1 next token never differs from transformers BF16's. Without the 1 + w fix the 3,000-token probe read 2.84e-2 (BF16 2.49e-2); with it, 2.60e-2. The GDN chain stays in its BF16 lanes; the 4,097-10,240 band is 0.34% further from FP32 than transformers BF16.

  • Exactness, tools/bench_concurrent.py --tokens 256 --reps 3 --temperatures 0 --levels 1,4 --alone --serial, 27B, runs in the order main, this PR, the readouts PR, the readouts PR, this PR, main: every cell's concurrent, alone and serial token_sha256 agree within each run and across all six runs (code 2b28aa2108de…, chat a06fab348fbe…).

  • Main against this branch (27B, --prompt-cache-gib 0 --context 70000, one server per run):

    Run 1 stream code / chat tok/s 4 streams code / chat tok/s bench_openai decode median, fibonacci-raw / gpu-chat-no-think
    main 1st 14.9 / 15.2 51.9 / 52.3 14.90 / 15.24
    this PR 1st 15.0 / 15.3 52.3 / 52.6 14.95 / 15.29
    this PR 2nd 15.0 / 15.3 52.4 / 52.6 14.97 / 15.31
    main 2nd 15.0 / 15.3 52.3 / 52.7 14.98 / 15.32
  • Prompt speed, cold, best of 3 (one request, fresh KV):

    Tokens main 1st this PR 1st this PR 2nd main 2nd
    2,048 1,350 1,356 1,357 1,358
    8,192 1,353 1,353 1,354 1,354
    32,768 1,243 1,243 1,243 1,234
    65,536 1,124 1,123 1,123 1,124

    tools/bench_cache.py --require-cold, 32k prompt, first request ttft_s: main 26.33 s and 26.30 s, this PR 26.31 s and 26.32 s.

  • Licence of new weights: n/a (no weights shipped; the receipts read Cloudflare/clef-flash under its own licence).

Kernel contract
  • Kernels registered: tf_q35_norm_shift and tf_q35_head_norm_shift (contract_q35_norm_shift.zig: the residual-add norm at 4,096 and the q/k head norm at 256, with and without residual), beside tf_q35_norm and tf_q35_head_norm, which they do not replace (every non-BF16 checkpoint keeps those).

  • Planted controls: each shift kernel's runner plants the unshifted weight; both red.

  • SUMMARY 592 kernels: 592 pass gates 1-4, 0 fail, 8 known findings; 373 controls: 373 red as planted, 0 missed; 689 limit problems; gates 3261206 ms, limits 962691 ms, exit 1. The 689 limit problems are the CUDA 13.4 build checked against records from nvcc 13.0; the records check is the 13.0 one below.

  • Records from nvcc 13.0 (zig build fatbins kernel-contract-fatbins -Dnvcc=…/cuda-13.0/bin/nvcc -Dsm=80,86,89,120,121, then tf-cuda-test kernel-contract-limits zig-out/fatbin): tf_q35_norm_shift 54/55/55/48/48 registers, 16,416 static shared bytes, bound 256; tf_q35_head_norm_shift 24/24/24/22/22 registers, 16 bytes, bound 64; every new record current. FAIL kernel-contract-limits: 226 problems on this head and 226 on main: all inherited.

  • Chips run: GB10 (sm_121) for gates 1-4 and the controls. sm_80, sm_86, sm_89 and sm_120: limits only.

  • The two shared kernels, tf_q35_norm and tf_q35_head_norm, now wrap the templates with SHIFT = false. Main 0d7152955 against this PR's kernel source (58d77dc3c, unchanged since), both from one nvcc 13.0 build (zig build fatbins -Dnvcc=…/cuda-13.0/bin/nvcc -Dsm=80,86,89,120,121; qwen35.fatbin is the only fatbin with these kernels). SASS hash: sha256 (first 16) of the cuobjdump -sass -arch sm_XX -fun <kernel> instruction lines. Registers and static shared from cuobjdump -res-usage:

    Kernel SM SASS main SASS this PR Registers main / this PR Static shared
    tf_q35_norm 80 48540065e5bc0ce1 same 54 / 54 16,416 both
    tf_q35_norm 86 6e1f640ee37e6e27 same 55 / 55 16,416 both
    tf_q35_norm 89 834eb1a3c5c15bda same 55 / 55 16,416 both
    tf_q35_norm 120, 121 077f28021fc3f4ef d80d6041e8161223 48 / 48 16,416 both
    tf_q35_head_norm 80 86ed40157f9efdbe same 24 / 24 16 both
    tf_q35_head_norm 86 1cd8821dc3a5b290 same 24 / 24 16 both
    tf_q35_head_norm 89 361c32b3f79d0e23 same 24 / 24 16 both
    tf_q35_head_norm 120, 121 525e1cb20d4359d4 6189ad939c62b68a 23 / 22 16 both

    tf_q35_norm's record (54/55/55/48/48, 16,416) holds on both; tf_q35_head_norm has no launch record on main. At sm_120/121 the SASS differs in register names, integer address arithmetic (IADD3 for LOP3 on the same offsets) and, in tf_q35_head_norm, the order of its instructions; the floating-point instructions are the same in kind and count, and in tf_q35_norm the floating-point and memory sequence is the same. To show the bytes, a driver-API harness loads both qwen35.fatbin files on the GB10 and runs each kernel on the same random BF16 inputs: tf_q35_norm at D 1,024 to 8,192 (both the 8-wide and the scalar paths) with and without the residual, the group sums and the row count, at two input scales; tf_q35_head_norm at 4, 16 and 32 heads, packed and strided, with and without the row count. PASS 152 of 152 cases byte-identical (74103680 output bytes compared); its control (the second fatbin run with eps 2e-6) gives FAIL 76 of 152. sm_120's SASS hash equals sm_121's on both sides, so the GB10 run covers it.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
  • No precision traded for speed. If the bits change, the description says which sums change and why.
  • 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: 1 and 4 streams measured (8 admitted, not run); no drafter run, because the 27B path takes no new branch with one

@ashhart

ashhart commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Thanks @laudney. The step 1 read matches the plan:

  • the BF16 admission only covers the case main refused, and every new branch is gated on g.bf16;
  • the refusals come by name before the weights load;
  • Keep.verifies() keeps the old meaning for every existing Keep;
  • the 27B main-against-branch rows we asked for are here and clean.

Four small things:

  1. Two shared kernels. tf_q35_norm and tf_q35_head_norm now wrap the new templates. The arithmetic reads the same, but these kernels run on every served Qwen 3.5 token. Could you post their SASS or cubin hashes, main against this head, with their register and shared-memory records, at sm_80/86/89/120/121 from the same nvcc 13.0 build as the new records?
  2. Capabilities. decision_formats = {"bf16"} makes capabilities --json list BF16 decisions on CUDA, while cuda_decide.check still refuses every BF16 open with QwenJointHeadNotServed until step 3. Could the listing move into the step 3 PR, where /v1/systemone serves?
  3. CHANGELOG. Please end the line "(qwen3_5 cuda: a plain BF16 checkpoint loads as a decision backbone, chat refused by name (#2324 step 1) #2383, part of Clef-Flash on native CUDA: /v1/systemone through the joint schema head (GB10) #2324). Thanks to @laudney."
  4. One new refusal. A quantized checkpoint that ships joint_head_config.json is now refused (QwenHeadNeedsBf16), where main opened it for chat. If that's intended, please say so in the CHANGELOG line.

@laudney

laudney commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @ashhart. All four are in 0be7071d2 and 7311c7ef8 (head 7311c7ef8, pushed without a force-push):

Ask Answer
1. SASS of tf_q35_norm and tf_q35_head_norm, main against this head One nvcc 13.0 build each, sm_80/86/89/120/121. sm_80, 86 and 89: the SASS is byte-identical for both kernels. sm_120/121: the SASS differs in register names and integer address arithmetic only; the floating-point instructions are the same in kind and count, and the outputs are byte-identical on the GB10 (152 of 152 cases, 74 MB of output; the planted eps control fails 76 of 152). Registers: tf_q35_norm 54/55/55/48/48 on both, as its record; tf_q35_head_norm 24/24/24/23/23 on main, 24/24/24/22/22 here (it has no launch record on main). Static shared unchanged. The per-SM hashes are in the description's kernel contract section.
2. The capabilities listing Removed from this PR (0be7071d2): capabilities --json keeps "decisions": {} on CUDA, as on main. The BF16 refusals do not read the listing, so every refusal is unchanged. The listing returns in the step 3 PR with /v1/systemone.
3. CHANGELOG ending Done: "… (#2383, part of #2324). Thanks to @laudney."
4. QwenHeadNeedsBf16 Intended: it is HIP's rule since #2046 (decisionOnly in the HIP engine refuses a quantized checkpoint with joint_head_config.json), because the head is qualified on the BF16 backbone only. The CHANGELOG line now says so.

#2384 has the same two commits picked with the same patches, so a rebase onto this PR drops them.

@ashhart

ashhart commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Thanks @laudney. Asks 2 to 4 are in: capabilities --json keeps "decisions": {} on CUDA, the CHANGELOG line ends as asked, and it names the QwenHeadNeedsBf16 refusal, which matches HIP's decisionOnly on main.
One follow-up on the two shared norms. Thanks for the sm_80/86/89 result: byte-identical SASS settles it there. At sm_120 and sm_121 the SASS differs, and tf_q35_head_norm goes from 23 to 22 registers. Those are the targets where these kernels serve most. The 152 byte-identical cases and the planted eps control are good evidence, but "the same in kind and count" doesn't tell us the floating-point instructions run in the same order. Could you post the sm_121 SASS diff of both kernels, main against this head?

@laudney

laudney commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @ashhart. Here is the sm_121 SASS (nvcc 13.0, the same qwen35.fatbin builds as before, cuobjdump -sass -arch sm_121 -fun <kernel>, addresses and encodings stripped). The floating-point dependency chains are the same in both kernels; only register names, integer address arithmetic and the place of independent instructions differ.

Kernel Instructions main / head What differs Floating-point order
tf_q35_norm 2,064 / 2,064 3 lines: LOP3.LUT (OR) becomes IADD3 (ADD) for t*8 + 0x800, + 0x1000, + 0x1800. t*8 <= 2,040 < 0x800, so OR and ADD give the same offsets. Same: the other 2,061 lines are identical, so all floating-point and memory instructions run in the same order.
tf_q35_head_norm 136 / 128 (14 / 8 trailing NOPs) Register names; the weight address is LEA/LEA.HI.X instead of IMAD.SHL/IADD.64; the four weight loads issue in a different order; two F2FP packs swap. Same chains, in the same order: see below.

tf_q35_head_norm, each floating-point operation (v0..v3 = x[4t..4t+3], w0..w3 = W[4t..4t+3]):

Step main (line, register) head (line, register)
acc = v0·v0 + 0, then + v1·v1, + v2·v2, + v3·v3 (FFMA chain) 65, 67, 69, 70 63, 65, 67, 68
warp butterfly 16, 8, 4, 2, 1 (SHFL.BFLY + FADD(own, other)) 71-81 69-80
sums[0] + sums[1], then FFMA(·, 1/256, eps) 87, 88 85, 86
denormal guard, MUFU.RSQ, FMUL 4096 fix-up 89-91, 99 87-89, 97
v1·inv, v2·inv, v0·inv, v3·inv 103-106 100-103
w1·(v1·inv), w2·(v2·inv), w0·(v0·inv), w3·(v3·inv) 107, 109, 110, 111 104, 105, 107, 108
F2FP.BF16 round-to-nearest of the four lanes 1, 2, 0, 3 (112-116) lanes 2, 1, 0, 3 (110-113)
stores to +2, +4, +0, +6 117-120 115-118

The only floating-point reorder is the two independent F2FP packs of lanes 1 and 2, which read different registers and write different stores, so the result cannot change. This agrees with the 152 byte-identical cases on the GB10.

tf_q35_norm sm_121 diff (main → head)
--- main
+++ head
@@ -20,9 +20,9 @@
 LDC.64 R6, c[0x0][0x390];
 SHF.L.U32 R4, R0, 0x3, RZ;
 LDCU.64 UR14, c[0x0][0x388];
-LOP3.LUT R37, R4.reuse, 0x800, RZ, 0xfc, !PT;
-LOP3.LUT R36, R4.reuse, 0x1000, RZ, 0xfc, !PT;
-LOP3.LUT R3, R4.reuse, 0x1800, RZ, 0xfc, !PT;
+IADD3 R37, PT, PT, R4.reuse, 0x800, RZ;
+IADD3 R36, PT, PT, R4.reuse, 0x1000, RZ;
+IADD3 R3, PT, PT, R4.reuse, 0x1800, RZ;
 ISETP.GE.AND P0, PT, R4, UR8, PT;
 ISETP.GE.AND P3, PT, R37, UR8, PT;
 ISETP.GE.AND P1, PT, R36, UR8, PT;
tf_q35_head_norm sm_121, main and head side by side (line numbers as in the table)
     1 LDC R1, c[0x0][0x37c];                                 |     1 LDC R1, c[0x0][0x37c];
     2 LDC R5, c[0x0][0x398];                                 |     2 LDC R7, c[0x0][0x398];
     3 LDCU.64 UR6, c[0x0][0x3a8];                            |     3 LDCU.64 UR6, c[0x0][0x3a8];
     4 S2UR UR4, SR_CTAID.X;                                  |     4 S2UR UR4, SR_CTAID.X;
     5 UISETP.NE.S64.AND UP0, UPT, UR6, URZ, UPT;             |     5 UISETP.NE.S64.AND UP0, UPT, UR6, URZ, UPT;
     6 LDCU.64 UR6, c[0x0][0x358];                            |     6 LDCU.64 UR6, c[0x0][0x358];
     7 I2F.U32.RP R0, R5;                                     |     7 I2F.U32.RP R0, R7;
     8 ISETP.NE.U32.AND P2, PT, R5, RZ, PT;                   |     8 ISETP.NE.U32.AND P2, PT, R7, RZ, PT;
     9 MUFU.RCP R0, R0;                                       |     9 MUFU.RCP R0, R0;
    10 IADD3 R2, PT, PT, R0, 0xffffffe, RZ;                   |    10 IADD3 R2, PT, PT, R0, 0xffffffe, RZ;
    11 F2I.FTZ.U32.TRUNC.NTZ R3, R2;                          |    11 F2I.FTZ.U32.TRUNC.NTZ R3, R2;
    12 HFMA2 R2, -RZ, RZ, 0, 0;                               |    12 HFMA2 R2, -RZ, RZ, 0, 0;
    13 IADD3 R4, PT, PT, RZ, -R3, RZ;                         |    13 IADD3 R4, PT, PT, RZ, -R3, RZ;
    14 IMAD R7, R4, R5, RZ;                                   |    14 IMAD R5, R4, R7, RZ;
    15 IMAD.HI.U32 R3, R3, R7, R2;                            |    15 IMAD.HI.U32 R3, R3, R5, R2;
    16 IMAD.HI.U32 R4, R3, UR4, RZ;                           |    16 IMAD.HI.U32 R6, R3, UR4, RZ;
    17 IADD3 R6, PT, PT, -R4, RZ, RZ;                         |    17 IADD3 R4, PT, PT, -R6, RZ, RZ;
    18 IMAD R0, R5, R6, UR4;                                  |    18 IMAD R0, R7, R4, UR4;
    19 ISETP.GE.U32.AND P0, PT, R0, R5, PT;                   |    19 ISETP.GE.U32.AND P0, PT, R0, R7, PT;
    20 @P0 IADD3 R0, PT, PT, R0, -R5, RZ;                     |    20 @P0 IADD3 R0, PT, PT, R0, -R7, RZ;
    21 @P0 IADD3 R4, PT, PT, R4, 0x1, RZ;                     |    21 @P0 IADD3 R6, PT, PT, R6, 0x1, RZ;
    22 ISETP.GE.U32.AND P1, PT, R0, R5, PT;                   |    22 ISETP.GE.U32.AND P1, PT, R0, R7, PT;
    23 @P1 IADD3 R4, PT, PT, R4, 0x1, RZ;                     |    23 @P1 IADD3 R6, PT, PT, R6, 0x1, RZ;
    24 @!P2 LOP3.LUT R4, RZ, R5, RZ, 0x33, !PT;               |    24 @!P2 LOP3.LUT R6, RZ, R7, RZ, 0x33, !PT;
    25 IADD3 R2, PT, PT, -R4, RZ, RZ;                         |    25 IADD3 R2, PT, PT, -R6, RZ, RZ;
    26 IMAD R2, R5, R2, UR4;                                  |    26 IMAD R2, R7, R2, UR4;
    27 BRA.U !UP0, 0x1f0;                                     |    27 BRA.U !UP0, 0x1f0;
    28 LDC.64 R6, c[0x0][0x3a8];                              |    28 LDC.64 R4, c[0x0][0x3a8];
    29 LDG.E.CONSTANT R7, desc[UR6][R6.64+0x8];               |    29 LDG.E.CONSTANT R5, desc[UR6][R4.64+0x8];
    30 ISETP.GE.AND P0, PT, R4, R7, PT;                       |    30 ISETP.GE.AND P0, PT, R6, R5, PT;
    31 @P0 EXIT;                                              |    31 @P0 EXIT;
    32 LDCU UR4, c[0x0][0x3a0];                               |    32 LDCU UR4, c[0x0][0x3a0];
    33 S2R R3, SR_TID.X;                                      |    33 S2R R3, SR_TID.X;
    34 MOV R9, RZ;                                            |    34 MOV R5, RZ;
    35 LDCU UR5, c[0x0][0x39c];                               |    35 LDCU UR5, c[0x0][0x39c];
    36 LDCU.64 UR8, c[0x0][0x380];                            |    36 LDCU.64 UR8, c[0x0][0x380];
    37 IMAD R6, R2, UR4, RZ;                                  |    37 IMAD R8, R2, UR4, RZ;
    38 USHF.R.S32.HI UR4, URZ, 0x1f, UR5;                     |    38 USHF.R.S32.HI UR4, URZ, 0x1f, UR5;
    39 SHF.R.S32.HI R7, RZ, 0x1f, R6;                         |    39 SHF.R.S32.HI R9, RZ, 0x1f, R8;
    40 IMAD.WIDE.U32 R6, R4, UR5, R6;                         |    40 IMAD.WIDE.U32 R8, R6, UR5, R8;
    41 IMAD R7, R4, UR4, R7;                                  |    41 IMAD R9, R6, UR4, R9;
    42 LDCU.64 UR4, c[0x0][0x388];                            |    42 LDCU.64 UR4, c[0x0][0x388];
    43 IMAD.SHL.U32 R8, R3, 0x4, RZ;                          |    43 IMAD.SHL.U32 R4, R3, 0x4, RZ;
    44 IADD.64 R6, R8, R6;                                    |    44 IADD.64 R8, R4, R8;
    45 LEA R14, P0, R6, UR8, 0x1;                             |    45 LEA R12, P0, R8, UR8, 0x1;
    46 LEA.HI.X R15, R6, UR9, R7, 0x1, P0;                    |    46 LEA.HI.X R13, R8, UR9, R9, 0x1, P0;
    47 LDG.E.U16.CONSTANT R0, desc[UR6][R14.64];              |    47 LDG.E.U16.CONSTANT R0, desc[UR6][R12.64];
    48 LDG.E.U16.CONSTANT R12, desc[UR6][R14.64+0x2];         |    48 LDG.E.U16.CONSTANT R11, desc[UR6][R12.64+0x2];
    49 LDG.E.U16.CONSTANT R13, desc[UR6][R14.64+0x4];         |    49 LDG.E.U16.CONSTANT R17, desc[UR6][R12.64+0x4];
    50 LDG.E.U16.CONSTANT R19, desc[UR6][R14.64+0x6];         |    50 LDG.E.U16.CONSTANT R18, desc[UR6][R12.64+0x6];
    51 IMAD.SHL.U32 R6, R8, 0x2, RZ;                          |    51 LEA R14, P0, R4, UR4, 0x1;
    52 SHF.R.U32.HI R7, RZ, 0x1f, R8;                         |    52 LEA.HI.X R15, R4, UR5, RZ, 0x1, P0;
    53 IADD.64 R16, R6, UR4;                                  |    53 LDG.E.U16.CONSTANT R8, desc[UR6][R14.64+0x4];
    54 LDG.E.U16.CONSTANT R8, desc[UR6][R16.64+0x2];          |    54 LDG.E.U16.CONSTANT R5, desc[UR6][R14.64+0x2];
    55 LDG.E.U16.CONSTANT R10, desc[UR6][R16.64+0x4];         |    55 LDG.E.U16.CONSTANT R10, desc[UR6][R14.64+0x6];
    56 LDG.E.U16.CONSTANT R11, desc[UR6][R16.64+0x6];         |    56 LDG.E.U16.CONSTANT R9, desc[UR6][R14.64];
    57 LDG.E.U16.CONSTANT R9, desc[UR6][R16.64];              |    57 S2UR UR5, SR_CgaCtaId;
    58 S2UR UR5, SR_CgaCtaId;                                 |    58 LOP3.LUT P0, RZ, R3, 0x1f, RZ, 0xc0, !PT;
    59 LOP3.LUT P0, RZ, R3, 0x1f, RZ, 0xc0, !PT;              |    59 UMOV UR4, 0x400;
    60 UMOV UR4, 0x400;                                       |    60 ULEA UR4, UR5, UR4, 0x18;
    61 ULEA UR4, UR5, UR4, 0x18;                              |    61 IMAD.U32 R0, R0, 0x10000, RZ;
    62 @!P0 LEA.HI R3, R3, UR4, RZ, 0x1d;                     |    62 SHF.L.U32 R11, R11, 0x10, RZ;
    63 SHF.L.U32 R0, R0, 0x10, RZ;                            |    63 FFMA R16, R0, R0, RZ;
    64 IMAD.U32 R12, R12, 0x10000, RZ;                        |    64 IMAD.U32 R12, R17, 0x10000, RZ;
    65 FFMA R15, R0, R0, RZ;                                  |    65 FFMA R17, R11, R11, R16;
    66 SHF.L.U32 R13, R13, 0x10, RZ;                          |    66 SHF.L.U32 R13, R18, 0x10, RZ;
    67 FFMA R18, R12, R12, R15;                               |    67 FFMA R16, R12, R12, R17;
    68 IMAD.U32 R14, R19, 0x10000, RZ;                        |    68 FFMA R16, R13, R13, R16;
    69 FFMA R15, R13, R13, R18;                               |    69 SHFL.BFLY PT, R17, R16, 0x10, 0x1f;
    70 FFMA R15, R14, R14, R15;                               |    70 FADD R17, R16, R17;
    71 SHFL.BFLY PT, R18, R15, 0x10, 0x1f;                    |    71 SHFL.BFLY PT, R14, R17, 0x8, 0x1f;
    72 FADD R18, R15, R18;                                    |    72 FADD R14, R17, R14;
    73 LDC R15, c[0x0][0x3a4];                                |    73 SHFL.BFLY PT, R15, R14, 0x4, 0x1f;
    74 SHFL.BFLY PT, R17, R18, 0x8, 0x1f;                     |    74 FADD R15, R14, R15;
    75 FADD R17, R18, R17;                                    |    75 SHFL.BFLY PT, R18, R15, 0x2, 0x1f;
    76 SHFL.BFLY PT, R16, R17, 0x4, 0x1f;                     |    76 FADD R18, R15, R18;
    77 FADD R16, R17, R16;                                    |    77 SHFL.BFLY PT, R19, R18, 0x1, 0x1f;
    78 SHFL.BFLY PT, R19, R16, 0x2, 0x1f;                     |    78 @!P0 LEA.HI R16, R3, UR4, RZ, 0x1d;
    79 FADD R19, R16, R19;                                    |    79 LDC R3, c[0x0][0x3a4];
    80 SHFL.BFLY PT, R20, R19, 0x1, 0x1f;                     |    80 FADD R19, R18, R19;
    81 FADD R20, R19, R20;                                    |    81 @!P0 STS [R16], R19;
    82 @!P0 STS [R3], R20;                                    |    82 BAR.SYNC.DEFER_BLOCKING 0x0;
    83 BAR.SYNC.DEFER_BLOCKING 0x0;                           |    83 LDS.64 R14, [UR4];
    84 LDS.64 R16, [UR4];                                     |    84 LDCU.64 UR4, c[0x0][0x390];
    85 MOV R3, RZ;                                            |    85 FADD R14, R14, R15;
    86 LDCU.64 UR4, c[0x0][0x390];                            |    86 FFMA R14, R14, 0.00390625, R3;
    87 FADD R16, R16, R17;                                    |    87 FSETP.GEU.AND P0, PT, |R14|, 1.175494350822287508e-38, PT;
    88 FFMA R16, R16, 0.00390625, R15;                        |    88 @!P0 FMUL R14, R14, 16777216;
    89 FSETP.GEU.AND P0, PT, |R16|, 1.175494350822287508e-38, PT;|    89 MUFU.RSQ R15, R14;
    90 @!P0 FMUL R16, R16, 16777216;                          |    90 MOV R3, RZ;
    91 MUFU.RSQ R15, R16;                                     |    91 SHF.R.S32.HI R17, RZ, 0x1f, R7;
    92 SHF.R.S32.HI R17, RZ, 0x1f, R5;                        |    92 IMAD.WIDE.U32 R2, R6, R7, R2;
    93 IMAD.WIDE.U32 R2, R4, R5, R2;                          |    93 SHF.L.U32 R8, R8, 0x10, RZ;
    94 IMAD R5, R4, R17, R3;                                  |    94 SHF.L.U32 R10, R10, 0x10, RZ;
    95 SHF.L.U32 R3, R2, 0x9, RZ;                             |    95 IMAD R17, R6, R17, R3;
    96 IMAD.U32 R8, R8, 0x10000, RZ;                          |    96 IMAD.U32 R5, R5, 0x10000, RZ;
    97 SHF.L.U64.HI R5, R2, 0x9, R5;                          |    97 @!P0 FMUL R15, R15, 4096;
    98 LOP3.LUT R2, R3, R6, RZ, 0xfc, !PT;                    |    98 LEA R7, P0, R2, R4, 0x8;
    99 @!P0 FMUL R15, R15, 4096;                              |    99 IMAD.U32 R9, R9, 0x10000, RZ;
   100 SHF.L.U32 R10, R10, 0x10, RZ;                          |   100 FMUL R6, R11, R15.reuse;
   101 IMAD.U32 R9, R9, 0x10000, RZ;                          |   101 FMUL R3, R12, R15.reuse;
   102 SHF.L.U32 R11, R11, 0x10, RZ;                          |   102 FMUL R0, R0, R15.reuse;
   103 FMUL R3, R12, R15.reuse;                               |   103 FMUL R13, R13, R15;
   104 FMUL R13, R13, R15.reuse;                              |   104 FMUL R5, R5, R6;
   105 FMUL R0, R0, R15.reuse;                                |   105 FMUL R3, R8, R3;
   106 FMUL R14, R14, R15;                                    |   106 LEA.HI.X R6, R2, RZ, R17, 0x8, P0;
   107 FMUL R8, R8, R3;                                       |   107 FMUL R0, R9, R0;
   108 LOP3.LUT R3, R5, R7, RZ, 0xfc, !PT;                    |   108 FMUL R10, R10, R13;
   109 FMUL R10, R10, R13;                                    |   109 LEA R2, P0, R7, UR4, 0x1;
   110 FMUL R0, R9, R0;                                       |   110 F2FP.BF16.F32.PACK_AB R4, RZ, R3;
   111 FMUL R11, R11, R14;                                    |   111 F2FP.BF16.F32.PACK_AB R5, RZ, R5;
   112 F2FP.BF16.F32.PACK_AB R8, RZ, R8;                      |   112 F2FP.BF16.F32.PACK_AB R0, RZ, R0;
   113 IADD.64 R2, R2, UR4;                                   |   113 F2FP.BF16.F32.PACK_AB R10, RZ, R10;
   114 F2FP.BF16.F32.PACK_AB R10, RZ, R10;                    |   114 LEA.HI.X R3, R7, UR5, R6, 0x1, P0;
   115 F2FP.BF16.F32.PACK_AB R0, RZ, R0;                      |   115 STG.E.U16 desc[UR6][R2.64+0x2], R5;
   116 F2FP.BF16.F32.PACK_AB R11, RZ, R11;                    |   116 STG.E.U16 desc[UR6][R2.64+0x4], R4;
   117 STG.E.U16 desc[UR6][R2.64+0x2], R8;                    |   117 STG.E.U16 desc[UR6][R2.64], R0;
   118 STG.E.U16 desc[UR6][R2.64+0x4], R10;                   |   118 STG.E.U16 desc[UR6][R2.64+0x6], R10;
   119 STG.E.U16 desc[UR6][R2.64], R0;                        |   119 EXIT;
   120 STG.E.U16 desc[UR6][R2.64+0x6], R11;                   |   120 BRA 0x770;
   121 EXIT;                                                  |   121 NOP;
   122 BRA 0x790;                                             |   122 NOP;
   123 NOP;                                                   |   123 NOP;
   124 NOP;                                                   |   124 NOP;
   125 NOP;                                                   |   125 NOP;
   126 NOP;                                                   |   126 NOP;
   127 NOP;                                                   |   127 NOP;
   128 NOP;                                                   |   128 NOP;
   129 NOP;                                                   |
   130 NOP;                                                   |
   131 NOP;                                                   |
   132 NOP;                                                   |
   133 NOP;                                                   |
   134 NOP;                                                   |
   135 NOP;                                                   |
   136 NOP;                                                   |
tf_q35_head_norm sm_121 unified diff (main → head)
--- main
+++ head
@@ -1,10 +1,10 @@
 LDC R1, c[0x0][0x37c];
-LDC R5, c[0x0][0x398];
+LDC R7, c[0x0][0x398];
 LDCU.64 UR6, c[0x0][0x3a8];
 S2UR UR4, SR_CTAID.X;
 UISETP.NE.S64.AND UP0, UPT, UR6, URZ, UPT;
 LDCU.64 UR6, c[0x0][0x358];
-I2F.U32.RP R0, R5;
-ISETP.NE.U32.AND P2, PT, R5, RZ, PT;
+I2F.U32.RP R0, R7;
+ISETP.NE.U32.AND P2, PT, R7, RZ, PT;
 MUFU.RCP R0, R0;
 IADD3 R2, PT, PT, R0, 0xffffffe, RZ;
@@ -12,119 +12,111 @@
 HFMA2 R2, -RZ, RZ, 0, 0;
 IADD3 R4, PT, PT, RZ, -R3, RZ;
-IMAD R7, R4, R5, RZ;
-IMAD.HI.U32 R3, R3, R7, R2;
-IMAD.HI.U32 R4, R3, UR4, RZ;
-IADD3 R6, PT, PT, -R4, RZ, RZ;
-IMAD R0, R5, R6, UR4;
-ISETP.GE.U32.AND P0, PT, R0, R5, PT;
-@P0 IADD3 R0, PT, PT, R0, -R5, RZ;
-@P0 IADD3 R4, PT, PT, R4, 0x1, RZ;
-ISETP.GE.U32.AND P1, PT, R0, R5, PT;
-@P1 IADD3 R4, PT, PT, R4, 0x1, RZ;
-@!P2 LOP3.LUT R4, RZ, R5, RZ, 0x33, !PT;
-IADD3 R2, PT, PT, -R4, RZ, RZ;
-IMAD R2, R5, R2, UR4;
+IMAD R5, R4, R7, RZ;
+IMAD.HI.U32 R3, R3, R5, R2;
+IMAD.HI.U32 R6, R3, UR4, RZ;
+IADD3 R4, PT, PT, -R6, RZ, RZ;
+IMAD R0, R7, R4, UR4;
+ISETP.GE.U32.AND P0, PT, R0, R7, PT;
+@P0 IADD3 R0, PT, PT, R0, -R7, RZ;
+@P0 IADD3 R6, PT, PT, R6, 0x1, RZ;
+ISETP.GE.U32.AND P1, PT, R0, R7, PT;
+@P1 IADD3 R6, PT, PT, R6, 0x1, RZ;
+@!P2 LOP3.LUT R6, RZ, R7, RZ, 0x33, !PT;
+IADD3 R2, PT, PT, -R6, RZ, RZ;
+IMAD R2, R7, R2, UR4;
 BRA.U !UP0, 0x1f0;
-LDC.64 R6, c[0x0][0x3a8];
-LDG.E.CONSTANT R7, desc[UR6][R6.64+0x8];
-ISETP.GE.AND P0, PT, R4, R7, PT;
+LDC.64 R4, c[0x0][0x3a8];
+LDG.E.CONSTANT R5, desc[UR6][R4.64+0x8];
+ISETP.GE.AND P0, PT, R6, R5, PT;
 @P0 EXIT;
 LDCU UR4, c[0x0][0x3a0];
 S2R R3, SR_TID.X;
-MOV R9, RZ;
+MOV R5, RZ;
 LDCU UR5, c[0x0][0x39c];
 LDCU.64 UR8, c[0x0][0x380];
-IMAD R6, R2, UR4, RZ;
+IMAD R8, R2, UR4, RZ;
 USHF.R.S32.HI UR4, URZ, 0x1f, UR5;
-SHF.R.S32.HI R7, RZ, 0x1f, R6;
-IMAD.WIDE.U32 R6, R4, UR5, R6;
-IMAD R7, R4, UR4, R7;
+SHF.R.S32.HI R9, RZ, 0x1f, R8;
+IMAD.WIDE.U32 R8, R6, UR5, R8;
+IMAD R9, R6, UR4, R9;
 LDCU.64 UR4, c[0x0][0x388];
-IMAD.SHL.U32 R8, R3, 0x4, RZ;
-IADD.64 R6, R8, R6;
-LEA R14, P0, R6, UR8, 0x1;
-LEA.HI.X R15, R6, UR9, R7, 0x1, P0;
-LDG.E.U16.CONSTANT R0, desc[UR6][R14.64];
-LDG.E.U16.CONSTANT R12, desc[UR6][R14.64+0x2];
-LDG.E.U16.CONSTANT R13, desc[UR6][R14.64+0x4];
-LDG.E.U16.CONSTANT R19, desc[UR6][R14.64+0x6];
-IMAD.SHL.U32 R6, R8, 0x2, RZ;
-SHF.R.U32.HI R7, RZ, 0x1f, R8;
-IADD.64 R16, R6, UR4;
-LDG.E.U16.CONSTANT R8, desc[UR6][R16.64+0x2];
-LDG.E.U16.CONSTANT R10, desc[UR6][R16.64+0x4];
-LDG.E.U16.CONSTANT R11, desc[UR6][R16.64+0x6];
-LDG.E.U16.CONSTANT R9, desc[UR6][R16.64];
+IMAD.SHL.U32 R4, R3, 0x4, RZ;
+IADD.64 R8, R4, R8;
+LEA R12, P0, R8, UR8, 0x1;
+LEA.HI.X R13, R8, UR9, R9, 0x1, P0;
+LDG.E.U16.CONSTANT R0, desc[UR6][R12.64];
+LDG.E.U16.CONSTANT R11, desc[UR6][R12.64+0x2];
+LDG.E.U16.CONSTANT R17, desc[UR6][R12.64+0x4];
+LDG.E.U16.CONSTANT R18, desc[UR6][R12.64+0x6];
+LEA R14, P0, R4, UR4, 0x1;
+LEA.HI.X R15, R4, UR5, RZ, 0x1, P0;
+LDG.E.U16.CONSTANT R8, desc[UR6][R14.64+0x4];
+LDG.E.U16.CONSTANT R5, desc[UR6][R14.64+0x2];
+LDG.E.U16.CONSTANT R10, desc[UR6][R14.64+0x6];
+LDG.E.U16.CONSTANT R9, desc[UR6][R14.64];
 S2UR UR5, SR_CgaCtaId;
 LOP3.LUT P0, RZ, R3, 0x1f, RZ, 0xc0, !PT;
 UMOV UR4, 0x400;
 ULEA UR4, UR5, UR4, 0x18;
-@!P0 LEA.HI R3, R3, UR4, RZ, 0x1d;
-SHF.L.U32 R0, R0, 0x10, RZ;
-IMAD.U32 R12, R12, 0x10000, RZ;
-FFMA R15, R0, R0, RZ;
-SHF.L.U32 R13, R13, 0x10, RZ;
-FFMA R18, R12, R12, R15;
-IMAD.U32 R14, R19, 0x10000, RZ;
-FFMA R15, R13, R13, R18;
-FFMA R15, R14, R14, R15;
-SHFL.BFLY PT, R18, R15, 0x10, 0x1f;
+IMAD.U32 R0, R0, 0x10000, RZ;
+SHF.L.U32 R11, R11, 0x10, RZ;
+FFMA R16, R0, R0, RZ;
+IMAD.U32 R12, R17, 0x10000, RZ;
+FFMA R17, R11, R11, R16;
+SHF.L.U32 R13, R18, 0x10, RZ;
+FFMA R16, R12, R12, R17;
+FFMA R16, R13, R13, R16;
+SHFL.BFLY PT, R17, R16, 0x10, 0x1f;
+FADD R17, R16, R17;
+SHFL.BFLY PT, R14, R17, 0x8, 0x1f;
+FADD R14, R17, R14;
+SHFL.BFLY PT, R15, R14, 0x4, 0x1f;
+FADD R15, R14, R15;
+SHFL.BFLY PT, R18, R15, 0x2, 0x1f;
 FADD R18, R15, R18;
-LDC R15, c[0x0][0x3a4];
-SHFL.BFLY PT, R17, R18, 0x8, 0x1f;
-FADD R17, R18, R17;
-SHFL.BFLY PT, R16, R17, 0x4, 0x1f;
-FADD R16, R17, R16;
-SHFL.BFLY PT, R19, R16, 0x2, 0x1f;
-FADD R19, R16, R19;
-SHFL.BFLY PT, R20, R19, 0x1, 0x1f;
-FADD R20, R19, R20;
-@!P0 STS [R3], R20;
+SHFL.BFLY PT, R19, R18, 0x1, 0x1f;
+@!P0 LEA.HI R16, R3, UR4, RZ, 0x1d;
+LDC R3, c[0x0][0x3a4];
+FADD R19, R18, R19;
+@!P0 STS [R16], R19;
 BAR.SYNC.DEFER_BLOCKING 0x0;
-LDS.64 R16, [UR4];
-MOV R3, RZ;
+LDS.64 R14, [UR4];
 LDCU.64 UR4, c[0x0][0x390];
-FADD R16, R16, R17;
-FFMA R16, R16, 0.00390625, R15;
-FSETP.GEU.AND P0, PT, |R16|, 1.175494350822287508e-38, PT;
-@!P0 FMUL R16, R16, 16777216;
-MUFU.RSQ R15, R16;
-SHF.R.S32.HI R17, RZ, 0x1f, R5;
-IMAD.WIDE.U32 R2, R4, R5, R2;
-IMAD R5, R4, R17, R3;
-SHF.L.U32 R3, R2, 0x9, RZ;
-IMAD.U32 R8, R8, 0x10000, RZ;
-SHF.L.U64.HI R5, R2, 0x9, R5;
-LOP3.LUT R2, R3, R6, RZ, 0xfc, !PT;
-@!P0 FMUL R15, R15, 4096;
+FADD R14, R14, R15;
+FFMA R14, R14, 0.00390625, R3;
+FSETP.GEU.AND P0, PT, |R14|, 1.175494350822287508e-38, PT;
+@!P0 FMUL R14, R14, 16777216;
+MUFU.RSQ R15, R14;
+MOV R3, RZ;
+SHF.R.S32.HI R17, RZ, 0x1f, R7;
+IMAD.WIDE.U32 R2, R6, R7, R2;
+SHF.L.U32 R8, R8, 0x10, RZ;
 SHF.L.U32 R10, R10, 0x10, RZ;
+IMAD R17, R6, R17, R3;
+IMAD.U32 R5, R5, 0x10000, RZ;
+@!P0 FMUL R15, R15, 4096;
+LEA R7, P0, R2, R4, 0x8;
 IMAD.U32 R9, R9, 0x10000, RZ;
-SHF.L.U32 R11, R11, 0x10, RZ;
+FMUL R6, R11, R15.reuse;
 FMUL R3, R12, R15.reuse;
-FMUL R13, R13, R15.reuse;
 FMUL R0, R0, R15.reuse;
-FMUL R14, R14, R15;
-FMUL R8, R8, R3;
-LOP3.LUT R3, R5, R7, RZ, 0xfc, !PT;
-FMUL R10, R10, R13;
+FMUL R13, R13, R15;
+FMUL R5, R5, R6;
+FMUL R3, R8, R3;
+LEA.HI.X R6, R2, RZ, R17, 0x8, P0;
 FMUL R0, R9, R0;
-FMUL R11, R11, R14;
-F2FP.BF16.F32.PACK_AB R8, RZ, R8;
-IADD.64 R2, R2, UR4;
-F2FP.BF16.F32.PACK_AB R10, RZ, R10;
+FMUL R10, R10, R13;
+LEA R2, P0, R7, UR4, 0x1;
+F2FP.BF16.F32.PACK_AB R4, RZ, R3;
+F2FP.BF16.F32.PACK_AB R5, RZ, R5;
 F2FP.BF16.F32.PACK_AB R0, RZ, R0;
-F2FP.BF16.F32.PACK_AB R11, RZ, R11;
-STG.E.U16 desc[UR6][R2.64+0x2], R8;
-STG.E.U16 desc[UR6][R2.64+0x4], R10;
+F2FP.BF16.F32.PACK_AB R10, RZ, R10;
+LEA.HI.X R3, R7, UR5, R6, 0x1, P0;
+STG.E.U16 desc[UR6][R2.64+0x2], R5;
+STG.E.U16 desc[UR6][R2.64+0x4], R4;
 STG.E.U16 desc[UR6][R2.64], R0;
-STG.E.U16 desc[UR6][R2.64+0x6], R11;
+STG.E.U16 desc[UR6][R2.64+0x6], R10;
 EXIT;
-BRA 0x790;
-NOP;
-NOP;
-NOP;
-NOP;
-NOP;
-NOP;
+BRA 0x770;
 NOP;
 NOP;

Clef-Flash ships its Qwen3.5 backbone as the publisher's BF16 weights
with no quantization block at all, which the CUDA geometry refused. A
dense config with neither an MLX table nor a quantization_config now
parses as bf16, its kinds from cuda_modelopt.plain: every used module
and the untied head bf16 on the ModelOpt loader's HF names; tied, MoE
and pocket configs refuse. The decision-only refusals follow.
Clef-Flash's last shard holds its 0.85 GiB vision tower beside text
tensors, which a whole-file count charges to a text-only engine. The
CUDA preflight now asks an optional family hook, textWeightBytes,
before tensorWeightBytes or the file count; Qwen3.5 answers it for a
plain BF16 checkpoint with the stored bytes of its language model and
lm_head tensors, and null for every other format.
native/cuda.zig sat at the 600-line lean limit, and the decision-only
BF16 entry needs one more line in the capability list. The registry
and the families list move whole into cuda_families.zig with their
two tests; cuda.zig takes the registry from it and re-exports the
list, and drops the family imports only the registry used.
A plain BF16 Qwen3.5 checkpoint is a decision backbone, as on HIP: it
serves only with its joint schema head and none of the flags the head
is not qualified with, and the head needs the BF16 weights. The CUDA
open now checks that before any device work and words each refusal,
and refuses a headed checkpoint too until the head's CUDA operators
land. capabilities lists BF16 under decisions for qwen3_5.
A Clef readout reads every prompt row after the final norm, while a
CUDA prompt chunk runs only its last row past the last layer and then
the LM head. Engine.Keep gains rows, a prompt keep that runs every row
through the last layer and the final norm into x and stops before the
head, without a wait or a recurrent completion mark. tf-qwen35-cuda
writes such rows and checks them: on the GB10 the last row equals the
.last chunk's, and pieces of 16 to 512 rows give identical bytes.
The CUDA loader stored HF norm weights as bf16(1 + w), which drops w's
low bits in every norm; HIP and torch scale by 1 + w in FP32. A plain
BF16 checkpoint now keeps HF's raw w and runs tf_q35_norm_shift and
tf_q35_head_norm_shift, which add 1 in FP32; other formats keep their
kernels and bits. On the GB10 the final rows' mean error against FP32
drops from 2.84e-2 to 2.60e-2 (transformers BF16: 2.49e-2). Both
kernels carry contract gates, controls and nvcc 13.0 records.
Gate 1 compares the native final-norm rows of the 40 Clef records with
transformers' BF16 and FP32 rows. clef_backbone_rows.py native takes
--backend cuda: it runs tf-qwen35-cuda's rows mode per record and
saves the rows as the HIP runner's uint16 .npy, so compare is
unchanged. On the GB10 every bucket's mean error is within 0.4% of
transformers BF16's or nearer FP32, top-1 never differs, and pieces of
512, 1,024 and 4,096 rows give identical bytes.
The first step of ashhart#2324 lets the CUDA Qwen3.5 engine load Clef-Flash's
BF16 backbone for decisions only; the Unreleased notes say what it
loads, what it refuses before the weights load, and how capabilities
lists it.
The CUDA Qwen3.5 family listed bf16 under capabilities' decisions
while every BF16 open is still refused with QwenJointHeadNotServed,
so a client read a format it cannot use. Drop decision_formats and
its family wiring until the joint schema head serves in step 3.
The review asked the line to end with the PR number and the thanks,
and to say that a quantized checkpoint shipping the joint head config
is now refused as on HIP; the capabilities note leaves with the
listing, which moves to the head step.
@ashhart

ashhart commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Thanks @laudney. Main had moved under two lines, so I rebased the branch onto it (36618c7fa6). The two conflicts were mechanical:

  • registry.zig's landed_cuda line now also ends with main's glm_l2pf_pending.zig records, so it keeps both imports. The file stays at 599 lines.
  • The CHANGELOG line sits under Unreleased with the others.

Your commits are unchanged otherwise, and the landing gate's host checks pass on the rebased head. It's in our landing queue now.

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