Skip to content

qwen3_5: a modelopt checkpoint refuses below sm_90 in words, not missinglanepart - #1470

Merged
ashhart merged 2 commits into
ashhart:mainfrom
javierbits:nvfp4-refusal
Oct 29, 2026
Merged

ashhart merged 2 commits into
ashhart:mainfrom
javierbits:nvfp4-refusal

Conversation

@javierbits

@javierbits javierbits commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1452

What this changes

On sm_87 (Jetson AGX Orin) serve nvidia/Qwen3.8-27B-NVFP4 --backend cuda died deep in the engine with the native CUDA engine cannot load ... with its own glue kernels (MissingLanePart). The qwen3_5 CUDA lane now refuses a ModelOpt/NVFP4 checkpoint at the kernel load where the family learns the checkpoint is ModelOpt, naming the chip, its capability and the MLX 4-bit alternative, following the nemotron ModelOpt-floor precedent, instead of failing at the first split-K projection. A ModelOpt checkpoint is out-of-design for this family below sm_90, and capabilities --json already says so: it advertises qwen3_5: ["mlx-q4g64"] and never offered modelopt for it. The open path simply never checked.

Why sm_90 is the floor

  • cuda.qmmf.Lane.load has one reduction selector: clusters = capability_major >= 9 (zig/src/cuda/qmmf.zig). The device code agrees: qmmf.cu's CLUSTER path is guarded #if __CUDA_ARCH__ < 900 __trap().
  • qwen3_5's ModelOpt path reserves no partial buffer for the no-cluster case: modelopt.Kernels.reserveParts sizes lane.partBytes at Round.max_rows = 4096, where plan() is FUSED (no partials), so part stays null; and modelopt.project() refuses fused-row windows outright (the WindowTooWide guard, "the fused tile sums its slices in another order"). Below sm_90 the first split-K decode hits p.reduce and part == 0 and throws error.MissingLanePart at zig/src/cuda/qmmf.zig:192. That is the issue's failure. Above sm_90 the cluster path needs no part.
  • Nothing in the qwen3_5 modelopt load path asks for Blackwell: the FP4 lane is a software e2m1 to bf16 decode feeding bf16 fma.rn.bf16x2 + mma.sync (qmmf.cu fp4pair, prompt16.cu e2m1_pairs), which is why nemotron's identical lane load runs at modelopt_min = 80 on Ampere. The floor here is the cluster floor, sm_90. The block-scaled Blackwell math (ck_major = 12, ck_experts arch_specific) is the checkpoint-math path, not this one. The release fatbin list (release_sms = "80,86,120,121", zig/build/cuda.zig) is packaging, not a capability guard.
  • capabilities --json is unchanged and stays consistent: the family's only advertised CUDA format remains mlx-q4g64.

What the refusal prints

The open switch in zig/src/native/cuda.zig maps error.ModeloptNeedsClusters with the nemotron arm's voice ({s} is sm_{d}: {s} (the 4-bit checkpoints run on it)). On the reporter's card, with the driver's chip name first:

Orin is sm_87: the lane reduces a split-K projection's partials only in a cluster's shared memory: a ModelOpt checkpoint needs compute capability 9.0 or newer (the 4-bit checkpoints run on it)

The reason comes from the pure modeloptRefusal(capability) ?[]const u8 next to Kernels.load, mirroring nemotron.kernels.modeloptRefusal.

