Skip to content

Commit 2ab7387

Browse files
committed
fix
1 parent 12cc6dd commit 2ab7387

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

  • vllm/model_executor/layers/quantization

vllm/model_executor/layers/quantization/mxfp4.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@
3333
from flashinfer import (mxfp8_quantize, shuffle_matrix_a,
3434
shuffle_matrix_sf_a, trtllm_fp4_block_scale_moe)
3535

36-
if current_platform.is_rocm() and envs.VLLM_ROCM_USE_AITER_FUSED_MOE_A16W4:
36+
if current_platform.is_rocm() and envs.VLLM_ROCM_USE_AITER and envs.VLLM_ROCM_USE_AITER_FUSED_MOE_A16W4:
3737
import aiter
3838
from aiter.fused_moe import fused_topk, moe_sorting
3939
from aiter.ops.shuffle import shuffle_mxfp4_weight, shuffle_mxfp4_scale
4040

41-
aiter_quant = aiter.get_torch_quant(aiter.QuantType.per_1x32)
42-
4341
class Mxfp4Config(QuantizationConfig):
4442

4543
def __init__(self, ignored_layers: Optional[list[str]] = None):
@@ -360,7 +358,6 @@ def swap_every_two_rows(x, axis=-1):
360358
requires_grad=False)
361359
else:
362360
from triton_kernels.matmul_ogs import FlexCtx, PrecisionConfig
363-
364361
w13_bias = layer.w13_bias.to(torch.float32)
365362
w2_bias = layer.w2_bias.to(torch.float32)
366363

@@ -542,7 +539,7 @@ def apply(
542539
)[0]
543540
return trtllm_gen_output
544541
else:
545-
if current_platform.is_rocm() and envs.VLLM_ROCM_USE_AITER_FUSED_MOE_A16W4:
542+
if current_platform.is_rocm() and envs.VLLM_ROCM_USE_AITER and envs.VLLM_ROCM_USE_AITER_FUSED_MOE_A16W4:
546543
token_num = x.shape[0]
547544
BLOCKM = 16 if token_num < 2048 else 32
548545
topk_weights, topk_ids = fused_topk(x, router_logits, top_k, True)

0 commit comments

Comments
 (0)