Skip to content

[MiniMax-M3.1] DSpark draft follows --online_quant_config - #2743

Closed
zhuyuhua-v wants to merge 1 commit into
mainfrom
yuhzhu/m31-dspark-draft-ptpc
Closed

zhuyuhua-v wants to merge 1 commit into
mainfrom
yuhzhu/m31-dspark-draft-ptpc

Conversation

@zhuyuhua-v

@zhuyuhua-v zhuyuhua-v commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

The MiniMax-M3.1 DSpark draft builds its quantization from its own checkpoint block only (_draft_quant_config, MXFP8 [1, 32]), never from --online_quant_config. So with --online_quant_config '{"global_quant_config": "ptpc_fp8", ...}':

  • the target is re-quantized to per-token FP8;
  • the draft linears stay MXFP8, which is a triton block-scale GEMM (_gemm_afp8wfp8) plus a separate quantize_fp8 per linear.

Decode trace of MiniMax-M3.1-Flash TP4 on MI355X, per propose_dspark span, averaged over 400 spans:

draft linears GEMMs per span GEMM time per span
MXFP8 (draft ignores the flag), c16 trace 20 x _gemm_afp8wfp8 510.8 us (+ 90.3 us quantize_fp8)
per-token FP8 (draft re-quantized), c32 trace 20 x kernel_gemm_0 216.3 us (+ 85.9 us per-token quant)

The c32 trace runs larger draft batches than the c16 one, so the saving is, if anything, understated.

Change

_draft_quant_config(config, online_quant_config) now gets the server's --online_quant_config. The draft is re-quantized at load the same way the target is.

  • No new flag: without --online_quant_config nothing changes.
  • The draft's checkpoint validation is unchanged: MXFP8 [1, 32] or BF16.
  • Test: tests/test_dspark.py::test_minimax_m31_draft_follows_online_quant_config covers both cases (with ptpc_fp8 the draft is re-quantized per token; without it, it stays MXFP8).

Validation

MiniMax-M3.1-Flash-Quark-MXFP4, TP4, MI355X, fp8 KV/index, --online_quant_config ptpc_fp8, gpu-memory-utilization 0.9, image rocm/atom-dev:nightly_202610261558. Mono is off on main with DSpark.

A/B on this branch's code: main 035a78a with and without this change, same launch, c1, 1200 s per arm, synthetic AL 4.04.

draft output tok/s/GPU p90 ITL P90 interactivity TTFT p50
MXFP8 (main) 41.5 2.60 ms 384.9 303 ms
per-token FP8 (this PR) 42.6 (+2.7%) 2.45 ms (-5.8%) 408.4 (+6.1%) 310 ms

Earlier A/B with the same re-quantization, behind an environment flag in the first revision of this PR. Main 481c2bf, c1, 1200 s per arm:

draft output tok/s/GPU p50 ITL p90 ITL P90 interactivity
MXFP8 41.0 2.31 ms 2.61 ms 383.5
per-token FP8 42.3 (+3.2%) 2.18 ms (-5.6%) 2.45 ms (-6.1%) 407.7 (+6.3%)

Accuracy. lm-eval gsm8k as InferenceX CI runs it: 5-shot, chat template, temperature 0, all 1319 samples, real acceptance, draft re-quantized.

  • First revision: strict-match 0.9598 +- 0.0054 on main.
  • This revision: strict-match 0.9636 +- 0.0052.
  • SGLang CI on MI355X: 0.9598 +- 0.0054.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every eligible PR before approval:

  • ✅ Pre Checkin: Black, Ruff, catalog schema validation, non-GPU unit tests

Heavy model tests:

  • ✅ Run after the PR is approved and Pre Checkin passes
  • ✅ Run immediately when an approval review is submitted
  • ✅ Can be requested before approval with labels
Label Tests
ci:full Run all heavy PR model tests: native ATOM, vLLM, and SGLang
ci:atom Run native ATOM model accuracy tests
ci:vllm Run ATOM vLLM OOT model accuracy tests
ci:sglang Run ATOM SGLang model accuracy tests

Heavy jobs are skipped when the PR is not approved and no matching ci:* label is present.
Add labels via the sidebar or gh pr edit 2743 --add-label <label>

The MiniMax-M3.1 DSpark draft built its QuantizationConfig from its own
MXFP8 checkpoint block only, so --online_quant_config re-quantized the
target and never the draft: under ptpc_fp8 the draft linears still ran
MXFP8's triton block-scale GEMM plus a separate activation quant per
linear.

Pass the server's online quant config to _draft_quant_config, so the
draft is re-quantized at load the way the target is. Without
--online_quant_config nothing changes.
@zhuyuhua-v
zhuyuhua-v force-pushed the yuhzhu/m31-dspark-draft-ptpc branch from 9a928df to 4e2394c Compare October 28, 2026 07:12
@zhuyuhua-v zhuyuhua-v changed the title [MiniMax-M3.1] DSpark draft: optional per-channel FP8 requant of the draft linears [MiniMax-M3.1] DSpark draft follows --online_quant_config Oct 28, 2026
@zhuyuhua-v
zhuyuhua-v marked this pull request as ready for review October 28, 2026 07:13
Copilot AI balanced review requested due to automatic review settings October 28, 2026 07:13

Copilot AI 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.

🔵 Needs a closer look

The inference-numerics and GPU GEMM dispatch changes require validation beyond source-only review, with current-revision GSM8K accuracy and GPU A/B results still pending.

No open issues 🎉

What changed in this PR

This PR makes MiniMax-M3.1’s DSpark draft honor ATOM’s existing --online_quant_config, aligning its load-time re-quantization with the target model.

Changes:

  • Pass the server’s online quantization configuration into draft quantization setup.
  • Preserve checkpoint validation and existing behavior when the option is absent.
  • Add a parameterized regression test covering default MXFP8 and ptpc_fp8 configurations.
File Description
tests/​test_dspark.py Tests draft quantization with and without the online override.
atom/​models/​minimax_m3/​dspark.py Forwards online quantization settings to the draft’s quantization configuration.

Review effort: Balanced

@zhuyuhua-v

Copy link
Copy Markdown
Collaborator Author

drop this pr since SA won't allow re-quant in draft models.

@zhuyuhua-v zhuyuhua-v closed this Oct 28, 2026
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