Receipt

  • Environment, commit 5bd41695 on nvfp4-refusal (base upstream/main b30d5b9d): Zig 0.17.0 (.zig-version), Linux aarch64 host, CPU-only CI-equivalent lane (no CUDA device, no nvcc needed for these steps).
  • Exactness: n/a. No arithmetic, kernel or reduction order changes; this is an admission refusal that returns earlier than the old MissingLanePart crash. The MLX 4-bit and EXL3 open paths are untouched (g.kinds.modelopt == false never reaches the new guard).
  • Decode speed before and after: n/a. The refused checkpoint never opened, so it decoded nothing; admitted cards (sm_90+) take one added pure comparison at load.
  • Prompt speed before and after: n/a, same reason.
  • Tests run:
    • zig build native: exit 0.
    • zig build test: exit 0, Build Summary: 407/407 steps succeeded; 926/935 tests passed (9 skipped), 0 failed. The new test ModelOpt's floor refuses every card below sm_90 and admits the cluster cards (refuses 70, 75, 80, 86, 87, 89; admits 90, 100, 120, 121; pins the exact reason string) is compiled into the unfiltered ModelOpt admission host binary (test-qwen35-modelopt-admission-host, under test-cuda-host) and the qwen35 CUDA module's test block; its step is in the green run.
    • zig build test test-kernel-contract test-golden test-server-security test-pull-security fuzz-cortheon: exit 0 (twice).
    • lean base-vs-head vs b30d5b9d (tools/zig/lean_check.py + lean_new.py): lean: 428 problems, 428 on the base, 0 new. All 428 are inherited, none from this change.
    • zig fmt --check build.zig zig: clean.
    • New tests fail before the change: modeloptRefusal and error.ModeloptNeedsClusters do not exist at b30d5b9d (compile fail); the matrix test passes after.
  • Not run, and why: Windows and macOS CI run the same host suite on their runners. GPU device gates (tf-cuda-test kernel-contract-limits, served receipts) need an authorized CUDA machine; this change registers no kernel and touches no kernel. Metal/HIP/XPU are untouched.

Checklist

  • 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. (Untouched: refusal precedes the lane.)
  • No precision traded for speed. No bits change.
  • A new or changed GPU kernel is registered with the kernel contract. N/a: no kernel added or changed.
  • Prompt processing is no slower than the last release.
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not. (CPU-only aarch64 host above; no CUDA device here.)
  • 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. No AI attribution lines.

Jetson AGX Orin confirmation should come from the reporter: the serve now prints the refusal line above instead of MissingLanePart, and --backend cuda on the mlx-q4g64 Qwen3.5 checkpoint keeps serving on the Orin as before.

@ashhart

