Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions flashinfer/aot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from .jit.fp8_quantization import gen_mxfp8_quantization_sm100_module
from .jit.fused_moe import (
gen_cutlass_fused_moe_sm120_module,
gen_cutlass_fused_moe_sm103_module,
gen_cutlass_fused_moe_sm100_module,
gen_cutlass_fused_moe_sm90_module,
gen_trtllm_gen_fused_moe_sm100_module,
Expand Down Expand Up @@ -494,6 +495,7 @@ def gen_all_modules(
jit_specs.append(gen_tgv_gemm_sm10x_module(torch.float16, use_sm_100f=True))
if has_sm103:
jit_specs.append(gen_fp4_quantization_sm103_module())
jit_specs.append(gen_cutlass_fused_moe_sm103_module())
if has_sm110:
jit_specs.append(gen_fp4_quantization_sm110_module())
if has_sm120:
Expand Down
2 changes: 2 additions & 0 deletions flashinfer/fused_moe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
convert_to_block_layout,
cutlass_fused_moe,
gen_cutlass_fused_moe_sm120_module,
gen_cutlass_fused_moe_sm103_module,
gen_cutlass_fused_moe_sm100_module,
gen_cutlass_fused_moe_sm90_module,
gen_trtllm_gen_fused_moe_sm100_module,
Expand All @@ -39,6 +40,7 @@
"convert_to_block_layout",
"cutlass_fused_moe",
"gen_cutlass_fused_moe_sm120_module",
"gen_cutlass_fused_moe_sm103_module",
"gen_cutlass_fused_moe_sm100_module",
"gen_cutlass_fused_moe_sm90_module",
"gen_trtllm_gen_fused_moe_sm100_module",
Expand Down
5 changes: 4 additions & 1 deletion flashinfer/fused_moe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
)
from ..jit.fused_moe import (
gen_cutlass_fused_moe_sm120_module,
gen_cutlass_fused_moe_sm103_module,
gen_cutlass_fused_moe_sm100_module,
gen_cutlass_fused_moe_sm90_module,
gen_cutlass_fused_moe_sm89_module,
Expand Down Expand Up @@ -315,7 +316,9 @@ def convert_to_block_layout(input_tensor: torch.Tensor, blockK: int) -> torch.Te
def get_cutlass_fused_moe_module(backend: str = "100", use_fast_build: bool = False):
if backend in ("120", "121"):
module = gen_cutlass_fused_moe_sm120_module(use_fast_build).build_and_load()
elif backend in ("100", "103", "110"):
elif backend == "103":
module = gen_cutlass_fused_moe_sm103_module(use_fast_build).build_and_load()
elif backend in ("100", "110"):
module = gen_cutlass_fused_moe_sm100_module(use_fast_build).build_and_load()
elif backend == "90":
module = gen_cutlass_fused_moe_sm90_module(use_fast_build).build_and_load()
Expand Down
18 changes: 18 additions & 0 deletions flashinfer/jit/fused_moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ def gen_cutlass_fused_moe_sm120_module(use_fast_build: bool = False) -> JitSpec:
return gen_cutlass_fused_moe_module(nvcc_flags, "120", use_fast_build)


def gen_cutlass_fused_moe_sm103_module(use_fast_build: bool = False) -> JitSpec:
nvcc_flags = [
"-DCOMPILE_BLACKWELL_TMA_GEMMS",
"-DCOMPILE_BLACKWELL_TMA_GROUPED_GEMMS",
"-DENABLE_BF16",
"-DENABLE_FP8",
"-DENABLE_FP4",
"-DUSING_OSS_CUTLASS_MOE_GEMM",
"-DCOMPILE_BLACKWELL_SM103_TMA_GROUPED_GEMMS",
]

nvcc_flags += current_compilation_context.get_nvcc_flags_list(
supported_major_versions=[10]
)

return gen_cutlass_fused_moe_module(nvcc_flags, "103", use_fast_build)


def gen_cutlass_fused_moe_sm100_module(use_fast_build: bool = False) -> JitSpec:
nvcc_flags = [
"-DCOMPILE_BLACKWELL_TMA_GEMMS",
Expand Down