[Quantization] Add FlashInfer CuteDSL batched experts backend for NVFP4 MoE (#38251)
Signed-off-by: Yongye Zhu <zyy1102000@gmail.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Co-authored-by: Roger Wang <hey@rogerw.io>
This commit is contained in:
co-authored by
Michael Goin
Roger Wang
parent
94fbb09894
commit
e8ebbdde83
@@ -128,6 +128,12 @@ scaled_fp4_grouped_quantize = _lazy_import_wrapper(
|
||||
nvfp4_block_scale_interleave = _lazy_import_wrapper(
|
||||
"flashinfer.fp4_quantization", "block_scale_interleave"
|
||||
)
|
||||
flashinfer_cute_dsl_fused_moe_nvfp4 = _lazy_import_wrapper(
|
||||
"flashinfer", "cute_dsl_fused_moe_nvfp4"
|
||||
)
|
||||
flashinfer_convert_sf_to_mma_layout = _lazy_import_wrapper(
|
||||
"flashinfer.cute_dsl.utils", "convert_sf_to_mma_layout"
|
||||
)
|
||||
trtllm_fp4_block_scale_moe = _lazy_import_wrapper(
|
||||
"flashinfer", "trtllm_fp4_block_scale_moe"
|
||||
)
|
||||
@@ -252,6 +258,15 @@ def has_flashinfer_cutedsl_grouped_gemm_nt_masked() -> bool:
|
||||
return True
|
||||
|
||||
|
||||
@functools.cache
|
||||
def has_flashinfer_cutedsl_moe_nvfp4() -> bool:
|
||||
"""Return ``True`` if FlashInfer cute_dsl_fused_moe_nvfp4 is available."""
|
||||
if not has_flashinfer_cutedsl():
|
||||
return False
|
||||
mod = _get_submodule("flashinfer")
|
||||
return mod is not None and hasattr(mod, "cute_dsl_fused_moe_nvfp4")
|
||||
|
||||
|
||||
@functools.cache
|
||||
def has_nvidia_artifactory() -> bool:
|
||||
"""Return `True` if NVIDIA's artifactory is accessible.
|
||||
@@ -768,6 +783,8 @@ __all__ = [
|
||||
"silu_and_mul_scaled_nvfp4_experts_quantize",
|
||||
"scaled_fp4_grouped_quantize",
|
||||
"nvfp4_block_scale_interleave",
|
||||
"flashinfer_cute_dsl_fused_moe_nvfp4",
|
||||
"flashinfer_convert_sf_to_mma_layout",
|
||||
"trtllm_fp4_block_scale_moe",
|
||||
"autotune",
|
||||
"has_flashinfer_moe",
|
||||
@@ -776,6 +793,7 @@ __all__ = [
|
||||
"has_flashinfer_nvlink_one_sided",
|
||||
"has_flashinfer_cutlass_fused_moe",
|
||||
"has_flashinfer_cutedsl_grouped_gemm_nt_masked",
|
||||
"has_flashinfer_cutedsl_moe_nvfp4",
|
||||
"has_flashinfer_fp8_blockscale_gemm",
|
||||
"has_nvidia_artifactory",
|
||||
"supports_trtllm_attention",
|
||||
|
||||
Reference in New Issue
Block a user