[Perf] Do FP4 quant before All gather on flashinfer trtllmgen MOE (#30014)
Signed-off-by: jiahanc <173873397+jiahanc@users.noreply.github.com>
This commit is contained in:
@@ -184,6 +184,23 @@ def has_flashinfer_cutedsl() -> bool:
|
||||
)
|
||||
|
||||
|
||||
@functools.cache
|
||||
def has_flashinfer_trtllm_fused_moe() -> bool:
|
||||
"""Return `True` if FlashInfer TRTLLM fused MoE is available."""
|
||||
if not has_flashinfer_moe():
|
||||
return False
|
||||
required_functions = [
|
||||
("flashinfer.fused_moe", "trtllm_fp8_block_scale_moe"),
|
||||
("flashinfer.fused_moe", "trtllm_fp8_per_tensor_scale_moe"),
|
||||
("flashinfer.fused_moe", "trtllm_fp4_block_scale_moe"),
|
||||
]
|
||||
for module_name, attr_name in required_functions:
|
||||
mod = _get_submodule(module_name)
|
||||
if not mod or not hasattr(mod, attr_name):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
@functools.cache
|
||||
def has_flashinfer_cutlass_fused_moe() -> bool:
|
||||
"""Return `True` if FlashInfer CUTLASS fused MoE is available."""
|
||||
|
||||
Reference in New Issue
Block a user