[MoE Kernel] Flashinfer nvfp4 cutedsl moe kernel integration (#38050)

This commit is contained in:
Yongye Zhu
2026-03-25 10:16:40 -07:00
committed by GitHub
parent bf4cc9ed2d
commit 678b3c99e8
6 changed files with 574 additions and 245 deletions
+18
View File
@@ -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"
)
@@ -251,6 +257,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.
@@ -767,6 +782,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",
@@ -775,6 +792,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",