Skip to content

[ROCm] Promote tuned Kimi-K2.5 MXFP4 MoE env vars into extra_env - #703

Merged
dllehr-amd merged 2 commits into
vllm-project:mainfrom
Fangzhou-Ai:rocm-kimi-k25-extra-env-tuned-moe
Jul 30, 2026
Merged

[ROCm] Promote tuned Kimi-K2.5 MXFP4 MoE env vars into extra_env#703
dllehr-amd merged 2 commits into
vllm-project:mainfrom
Fangzhou-Ai:rocm-kimi-k25-extra-env-tuned-moe

Conversation

@Fangzhou-Ai

Copy link
Copy Markdown
Contributor

Summary

The tuned AITER MXFP4 MoE configuration for amd/Kimi-K2.5-MXFP4 on MI355X was documented as prose in the guide block by #661, but the machine-readable extra_env for the mxfp4 variant only carries the two vars added by #680 (VLLM_ROCM_USE_AITER_MOE, VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS).

The two behavior-changing kernel-selection vars from that guide were never promoted into the structured extra_env, so anything consuming the structured recipe (rather than reading the guide by hand) silently gets a different, slower MoE kernel than the validated configuration:

  • AITER_MXFP4_INTERMEDIATE=1 — selects the RadeonFlow MXFP4 intermediate GEMM path. Default is "0"; without it (with VLLM_ROCM_USE_AITER=1) the MoE oracle falls back to a different kernel. This is the var the guide itself calls out as the one that selects the path.
  • VLLM_ROCM_USE_SKINNY_GEMM=0 — disables skinny GEMM. Default is True.

This PR adds those two to the mxfp4 extra_env so the applied config matches the documented tuned path.

Intentionally not added, because their guide values already equal the upstream defaults (so they'd be no-ops):

  • AITER_BYPASS_TUNE_CONFIG — aiter default is 0.
  • AITER_MOE_SORT_BACKEND — aiter default is auto.

VLLM_ROCM_USE_AITER_RMSNORM=0 is guide-documented as TP<8-only; the mxfp4 variant runs tp: 8 (RMSNorm left at its default on), so it is not added as a static env. OMP_NUM_THREADS=1 is a host/CPU-threading knob rather than a model kernel-selection var and is left to the guide.

Test plan

  • models/moonshotai/Kimi-K2.5.yaml parses as YAML.
  • git diff --check clean (no whitespace errors).
  • Env values cross-checked against vLLM envs.py defaults (VLLM_ROCM_USE_SKINNY_GEMM default True) and aiter fused_moe.py defaults (AITER_MXFP4_INTERMEDIATE default "0").

Made with Cursor

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vllm-recipes Ready Ready Preview Jul 30, 2026 4:05pm

Request Review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the configuration for the Kimi-K2.5 model in models/moonshotai/Kimi-K2.5.yaml by adding two environment variables, VLLM_ROCM_USE_SKINNY_GEMM: "0" and AITER_MXFP4_INTERMEDIATE: "1", to the extra_env section. These variables configure kernel selection for the tuned AITER MXFP4 MoE path to ensure the faster RadeonFlow MXFP4 intermediate GEMM path is selected. I have no feedback to provide.

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

Thanks for snagging these @Fangzhou-Ai !

Fangzhou-Ai and others added 2 commits July 30, 2026 16:03
The tuned AITER MXFP4 MoE kernel-selection env vars were documented in the
guide prose (vllm-project#661) but only two of them (VLLM_ROCM_USE_AITER_MOE,
VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS) were promoted into the structured
mxfp4 extra_env (vllm-project#680). The two behavior-changing vars that flip the kernel
away from vLLM defaults were missing from the applied config:

- AITER_MXFP4_INTERMEDIATE=1 selects the RadeonFlow MXFP4 intermediate GEMM
  path; default is "0", so without it the MoE oracle falls back to a slower
  kernel.
- VLLM_ROCM_USE_SKINNY_GEMM=0 disables skinny GEMM; default is on.

AITER_BYPASS_TUNE_CONFIG and AITER_MOE_SORT_BACKEND are left out because the
values used in the guide (0 / auto) already match the AITER defaults.

Signed-off-by: Fangzhou-Ai <Fangzhou-Ai@users.noreply.github.com>
Signed-off-by: Fangzhou Ai <31551580+Fangzhou-Ai@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.

2 participants