ashhart commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Thanks for tracking this down (#1452). The diagnosis of where it fails is right, but I don't think sm_90 is a real floor:

  • reserveParts sizes the split-K partials at engine.max_rows (4,096 rows). Without clusters, qmmf.plan(4096, ...) plans a fused pass (fused = sk > 1 and m >= 256), so partBytes is 0, nothing is reserved, and the first split-K decode returns MissingLanePart. At 1, 16, 64 or 255 rows the same shapes do reduce through partials.
  • The lane can reduce partials without clusters (the plain tiles plus reduce_kernel). Nemotron serves ModelOpt checkpoints through the same cuda.qmmf.Lane from sm_80. It sizes its partials at fused_rows - 1 rows (nemotron/cuda_state.zig), and a host test checks they cover every dense partial up to the fuse boundary (nemotron/cuda_sm89_test.zig).

So the change I'd suggest: size qwen3_5's partials at @min(engine.max_rows, cuda.qmmf.fused_rows - 1) rows as Nemotron does (about 21 MB for the 27B's split-K shapes), drop the floor to sm_80 with Nemotron's reason, and add a host test like Nemotron's sm_89 one. On sm_90 and above nothing changes, since the cluster path reserves nothing. @valacroix's Orin could then confirm that nvidia/Qwen3.8-27B-NVFP4 serves with drafted == "draft": false, and we'll check that a GB10 is unchanged.

One more thing before it can land: the commit's author and committer email isn't a GitHub noreply address. Could you re-commit with your ID+login@users.noreply.github.com identity?

@ashhart

ashhart commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Thanks @javierbits. The push at 19:34 contains the same patch as before, only re-committed, so both points from our last comment are still open:

  1. The floor. Below sm_90 the lane can reduce split-K partials through reduce_kernel, and Nemotron serves ModelOpt checkpoints that way from sm_80. Qwen3.8-27B NVFP4 (ModelOpt) fails with MissingLanePart on Jetson AGX Orin (sm_87) #1452 fails because reserveParts sizes the partials at engine.max_rows (zig/src/families/qwen3_5/cuda_modelopt.zig:221). At that size qmmf.plan fuses, so nothing is reserved. Please size them at @min(engine.max_rows, cuda.qmmf.fused_rows - 1) rows, as nemotron/cuda_state.zig:96 does, and set modelopt_min (cuda_modelopt.zig:173) to 80 with Nemotron's reason. Please also add a host test like nemotron/cuda_sm89_test.zig:184 that the reserved bytes cover every split-K projection below the fuse boundary. That test fails on main and passes after.
  2. The commit identity. The commit's author and committer email is still not a GitHub noreply address. Please re-commit with your ID+login@users.noreply.github.com identity.

Merged onto current main, the host steps pass as before. Once the floor moves, @valacroix's Orin could confirm that nvidia/Qwen3.8-27B-NVFP4 serves with drafted == "draft": false, and we'll check that a GB10 is unchanged.

@ashhart

ashhart commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Thanks @javierbits. To save you a round trip, we've made the change from our last two comments ourselves, with you and @valacroix as co-authors on the commit:

  • qwen3_5 now reserves its ModelOpt split-K partials below the fuse boundary, as Nemotron does, so the lane reduces without clusters from sm_80 up.
  • A card below sm_80 gets a refusal in words instead of MissingLanePart, as your patch intended.
  • A host test checks that the reserved bytes cover every 27B projection below that boundary, with clusters on and off.

There's no need to re-commit with your noreply address.

Next we'll check that nvidia/Qwen3.8-27B-NVFP4 serves on a GB10 as it does on main. @valacroix, once it lands, a run on your Orin with drafted == "draft": false would confirm the fix for #1452. We'll post here when it does.

@javierbits

Copy link
Copy Markdown
Contributor Author

Thanks @javierbits. To save you a round trip, we've made the change from our last two comments ourselves, with you and @valacroix as co-authors on the commit:

  • qwen3_5 now reserves its ModelOpt split-K partials below the fuse boundary, as Nemotron does, so the lane reduces without clusters from sm_80 up.
  • A card below sm_80 gets a refusal in words instead of MissingLanePart, as your patch intended.
  • A host test checks that the reserved bytes cover every 27B projection below that boundary, with clusters on and off.

There's no need to re-commit with your noreply address.

Next we'll check that nvidia/Qwen3.8-27B-NVFP4 serves on a GB10 as it does on main. @valacroix, once it lands, a run on your Orin with drafted == "draft": false would confirm the fix for #1452. We'll post here when it does.

Cool ✌️

ashhart and others added 2 commits October 29, 2026 23:41
Carry ashhart#1470 by @javierbits, with @valacroix. Keep the non-cluster lane
available from sm_80 and reserve partial rows below the fused window
so decode can reduce without clusters.

Exercise the real reservation across the 27B projection shapes and
stored formats, including the split-K decode and clustered controls.

Co-authored-by: javierbits <177527508+javierbits@users.noreply.github.com>
Co-authored-by: valacroix <256988299+valacroix@users.noreply.github.com>
@ashhart
ashhart merged commit 1c5f109 into ashhart:main Oct 29, 2026
9 checks passed
ashhart added a commit that referenced this pull request Oct 29, 2026
Carry #1470 by @javierbits, with @valacroix. Keep the non-cluster lane
available from sm_80 and reserve partial rows below the fused window
so decode can reduce without clusters.

Exercise the real reservation across the 27B projection shapes and
stored formats, including the split-K decode and clustered controls.

Co-authored-by: javierbits <177527508+javierbits@users.noreply.github.com>
Co-authored-by: valacroix <256988299+valacroix@users.noreply.github.com>
@javierbits
javierbits deleted the nvfp4-refusal branch October 30, 2026 12:35
@ashhart

ashhart commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Thank you @javierbits. This is in TensorFold 1.2.0, released today: https://github.com/ashhart/TensorFold/releases/tag/v1.2.0

It landed with your commits under your own name, so you're listed as a TensorFold contributor, and it's credited to you in the release notes and the changelog.

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.

Qwen3.8-27B NVFP4 (ModelOpt) fails with MissingLanePart on Jetson AGX Orin (sm_87)

2 participants