Skip to content

gpu-gates: pin the MXFP8 select refusal by kind and tensor - #728

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-mxfp8-gate-refusal-text
Oct 23, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-mxfp8-gate-refusal-text

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

MXFP8 expert-select 거부 검사가 지원 형식 목록의 문장 대신 오류 종류, 발생 함수, 텐서 이름을 확인하도록 고쳤습니다.

Fixes #712. Part of #565. Tracked in #699.

What and why

On main, the sel.refusal clause of gate_mxfp8 reports a failure, although the refusal it checks is correct. The clause compared the refusal's text with a q8_0 or fp8_b128 stack. Commit 5b302b32a (#682) added NVFP4 to site::resident_sel_f32, so the diagnostic in GpuError::Tensor.need now reads a q8_0, fp8_b128 or nvfp4 stack. The gate kept the old list, and just gate-gpu-mxfp8 reports that one clause as a failure on every run. The refusal branch in crates/gpu/src/site.rs did not change.

The clause now keeps the real Result and requires Err(GpuError::Tensor { what: "site::resident_sel_f32", name, .. }) with the name of the MXFP8 tensor under test. A launch that succeeds, a different error kind, or an error from another function or tensor no longer satisfies it. The supported-format list in need is no longer compared, so the next format added to the select path cannot break the clause again.

Tensor also covers a missing tensor, so the clause first calls the existing site::site to confirm the tensor is there with the expected size and MXFP8 resident format. A missing or wrongly loaded tensor stops there and is not mistaken for the format refusal. The text comparison is replaced under a dated PIN, with its reason beside it.

Closes #712

Release notes: Under the hood: the MXFP8 gate checks the expert-select refusal by error kind and tensor name, so it no longer breaks when the supported-format list changes.

Code shape

  • No second copy. The clause reuses site::site for its precondition and the existing GpuError type. It adds no helper. I searched crates/ and tools/ for the old and new wording; the old text was expected only here. The same phrase in crates/gguf/src/card.rs is documentation of how the two formats load, not a check.
  • Model code holds only architecture facts. No model code changes.
  • Dead code is gone. The error-to-string conversion the clause used is removed.
  • No silent failure. The Result is matched, not turned into a string, and a wrong kind, function or tensor name does not satisfy the clause.
  • Comments state what is true now. The one new comment is the dated PIN for the replaced comparison.
  • No relaxed gate. The clause got stricter: it pins the error kind, the function and the tensor name. It no longer compares the format list. The PIN(2026-10-23): line gives the reason.
  • cargo fmt is clean on what I touched. I did not run cargo clippy on this head.

Duplication found or removed (path:line): none.

What I ran

The commit is 555c968f on upstream main 648dd751. It changes crates/gpu-gates/src/bin/gate_mxfp8.rs only (9 insertions, 8 deletions).

cargo fmt --all -- --check and git diff --check are clean on this commit.

FAIL-first and the fixed run, on a DGX Spark (hardware below). The same command ran on main and on this commit, base first:

BLOOMERY_BOX_LOCAL=1 BLOOMERY_ARCH=sm_121 just gate-gpu-mxfp8
--- main 648dd751, rc 1
mxfp8 clause=sel.refusal got="site::resident_sel_f32: blk.4.ssm_f_b.mxfp8.weight is not a q8_0, fp8_b128 or nvfp4 stack" FAIL
gate_mxfp8: FAILED: one or more checks above did not pass
--- this commit 555c968f, rc 0
mxfp8 clause=sel.refusal got=Err(Tensor { what: "site::resident_sel_f32", name: "blk.4.ssm_f_b.mxfp8.weight", need: "a q8_0, fp8_b128 or nvfp4 stack" }) PASS
gpu-gate.sh: gate_mxfp8 ran 16 s (exit 0)

On main the refusal is the right one: the right function names the right tensor, and only the old format list differed. On this commit the gate completes.

I did not run cargo clippy, just mac-static or just affected on this head. The diff touches only the gate's refusal check, and no production code, kernel or public signature changes.

What I ran into

This does not block the PR. I ran the gate on one GB10 card only; it has not run on an RTX 5090 machine. The changed clause checks an error value on the host side of site::resident_sel_f32, which does not depend on the card architecture, so I expect the same result there.

Hardware (if the change is for a machine)

DGX Spark, nvidia-smi lines from the run above:

| NVIDIA-SMI 595.84                 Driver Version: 595.84         CUDA Version: 13.3     |
|   0  NVIDIA GB10                    On  |   0000000F:01:00.0 Off |                  N/A |

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card labels Oct 23, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: The gate checks the intended MXFP8 refusal without depending on the supported-format list.

Checked

  • Duplicates: 0 new functions, types or constants. Grep found no second refusal clause. No dryer pairs were available.
  • Complexity: crapper flagged no functions. The changed clause adds a typed match.
  • Silent failure: 2 result paths followed. Missing or wrongly loaded tensors abort; successful launches and unrelated errors fail the clause.
  • Tests: static mutation check: replacing the refusal at crates/gpu/src/site.rs:356 with Ok(()) makes the match at crates/gpu-gates/src/bin/gate_mxfp8.rs:560 false and produces a nonzero gate exit. Missing tensors and wrong resident formats fail the precondition.
  • Gates: the replaced comparison has a dated PIN and reason. The PR includes the failing base run and passing GB10 run.
  • Escape catalog: no C1–C4 patterns match.
  • Performance: only gate code changes; no inference hot path changes.

Notes

dryer did not run. The GPU gate was not rerun during this review.

Card check: gpu-evidence. This pull request changes crates/gpu-gates/src/bin/gate_mxfp8.rs and carries a gate run on the author's card, which counts as verified.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@github-actions github-actions Bot added gpu-evidence Verified on the author's card: the pull request carries the gate run and its output and removed needs-gpu Changes code a card must check, and carries no gate run on a card labels Oct 23, 2026
@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit 97c8861 into midagedev:main Oct 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app gpu-evidence Verified on the author's card: the pull request carries the gate run and its output

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gate_mxfp8: selector refusal assertion rejects the current error message

1 participant