@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 1a834df2d4
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 10, 20:15 UTC

[ROCm][Bugfix] Fix accuracy issue on fmoe when `VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS` enabled (#31523)

Signed-off-by: ganyi <ygan@amd.com>

Pleaplusone committed Dec 30, 2025 at 17:21 UTC 1a834df2d40d3279712e5c8d4b8c326d52b1f523
1 file changed +18
vllm/platforms/rocm.py
+18
@@ -407,8 +407,10 @@ class RocmPlatform(Platform):
407 compilation_config = vllm_config.compilation_config
408 parallel_config = vllm_config.parallel_config
409 is_eager_execution = compilation_config == CUDAGraphMode.NONE
410 + use_aiter_fused_moe = rocm_aiter_ops.is_fused_moe_enabled()
411 use_aiter_rms_norm = rocm_aiter_ops.is_rmsnorm_enabled()
412 use_aiter_fp8_linear = rocm_aiter_ops.is_linear_fp8_enabled()
413 + use_aiter_fused_se = rocm_aiter_ops.is_fusion_moe_shared_experts_enabled()
414
415 if compilation_config.cudagraph_mode.has_full_cudagraphs():
416 # decode context parallel does not support full cudagraphs
@@ -458,6 +460,22 @@ class RocmPlatform(Platform):
460 if use_aiter_fp8_linear and "-quant_fp8" not in compilation_config.custom_ops:
461 compilation_config.custom_ops.append("+quant_fp8")
462
463 + if use_aiter_fused_se and "-grouped_topk" in compilation_config.custom_ops:
464 + logger.warning_once(
465 + "VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS is enabled, which "
466 + "requires the 'grouped_topk' custom op. Overriding the "
467 + "user-provided '-grouped_topk'."
468 + )
469 + compilation_config.custom_ops.remove("-grouped_topk")
470 + # Ensure grouped_topk is always enabled when using AITER if
471 + # its not disabled by user
472 + if (
473 + use_aiter_fused_moe
474 + and "+grouped_topk" not in compilation_config.custom_ops
475 + and "-grouped_topk" not in compilation_config.custom_ops
476 + ):
477 + compilation_config.custom_ops.append("+grouped_topk")
478 +
479 @classmethod
480 def verify_model_arch(cls, model_arch: str) -> None:
481 if model_arch in _ROCM_UNSUPPORTED_MODELS: