Skip to content

[Bugfix][SM70] Isolate MXFP4 direct-order offsets - #326

Merged
yangzhuxinyzx merged 1 commit into
mainfrom
agent/v100-mxfp4-direct-order-offset-fix-20260826-060007
Aug 26, 2026
Merged

yangzhuxinyzx merged 1 commit into
mainfrom
agent/v100-mxfp4-direct-order-offset-fix-20260826-060007

Conversation

@yangzhuxinyzx

Copy link
Copy Markdown
Contributor

Purpose

Repair the new quality bug reported on #308 without replaying its stale optimization stack. Current main already contains the accepted direct-order optimization from #314, but B1 graph capture can observe offsets overwritten by M2--M8 warmup or verifier compaction.

Source contract

  • Base: 9bbc554e1d9f63a628d1bc66ecb45ee4632267a2
  • Head: f096a85bf43f3d00df3b25a34299c748ad747b2a
  • Original report/fix commit: 052312c66f89bb144cf68f5776d83552c7b9e3d1

Fix

  • B1 direct-order decode now uses the immutable slot_expert_offsets buffer ([0, 1, ..., 6]).
  • It no longer reuses compact_expert_offsets, which M2--M8 compaction mutates before a B1 graph may be captured.
  • CUDA kernels, route IDs/order, FP32 weighted-reduction order, environment defaults, and rollback switches are unchanged.
  • A CPU regression poisons the compact workspace with representative M8 offsets and proves direct-order still selects the immutable one-row slots.

The first pre-fix matched endpoint reached 69.949 token/s but produced incoherent output. It is recorded as rejected quality evidence, not a speed baseline. This repair preserves the already measured optimization while removing the identified cross-shape state leak.

Test result

  • pytest -q tests/quantization/test_sm70_mxfp4_moe.py with CUDA hidden: 25 passed, 4 skipped.
  • pre-commit run --from-ref onecat/main --to-ref HEAD: passed, including Ruff, Markdown, mypy, SPDX, configuration, and forbidden-API checks.
  • No GPU or end-to-end rerun: this change only selects an existing immutable buffer before the unchanged CUDA calls, and all V100s remain owned by the active service.

Supersedes the post-#314 bugfix portion of #308 after merge.

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx
yangzhuxinyzx marked this pull request as ready for review August 26, 2026 06:07
@yangzhuxinyzx
yangzhuxinyzx merged commit b06f54c into main Aug 26, 2026
4 checks passed
@yangzhuxinyzx
yangzhuxinyzx deleted the agent/v100-mxfp4-direct-order-offset-fix-20260826-060007 branch August 26, 2026 07:55
yangzhuxinyzx added a commit that referenced this pull request Aug 27, 2026
#314/#326 已包含其安全、默认开启的后续实现;排除旧堆叠实验。

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
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.

1 participant