Skip to content

[ROCm][Bugfix][MLA] Fix mla_reduce_v1 num_kv_splits arg for FP8 MLA prefill - #46810

Closed
xaguilar-amd wants to merge 1 commit into
vllm-project:mainfrom
xaguilar-amd:fix/aiter-mla-reduce-v1-num-kv-splits
Closed

xaguilar-amd wants to merge 1 commit into
vllm-project:mainfrom
xaguilar-amd:fix/aiter-mla-reduce-v1-num-kv-splits

Conversation

@xaguilar-amd

@xaguilar-amd xaguilar-amd commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

AITER PR #3391 (released in v0.1.16) added a required positional num_kv_splits: int to mla_reduce_v1, inserted between max_seqlen_q and final_output. The AITER MLA backend's FP8 prefill call site still used the old signature, so the output tensor landed in the num_kv_splits slot and FP8 MLA prefill crashed on gfx950 with:
Expected a value of type 'int' for argument 'num_kv_splits' but instead found type 'Tensor'

This updates the call site to match the new signature. Validated on amd/Kimi-K2.5-MXFP4-AttnFP8 (gfx950).

Changes

  • Pass num_kv_splits to mla_reduce_v1 for the FP8 MLA prefill path in rocm_aiter_mla.py.
  • Use the compute-unit count (get_cu_num()) as the split count — the tight per-reduce-tile upper bound for the persistent-scheduling prefill kernel, equal to the kernel's own internal max_splits floor (not a placeholder).
  • Gate the new arg on a capability probe (inspect.signature → torch op schema fallback, matching the pattern in vllm/_aiter_ops.py), so builds on the older signature keep working.

Test plan

  • [ X] gfx950 + AITER >= 0.1.16: FP8 MLA prefill runs (e.g. amd/Kimi-K2.5-MXFP4-AttnFP8).
  • [ X] gfx950 + AITER < 0.1.16: legacy signature path still works (no num_kv_splits passed).

…s arg to

mla_reduce_v1; pass it (the compute-unit count) when the installed AITER
expects it, detected via capability probe. Fixes FP8 MLA prefill crashing
on gfx950 with "Expected int for num_kv_splits but found Tensor".

Signed-off-by: Xavier Aguilar <xavier.aguilarfruto@amd.com>
@mergify mergify Bot added rocm Related to AMD ROCm v1 bug Something isn't working labels Jun 26, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Jun 26, 2026
@xaguilar-amd
xaguilar-amd marked this pull request as ready for review June 26, 2026 09:26

@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.

@xaguilar-amd

Copy link
Copy Markdown
Contributor Author

cc: @ChuanLi1101

@xaguilar-amd

Copy link
Copy Markdown
Contributor Author

Bug fixed as well with #46760

@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD Jun 26, 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 rocm Related to AMD ROCm v1

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant