From 81bcced48273cce230dcd5a4cee0cfe0ad6dbd26 Mon Sep 17 00:00:00 2001 From: Uros Markovic Date: Tue, 30 Jun 2026 08:47:57 +0200 Subject: [PATCH] [Bugfix][ROCm] Preserve MoE weight padding for unquantized Triton path (#46381) Signed-off-by: Uros Markovic --- vllm/model_executor/layers/fused_moe/oracle/unquantized.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vllm/model_executor/layers/fused_moe/oracle/unquantized.py b/vllm/model_executor/layers/fused_moe/oracle/unquantized.py index 6a0dfdb0d6..cda0eaf730 100644 --- a/vllm/model_executor/layers/fused_moe/oracle/unquantized.py +++ b/vllm/model_executor/layers/fused_moe/oracle/unquantized.py @@ -301,6 +301,13 @@ def convert_to_unquantized_kernel_format( is_gated_act_gemm=is_act_and_mul, ) + if ( + unquantized_backend == UnquantizedMoeBackend.TRITON + and current_platform.is_rocm() + and envs.VLLM_ROCM_MOE_PADDING + ): + # Skip .contiguous(): it would undo the ROCm MoE weight padding. + return w13_weight, w2_weight return w13_weight.contiguous(), w2_weight.contiguous()