[ROCm][Bugfix] Keep zero MiniMax MXFP8 activation blocks finite by AndreasKaratzas · Pull Request #58089 · vllm-project/vllm · GitHub
Skip to content

[ROCm][Bugfix] Keep zero MiniMax MXFP8 activation blocks finite - #58089

Merged
shen-shanshan merged 2 commits into
vllm-project:mainfrom
ROCm:akaratza_minimax_mxfp8_zero
Sep 23, 2026
Merged

shen-shanshan merged 2 commits into
vllm-project:mainfrom
ROCm:akaratza_minimax_mxfp8_zero

Conversation

@AndreasKaratzas

@AndreasKaratzas AndreasKaratzas commented Sep 22, 2026 •

Copy link
Copy Markdown
Member
  • Compute the finite reciprocal block scale in the fused MiniMax-M3 SwiGLU/MXFP8 kernel.
  • Multiply by that reciprocal to avoid 0/0 when the byte-zero E8M0 divisor flushes to zero on CDNA, while preserving the encoded scale bytes.
  • Reuse the existing mixed-magnitude/zero-block regression and the full AMD MiniMax kernel suite.

The MI355 parity run exposed NaNs in an all-zero activation block. Merged #53674 corrected the fused kernel’s scale formula but retained division by the decoded scale. The generic quantizer already uses reciprocal multiplication from merged #53110, and this change applies the same arithmetic to the fused path. Fresh searches and the related PR review found no open change covering this remaining fused-kernel defect.

AI assistance: OpenAI Codex assisted with diagnosis, implementation and validation.

Use finite reciprocal scaling to prevent all-zero MXFP8 activation blocks
from generating NaNs on CDNA. The existing regression fails without the
fix; all 68 AMD MiniMax kernel tests pass with it.

Co-authored-by: OpenAI Codex
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@mergify mergify Bot added minimax rocm Related to AMD ROCm bug Something isn't working labels Sep 22, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Sep 22, 2026
@AndreasKaratzas
AndreasKaratzas marked this pull request as ready for review September 22, 2026 17:34

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@AndreasKaratzas

Copy link
Copy Markdown
Member Author

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #90463 for commit a10595a42979.

@Fangzhou-Ai

Copy link
Copy Markdown
Collaborator

LGTM!

Comment on lines +118 to +119
rescale = tl.exp2(127.0 - sb)
aq = (act * rescale[:, None]).to(aq_ptr.dtype.element_ty)

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.

If this doesn't influence the model accuracy, then LGTM.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

mm .. let me then do a quick lm eval

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Run Source commit Correct Accuracy
base 74370a0e3044 1256/1319 95.2237%
pr a10595a42979 1252/1319 94.9204%
base-repeat 74370a0e3044 1256/1319 95.2237%
pr-repeat a10595a42979 1252/1319 94.9204%

How does this look?

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.

Run Source commit Correct Accuracy
base 74370a0e3044 1256/1319 95.2237%
pr a10595a42979 1252/1319 94.9204%
base-repeat 74370a0e3044 1256/1319 95.2237%
pr-repeat a10595a42979 1252/1319 94.9204%
How does this look?

LGTM.

@shen-shanshan
shen-shanshan merged commit 56b3acb into vllm-project:main Sep 23, 2026
88 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD Sep 23, 2026
@AndreasKaratzas
AndreasKaratzas deleted the akaratza_minimax_mxfp8_zero branch September 23, 2026 08:47
michael-gpu pushed a commit to practical-inference/vllm-ampere-extended that referenced this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working minimax rocm Related to AMD ROCm

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants