[AMD][OCP MX][CI] Fix tests to not dispatch on UNFUSED_TRITON backend on MI300, improve w_mxfp4_a_fp8 emulation support (#46142)
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
This commit is contained in:
@@ -26,6 +26,7 @@ from vllm.model_executor.layers.quantization.utils.mxfp6_utils import dequant_mx
|
||||
from vllm.model_executor.layers.quantization.utils.ocp_mx_utils import (
|
||||
OCP_MX_Scheme,
|
||||
)
|
||||
from vllm.platforms import current_platform
|
||||
|
||||
logger = init_logger(__name__)
|
||||
|
||||
@@ -83,8 +84,7 @@ class OCP_MXQuantizationEmulationTritonExperts(TritonExperts):
|
||||
OCP_MX_Scheme.w_mxfp4_a_fp8,
|
||||
OCP_MX_Scheme.w_mxfp6_e3m2_a_fp8,
|
||||
]:
|
||||
# TODO: double check this one
|
||||
self._quant_dtype = "mxfp8"
|
||||
self._quant_dtype = current_platform.fp8_dtype()
|
||||
|
||||
@property
|
||||
def quant_dtype(self) -> torch.dtype | str | None:
|
||||
|
||||
@@ -332,12 +332,23 @@ class TritonExperts(LoRAExpertsMixin, mk.FusedMoEExpertsModular):
|
||||
else:
|
||||
lora_x = hidden_states
|
||||
|
||||
# TODO: The fallback to self.a1_scale was added for deferred static
|
||||
# activation quantization in https://github.com/vllm-project/vllm/pull/40857.
|
||||
# Activation emulation relies solely on `a1q_scale` output of
|
||||
# `moe_kernel_quantize_input` - this should be adapted to
|
||||
# always solely rely on `a1q_scale`.
|
||||
input_scale = (
|
||||
a1q_scale
|
||||
if self.quantization_emulation
|
||||
else (a1q_scale if a1q_scale is not None else self.a1_scale)
|
||||
)
|
||||
|
||||
def _base_w13_fn():
|
||||
invoke_fused_moe_triton_kernel(
|
||||
hidden_states,
|
||||
w1,
|
||||
intermediate_cache1,
|
||||
a1q_scale if a1q_scale is not None else self.a1_scale,
|
||||
input_scale,
|
||||
self.w1_scale,
|
||||
None, # topk_weights
|
||||
sorted_token_ids,
|
||||
|
||||
Reference in New Issue
Block a user