Skip to content
Merged
Show file tree
Hide file tree
Changes from 237 commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
13b619f
stash
Jan 8, 2026
04bb010
first correctness!
Jan 8, 2026
b1320de
updated
Jan 8, 2026
4d47206
comments
Jan 8, 2026
f86fad8
updated
Jan 8, 2026
5601b95
Merge branch 'main' into naive-dispatch-combine
robertgshaw2-redhat Jan 8, 2026
8c1a530
updateds
Jan 8, 2026
7d7d5a6
nit changes
Jan 8, 2026
63357f7
support apply router weight on input
Jan 8, 2026
3886cfb
attempt to get everything working for llama scout modelopt flashinfer…
Jan 8, 2026
2284b59
updated
Jan 8, 2026
e131054
apply to batched deep gemm
Jan 10, 2026
77c7b05
updated
Jan 11, 2026
477d699
stash
Jan 11, 2026
9f2e10b
remove NaiveBatchedExperts
Jan 11, 2026
ef5e664
stash
Jan 11, 2026
f6e85bc
stash
Jan 11, 2026
0db0b11
added back moe torch iterative
Jan 11, 2026
09dc4f5
revert changes
Jan 11, 2026
3311e9e
re add
Jan 11, 2026
755a3a2
add back iterative
Jan 11, 2026
a8bb9d0
add methodology to kernels
Jan 11, 2026
eb571a2
restructure kernel selection logic
Jan 12, 2026
8f0a969
remove is_cuda
Jan 12, 2026
e461b6f
added renamed file
Jan 12, 2026
93bd28b
improve quant scheme
Jan 12, 2026
2b24d70
improve validation
Jan 12, 2026
312b767
improve platform selection logic
Jan 12, 2026
0f37e95
nit newline
Jan 12, 2026
c187335
nit newline
Jan 12, 2026
6ad575e
revert spurious LOC change
Jan 12, 2026
2aabb4f
revert spurious LOC change
Jan 12, 2026
3c5f602
updated
Jan 12, 2026
00a130a
update marlin
Jan 12, 2026
bd38266
updated
Jan 12, 2026
bba97f4
updated
Jan 12, 2026
dc9723a
support differentiating on static vs dynamic
Jan 12, 2026
fc9ea07
newline nit
Jan 12, 2026
ef8bb7e
update logic for aiter foudn
Jan 12, 2026
dde5dd2
cleanup support logic
Jan 12, 2026
f8045c6
update logic for trtllm config
Jan 12, 2026
40ecf90
updated
Jan 12, 2026
372c697
more progress
Jan 13, 2026
139941a
updated
Jan 13, 2026
fb90fc0
updated
Jan 13, 2026
b3c818d
updated
Jan 13, 2026
5efe9ff
Merge branch 'main' into naive-dispatch-combine
robertgshaw2-redhat Jan 13, 2026
234144b
merged
Jan 13, 2026
e932743
updated
Jan 13, 2026
b21e8be
updated
Jan 13, 2026
7a269bc
updated
Jan 13, 2026
02b0848
updated
Jan 13, 2026
85615f1
update kernel selection logic
Jan 13, 2026
9a4a871
seem to have accuracy with dp/ep and tp for deepgemm
Jan 13, 2026
9f829f0
updated
Jan 13, 2026
03ce528
re-add
Jan 13, 2026
9ce0412
added back naive batched experts
Jan 13, 2026
856d9dc
added back naive batched experts
Jan 13, 2026
38ae5e7
added back naive batched experts
Jan 13, 2026
81b5ed3
added back naive batched experts
Jan 13, 2026
550b42a
reduce LOC change
Jan 13, 2026
d85bd8b
reduce LOC change
Jan 13, 2026
642b85c
reduce LOC change
Jan 13, 2026
5027a28
reduce loc change
Jan 13, 2026
6a009d6
reduce LOC change
Jan 13, 2026
1cc46be
fix native ag/rs
Jan 14, 2026
62d9d7c
oracle is now working properly
Jan 14, 2026
7d7fcd9
confirmed aiter env variables work as expected
Jan 14, 2026
51a93fe
fix up oracle
Jan 14, 2026
a600601
trying to make ct work
Jan 14, 2026
63ea73a
Merge remote-tracking branch 'origin/main' into oracle-improvements
Jan 14, 2026
f83c63e
made llama 4 work via compressed tensors
Jan 14, 2026
9cb7771
initial attempt at modelopt
Jan 14, 2026
ad28a18
attempt to fix naive multicast
Jan 14, 2026
b507afa
flashinfer appears to be working
Jan 14, 2026
18f6159
Merge remote-tracking branch 'origin/main' into oracle-improvements
Jan 14, 2026
50b106b
stash changes for review
Jan 14, 2026
75aca72
made modelopt start up
Jan 14, 2026
3287512
still enable flashinfer
Jan 14, 2026
84b83b6
remove comments
Jan 14, 2026
3f90b88
appears that we have AG/RS working for nvfp4
Jan 14, 2026
19537ff
updated
Jan 14, 2026
dfefddf
updated
Jan 14, 2026
232a5b9
updared comment
Jan 14, 2026
d2dd979
make marling work with current device
Jan 14, 2026
d35c247
added compressed tensors nvfp4
Jan 14, 2026
4c9656a
added compressed tensors nvfp4 - nit
Jan 14, 2026
9d5d3ee
remove shared expert overlap functionality
Jan 14, 2026
553efc1
make cutedsl work
Jan 14, 2026
218e9bf
hook up marlin experts properly
Jan 14, 2026
3c97fda
hook up marlin experts properly
Jan 14, 2026
f2714d8
make marlin work with AG/RS
Jan 14, 2026
471428f
convert to using quant key
Jan 14, 2026
e17d456
convert to using quant key
Jan 14, 2026
8cacf5a
reject usage for things that have not migrated over yet
Jan 14, 2026
9518c97
reject usage for things that have not migrated over yet
Jan 14, 2026
ab090c1
reject usage for things that have not migrated over yet
Jan 14, 2026
1db50dc
reject usage for things that have not migrated over yet
Jan 14, 2026
6090a06
differentiate static vs dynamic quantization
Jan 14, 2026
6a3a75b
remove newline
Jan 14, 2026
89911ea
fix static vs dynamic
Jan 14, 2026
ad8fe2e
get things working again
Jan 14, 2026
7bc3674
updated
Jan 15, 2026
f8d3af7
updatred
Jan 15, 2026
10b957c
attempt to get sp working
Jan 15, 2026
e8ab545
nit
Jan 15, 2026
50a8c97
appears to be working properly
Jan 15, 2026
ddc2eb1
fix pre commit
Jan 15, 2026
5f913ea
updated
Jan 15, 2026
e58e783
remove flashinfer constructors
Jan 15, 2026
a8de4da
nits
Jan 15, 2026
2c9e9e6
remove do naive dispach combine comment
Jan 15, 2026
9a907e0
update backend names
Jan 15, 2026
0670758
update fallback experts
Jan 15, 2026
3d320b0
fix up batched triton experts
Jan 15, 2026
862164c
stash
Jan 15, 2026
921890c
revert the device communicator
Jan 15, 2026
40bf17a
updated
Jan 15, 2026
fb98ea9
Revert cutlass pf
Jan 15, 2026
d692f76
revert changes to layer
Jan 15, 2026
2ab51f7
revert chnge
Jan 15, 2026
58256b5
revert naive ep
Jan 15, 2026
874f894
remove more unrelated changes
Jan 15, 2026
f6b8e7b
cleanup flashinfer fp4 moe
Jan 15, 2026
a32bc51
reduce LOC change
Jan 15, 2026
de09845
updated
Jan 15, 2026
6b15d8d
updated
Jan 15, 2026
4256166
updated fp8
Jan 15, 2026
0f80a79
updated 'make_fp8_moe_kernel'
Jan 15, 2026
5a7bed9
update fp8 moe layer
Jan 15, 2026
6e299c6
updated the get_clss
Jan 15, 2026
3544ee3
stash
Jan 15, 2026
fd1a001
stahs
Jan 15, 2026
aeafbf8
Merge branch 'oracle-part-a' of https://github.com/vllm-project/vllm …
Jan 15, 2026
a9d2114
updated
Jan 15, 2026
d0a6f39
updated
Jan 15, 2026
7db61bf
make modelopt fp8 work
Jan 15, 2026
e5f9ac1
updated
Jan 15, 2026
44d0818
updated
Jan 15, 2026
9e3f2dc
make nvfp4 marlin work
Jan 15, 2026
2842ab3
updated
Jan 15, 2026
5e1c442
updated logic for per_out_ch_qaunt
Jan 15, 2026
3fdc3ac
updated
Jan 15, 2026
7cb0add
updated
Jan 15, 2026
2ecfbd1
improve UX of kernel selection
Jan 15, 2026
10ddd3d
updated
Jan 15, 2026
9abc637
updated
Jan 15, 2026
d23017e
merge mxfp4 hack
Jan 15, 2026
887b4a8
remove deep gemm direct call
Jan 15, 2026
ac86ed9
nit
Jan 15, 2026
a3a6851
fixing up tests
Jan 15, 2026
e28b688
fix deepgemm tests
Jan 15, 2026
d20a128
fix deepgemm tests
Jan 15, 2026
38479ab
trying to get deepgemm tests to pass
Jan 15, 2026
44fb9ba
stash
Jan 15, 2026
8a2daf3
fixing up kernel tests
Jan 15, 2026
0e6aa44
nice job by cursor bot on staticmethod decorator
Jan 15, 2026
fa7b47a
updating kernel tests so that they pass
Jan 15, 2026
eb324a3
fix marlin
Jan 15, 2026
e8fe2c5
remove test moe config
Jan 15, 2026
7df6cc4
updated
Jan 15, 2026
8ce1872
various niceties for reducing loc change
Jan 15, 2026
41882ed
update test pipeline
Jan 15, 2026
74ee32e
fix modular oai triton moe test
Jan 15, 2026
e44a6b8
udpate test
Jan 15, 2026
08eaf79
reduce LOC change
Jan 15, 2026
085292c
allow passing
Jan 15, 2026
b60600a
fix messed up config
Jan 15, 2026
579f767
updated
Jan 15, 2026
56bbed7
clean up unquanitzed
Jan 15, 2026
2131000
fix re-commit
Jan 16, 2026
f3983b7
unify marlin expers contruction
Jan 16, 2026
a065a3d
updared
Jan 16, 2026
8e309f2
Merge remote-tracking branch 'origin/main' into oracle-part-a
Jan 16, 2026
57cfc39
pre commit
Jan 16, 2026
a21c1c2
fix nit on trtllmgenexperts'
Jan 16, 2026
aa52eac
fix cruft aroundAITER
Jan 16, 2026
65700b7
updated
Jan 16, 2026
1a75c1c
updated
Jan 16, 2026
5fb3cf1
updated
Jan 16, 2026
a39d5f6
updated
Jan 16, 2026
9cefbf6
updated is device capability family
Jan 16, 2026
19317e9
clean up rocm device support
Jan 16, 2026
f8a3f26
remove 'supports_mk_internally'
Jan 16, 2026
8fb07cc
clean up selection logic
Jan 16, 2026
9263f0c
clean up fp8 oracle logic
Jan 16, 2026
19994f7
some nits
Jan 16, 2026
e074942
clean up fp8 oracle
Jan 16, 2026
e4d6b11
fix routing method
Jan 16, 2026
2d16ebf
fix device capability family
Jan 16, 2026
8b8b2b6
fix fp online quantization
Jan 16, 2026
2d80215
fix marlin fp8
Jan 16, 2026
06507db
updated
Jan 16, 2026
3d18294
fix the llama router
Jan 16, 2026
1c8da11
revert property/abstractmethod
Jan 16, 2026
8eb22f9
make mkt
Jan 16, 2026
61edf96
revert propery change
Jan 16, 2026
d899bf7
address comment about on_gfx9
Jan 16, 2026
aeeb9a6
Merge branch 'main' into oracle-part-a
robertgshaw2-redhat Jan 16, 2026
a4df64f
rearrange test group
Jan 16, 2026
9962603
fix typing
Jan 16, 2026
ba258a1
fix signature
Jan 16, 2026
4cbb716
Merge branch 'main' into oracle-part-a
robertgshaw2-redhat Jan 16, 2026
7f5c939
fix typing
Jan 16, 2026
48787c5
nits
Jan 16, 2026
90a4eda
fix FP8 DeepGEMM on Blackwell
Jan 16, 2026
259fa0d
fix up configs
Jan 16, 2026
27deabd
fix quantization test, was falling back to marlin because we had wron…
Jan 16, 2026
e204759
Merge branch 'main' into oracle-part-a
robertgshaw2-redhat Jan 16, 2026
414db5c
fix mk object creation
Jan 16, 2026
e24f6d8
Merge branch 'main' into oracle-part-a
robertgshaw2-redhat Jan 17, 2026
0a99a73
updated
Jan 17, 2026
909b7aa
fix cutlass experts fp4
Jan 17, 2026
aeb81f1
improve ux
Jan 17, 2026
a0f2edd
updated
Jan 17, 2026
3289d85
address nits
Jan 17, 2026
6307fcd
do the merge
Jan 18, 2026
6ff57d7
allow renormalzie and renormalize naive for fp8
Jan 18, 2026
3394fc8
clean up routing logic
Jan 18, 2026
08b1ece
remove routing method type from constrcutor
Jan 18, 2026
6fbd908
fix some nits
Jan 18, 2026
4f64e56
Merge branch 'main' into oracle-part-a
robertgshaw2-redhat Jan 18, 2026
e27db9d
merged
Jan 19, 2026
a1abcb7
updated
Jan 19, 2026
3e2c2fd
updated
Jan 19, 2026
28c6b64
address comment about get_clss()
Jan 20, 2026
c05afc6
revert make batched vs make standard
Jan 20, 2026
f20fae2
update mk objects
Jan 20, 2026
bb84b24
update mk objects
Jan 20, 2026
5f147dd
updated
Jan 20, 2026
679b748
fix the signatures
Jan 20, 2026
2818bda
fix pre-commit
Jan 20, 2026
8b2ffd4
Merge remote-tracking branch 'origin/main' into oracle-part-a
Jan 20, 2026
8f95644
remove llama 4.to_cuda
Jan 20, 2026
a3a91e1
Merge branch 'main' into oracle-part-a
robertgshaw2-redhat Jan 20, 2026
7db101a
fix tess
Jan 20, 2026
a19a33c
rename is gated act
Jan 20, 2026
5ae0120
add unquantized to triton experts
Jan 20, 2026
bda1fc2
Merge branch 'oracle-part-a' of https://github.com/vllm-project/vllm …
Jan 20, 2026
1ca7d0a
remove batched deepgemm too
Jan 20, 2026
d6d008b
fix typing
Jan 20, 2026
ea2d2da
fix nit
Jan 20, 2026
327fb7b
backend_to_kernel_cls
Jan 20, 2026
e963c83
get_clses
Jan 20, 2026
b9835ef
updated device typing
Jan 20, 2026
3dd21d0
Update vllm/model_executor/layers/fused_moe/oracle/nvfp4.py
robertgshaw2-redhat Jan 20, 2026
6ac2a12
Merge branch 'oracle-part-a' of https://github.com/vllm-project/vllm …
Jan 20, 2026
b0a9f95
pre-commit
Jan 20, 2026
e455943
raise error for not yet supported
Jan 20, 2026
0d2a917
Merge branch 'main' into oracle-part-a
robertgshaw2-redhat Jan 21, 2026
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
40 changes: 40 additions & 0 deletions .buildkite/test-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,46 @@ steps:
- pip install helion
- pytest -v -s kernels/helion/


- label: Kernels FP8 MoE Test (1 H100)
timeout_in_minutes: 90
gpu: h100
num_gpus: 1
optional: true
commands:
- pytest -v -s kernels/moe/test_cutlass_moe.py
- pytest -v -s kernels/moe/test_flashinfer.py
- pytest -v -s kernels/moe/test_gpt_oss_triton_kernels.py
- pytest -v -s kernels/moe/test_modular_oai_triton_moe.py
- pytest -v -s kernels/moe/test_moe.py
# - pytest -v -s kernels/moe/test_block_fp8.py - failing on main
- pytest -v -s kernels/moe/test_block_int8.py
- pytest -v -s kernels/moe/test_triton_moe_no_act_mul.py
- pytest -v -s kernels/moe/test_triton_moe_ptpc_fp8.py

- label: Kernels FP8 MoE Test (2 H100s)
timeout_in_minutes: 90
gpu: h100
num_gpus: 2
optional: true
commands:
- pytest -v -s kernels/moe/test_deepep_deepgemm_moe.py
- pytest -v -s kernels/moe/test_deepep_moe.py
- pytest -v -s kernels/moe/test_pplx_cutlass_moe.py
# - pytest -v -s kernels/moe/test_pplx_moe.py - failing on main

- label: Kernels Fp4 MoE Test (B200)
timeout_in_minutes: 60
gpu: b200
num_gpus: 1
optional: true
commands:
- pytest -v -s kernels/moe/test_cutedsl_moe.py
- pytest -v -s kernels/moe/test_flashinfer_moe.py
- pytest -v -s kernels/moe/test_nvfp4_moe.py
- pytest -v -s kernels/moe/test_ocp_mx_moe.py


- label: Model Executor Test # 23min
timeout_in_minutes: 35
torch_nightly: true
Expand Down
12 changes: 7 additions & 5 deletions benchmarks/kernels/benchmark_cutlass_moe_fp8.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import torch

import vllm.model_executor.layers.fused_moe.modular_kernel as mk
from tests.kernels.moe.utils import make_dummy_moe_config
from vllm import _custom_ops as ops
from vllm.model_executor.layers.fused_moe.config import fp8_w8a8_moe_quant_config
from vllm.model_executor.layers.fused_moe.cutlass_moe import CutlassExpertsFp8
Expand Down Expand Up @@ -138,12 +139,13 @@ def bench_run(
fn = mk.FusedMoEModularKernel(
MoEPrepareAndFinalizeNoEP(),
CutlassExpertsFp8(
out_dtype=a.dtype,
e=num_experts,
n=n,
k=k,
moe_config=make_dummy_moe_config(
num_experts=num_experts,
hidden_dim=k,
intermediate_size_per_partition=n,
in_dtype=a.dtype,
),
quant_config=quant_config,
device=w1.device,
),
)

Expand Down
7 changes: 3 additions & 4 deletions benchmarks/kernels/benchmark_cutlass_moe_nvfp4.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import torch.utils.benchmark as benchmark

import vllm.model_executor.layers.fused_moe.modular_kernel as mk
from tests.kernels.moe.utils import make_dummy_moe_config
from vllm import _custom_ops as ops
from vllm.config import ParallelConfig, VllmConfig, set_current_vllm_config
from vllm.model_executor.layers.fused_moe.config import (
Expand Down Expand Up @@ -198,8 +199,7 @@ def run_cutlass_moe_fp4(
kernel = mk.FusedMoEModularKernel(
MoEPrepareAndFinalizeNoEP(defer_input_quant=True),
CutlassExpertsFp4(
out_dtype=dtype,
max_experts_per_worker=e,
make_dummy_moe_config(),
quant_config=quant_config,
),
)
Expand Down Expand Up @@ -244,8 +244,7 @@ def run_cutlass_from_graph(
kernel = mk.FusedMoEModularKernel(
MoEPrepareAndFinalizeNoEP(defer_input_quant=True),
CutlassExpertsFp4(
out_dtype=dtype,
max_experts_per_worker=e,
make_dummy_moe_config(),
quant_config=quant_config,
),
)
Expand Down
25 changes: 13 additions & 12 deletions benchmarks/kernels/benchmark_grouped_gemm_cutlass.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from benchmark_shapes import WEIGHT_SHAPES_MOE

import vllm.model_executor.layers.fused_moe.modular_kernel as mk
from tests.kernels.moe.utils import make_dummy_moe_config
from vllm import _custom_ops as ops
from vllm.config import ParallelConfig, VllmConfig, set_current_vllm_config
from vllm.model_executor.layers.fused_moe.config import fp8_w8a8_moe_quant_config
Expand Down Expand Up @@ -134,13 +135,13 @@ def run_cutlass_moe(
fn = mk.FusedMoEModularKernel(
MoEPrepareAndFinalizeNoEP(),
CutlassExpertsFp8(
out_dtype=a.dtype,
# NOTE(rob): w2 is shaped as [E, hidden, intermediate]
e=w2.shape[0],
n=w2.shape[2],
k=w2.shape[1],
moe_config=make_dummy_moe_config(
num_experts=w2.shape[0],
hidden_dim=w2.shape[1],
intermediate_size_per_partition=w2.shape[2],
in_dtype=a.dtype,
),
quant_config=quant_config,
device=w1.device,
),
)

Expand All @@ -166,13 +167,13 @@ def run_cutlass_from_graph(
fn = mk.FusedMoEModularKernel(
MoEPrepareAndFinalizeNoEP(),
CutlassExpertsFp8(
out_dtype=a.dtype,
# NOTE(rob): w2 is shaped as [E, hidden, intermediate]
e=w2.shape[0],
n=w2.shape[2],
k=w2.shape[1],
moe_config=make_dummy_moe_config(
num_experts=w2.shape[0],
hidden_dim=w2.shape[1],
intermediate_size_per_partition=w2.shape[2],
in_dtype=a.dtype,
),
quant_config=quant_config,
device=w1.device,
),
)

Expand Down
30 changes: 29 additions & 1 deletion benchmarks/kernels/benchmark_moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@
from ray.experimental.tqdm_ray import tqdm

from vllm.model_executor.layers.fused_moe.config import (
FusedMoEConfig,
FusedMoEParallelConfig,
FusedMoEQuantConfig,
RoutingMethodType,
_get_config_dtype_str,
)
from vllm.model_executor.layers.fused_moe.fused_moe import *
from vllm.model_executor.layers.fused_moe.triton_deep_gemm_moe import (
TritonOrDeepGemmExperts,
)
from vllm.platforms import current_platform
from vllm.transformers_utils.config import get_config
from vllm.triton_utils import triton
Expand Down Expand Up @@ -194,10 +200,33 @@ def run():
block_shape=block_quant_shape,
)

deep_gemm_experts = mk.FusedMoEModularKernel(
prepare_finalize=MoEPrepareAndFinalizeNoEP(),
fused_experts=TritonOrDeepGemmExperts(
moe_config=FusedMoEConfig(
num_experts=num_experts,
experts_per_token=topk,
hidden_dim=hidden_size,
intermediate_size_per_partition=shard_intermediate_size,
num_local_experts=num_experts,
activation="silu",
parallel_config=FusedMoEParallelConfig.make_no_parallel(),
in_dtype=init_dtype,
routing_method=RoutingMethodType.TopK,
),
quant_config=quant_config,
),
)

with override_config(config):
topk_weights, topk_ids, token_expert_indices = fused_topk(
x, input_gating, topk, renormalize=not use_deep_gemm
)

if use_deep_gemm:
return deep_gemm_experts(
x, w1, w2, topk_weights, topk_ids, inplace=True
)
return fused_experts(
x,
w1,
Expand All @@ -206,7 +235,6 @@ def run():
topk_ids,
inplace=True,
quant_config=quant_config,
allow_deep_gemm=use_deep_gemm,
)

# JIT compilation & warmup
Expand Down
4 changes: 2 additions & 2 deletions docs/design/moe_kernel_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ To be used with a particular `FusedMoEPrepareAndFinalize` subclass, MoE kernels
|--------|-------------------|--------------|---------------|---------------------|-----------------------|---------|--------|
| triton | standard | all<sup>1</sup> | G,A,T | silu, gelu,</br>swigluoai,</br>silu_no_mul,</br>gelu_no_mul | Y | Y | [`fused_experts`][vllm.model_executor.layers.fused_moe.fused_moe.fused_experts],</br>[`TritonExperts`][vllm.model_executor.layers.fused_moe.fused_moe.TritonExperts] |
| triton (batched) | batched | all<sup>1</sup> | G,A,T | silu, gelu | <sup>6</sup> | Y | [`BatchedTritonExperts`][vllm.model_executor.layers.fused_moe.fused_batched_moe.BatchedTritonExperts] |
| deep gemm | standard,</br>batched | fp8 | G(128),A,T | silu, gelu | <sup>6</sup> | Y | [`deep_gemm_moe_fp8`][vllm.model_executor.layers.fused_moe.deep_gemm_moe.deep_gemm_moe_fp8],</br>[`DeepGemmExperts`][vllm.model_executor.layers.fused_moe.deep_gemm_moe.DeepGemmExperts],</br>[`BatchedDeepGemmExperts`][vllm.model_executor.layers.fused_moe.batched_deep_gemm_moe.BatchedDeepGemmExperts] |
| deep gemm | standard,</br>batched | fp8 | G(128),A,T | silu, gelu | <sup>6</sup> | Y | </br>[`DeepGemmExperts`][vllm.model_executor.layers.fused_moe.deep_gemm_moe.DeepGemmExperts],</br>[`BatchedDeepGemmExperts`][vllm.model_executor.layers.fused_moe.batched_deep_gemm_moe.BatchedDeepGemmExperts] |
| cutlass_fp4 | standard,</br>batched | nvfp4 | A,T | silu | Y | Y | [`CutlassExpertsFp4`][vllm.model_executor.layers.fused_moe.cutlass_moe.CutlassExpertsFp4] |
| cutlass_fp8 | standard,</br>batched | fp8 | A,T | silu, gelu | Y | Y | [`CutlassExpertsFp8`][vllm.model_executor.layers.fused_moe.cutlass_moe.CutlassExpertsFp8],</br>[`CutlasBatchedExpertsFp8`][vllm.model_executor.layers.fused_moe.cutlass_moe.CutlassBatchedExpertsFp8] |
| flashinfer | standard | nvfp4,</br>fp8 | T | <sup>5</sup> | N | Y | [`flashinfer_cutlass_moe_fp4`][vllm.model_executor.layers.fused_moe.flashinfer_cutlass_moe.flashinfer_cutlass_moe_fp4],</br>[`FlashInferExperts`][vllm.model_executor.layers.fused_moe.flashinfer_cutlass_moe.FlashInferExperts] |
| flashinfer | standard | nvfp4,</br>fp8 | T | <sup>5</sup> | N | Y | [`FlashInferExperts`][vllm.model_executor.layers.fused_moe.flashinfer_cutlass_moe.FlashInferExperts] |
| gpt oss triton | standard | N/A | N/A | <sup>5</sup> | Y | Y | [`triton_kernel_fused_experts`][vllm.model_executor.layers.fused_moe.gpt_oss_triton_kernels_moe.triton_kernel_fused_experts],</br>[`OAITritonExperts`][vllm.model_executor.layers.fused_moe.gpt_oss_triton_kernels_moe.OAITritonExperts] |
| marlin | standard,</br>batched | <sup>3</sup> / N/A | <sup>3</sup> / N/A | silu,</br>swigluoai | Y | Y | [`fused_marlin_moe`][vllm.model_executor.layers.fused_moe.fused_marlin_moe.fused_marlin_moe],</br>[`MarlinExperts`][vllm.model_executor.layers.fused_moe.fused_marlin_moe.MarlinExperts],</br>[`BatchedMarlinExperts`][vllm.model_executor.layers.fused_moe.fused_marlin_moe.BatchedMarlinExperts] |
| trtllm | standard | mxfp4,</br>nvfp4 | G(16),G(32) | <sup>5</sup> | N | Y | [`TrtLlmGenExperts`][vllm.model_executor.layers.fused_moe.trtllm_moe.TrtLlmGenExperts] |
Expand Down
6 changes: 3 additions & 3 deletions tests/compile/test_fusion_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from vllm.model_executor.layers.quantization.utils.quant_utils import (
QuantKey,
kFp8StaticTensorSym,
kNvfp4Quant,
kNvfp4Dynamic,
)
from vllm.platforms import current_platform
from vllm.utils.flashinfer import has_flashinfer
Expand Down Expand Up @@ -215,7 +215,7 @@ def forward(self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor):
class TestAttentionNvfp4QuantPatternModel(AttentionQuantPatternModel):
"""Test model for AttentionNvfp4QuantPattern fusion."""

quant_key = kNvfp4Quant
quant_key = kNvfp4Dynamic

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down Expand Up @@ -468,7 +468,7 @@ def test_attention_quant_pattern(

# Note: for fp8, fully_replaced=False because query quant ops remain in graph.
# Only output quant ops are fused into attention.
test_backend.check_before_ops([quant_op], fully_replaced=quant_key is kNvfp4Quant)
test_backend.check_before_ops([quant_op], fully_replaced=quant_key is kNvfp4Dynamic)

# access the underlying `AttnFusionPass` on the `LazyInitPass`
assert attn_pass.pass_.matched_count == sum(attn_fusion_supported)
Expand Down
6 changes: 3 additions & 3 deletions tests/compile/test_silu_mul_quant_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from vllm.model_executor.layers.quantization.utils.quant_utils import (
GroupShape,
kFp8StaticTensorSym,
kNvfp4Quant,
kNvfp4Dynamic,
)
from vllm.platforms import current_platform

Expand Down Expand Up @@ -134,11 +134,11 @@ def forward(self, x):
def ops_in_model_before(self):
return [
SILU_MUL_OP if self.enable_silu_mul_custom_op else torch.ops.aten.mul,
QUANT_OPS[kNvfp4Quant],
QUANT_OPS[kNvfp4Dynamic],
]

def ops_in_model_after(self):
return [FUSED_OPS[kNvfp4Quant]]
return [FUSED_OPS[kNvfp4Dynamic]]


class TestSiluMulGroupFp8QuantModel(torch.nn.Module):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ accuracy_threshold: 0.92
num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --data-parallel-size 2 --enable-expert-parallel"
env:
VLLM_USE_FLASHINFER_MOE_FP8: "0"
VLLM_USE_DEEP_GEMM: "0"
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ server_args: "--enforce-eager --max-model-len 8192 --data-parallel-size 2 --enab
env:
VLLM_USE_DEEP_GEMM: "1"
VLLM_USE_DEEP_GEMM_MOE: "1"
VLLM_USE_DEEP_GEMM_E8M0: "0"
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ server_args: "--enforce-eager --max-model-len 8192 --data-parallel-size 2 --enab
env:
VLLM_USE_DEEP_GEMM: "1"
VLLM_USE_DEEP_GEMM_MOE: "1"
VLLM_USE_DEEP_GEMM_E8M0: "0"
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ accuracy_threshold: 0.92
num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_FLASHINFER_MOE_FP8: "0"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_DEEP_GEMM: "0"
VLLM_USE_DEEP_GEMM_MOE: "0"
VLLM_USE_FLASHINFER_MOE_FP8: "1"
VLLM_FLASHINFER_MOE_BACKEND: "throughput"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_DEEP_GEMM: "0"
VLLM_USE_DEEP_GEMM_MOE: "0"
VLLM_USE_FLASHINFER_MOE_FP8: "1"
VLLM_FLASHINFER_MOE_BACKEND: "latency"
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_DEEP_GEMM: "0"
VLLM_USE_DEEP_GEMM_MOE: "0"
VLLM_TEST_FORCE_FP8_MARLIN: "1"
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_FLASHINFER_MOE_FP8: "0"
VLLM_USE_DEEP_GEMM: "0"
VLLM_USE_DEEP_GEMM_MOE: "0"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_DEEP_GEMM: "0"
VLLM_USE_DEEP_GEMM_MOE: "0"
VLLM_USE_FLASHINFER_MOE_FP8: "1"
VLLM_FLASHINFER_MOE_BACKEND: "throughput"
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_DEEP_GEMM: "0"
VLLM_USE_DEEP_GEMM_MOE: "0"
VLLM_TEST_FORCE_FP8_MARLIN: "1"
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_FLASHINFER_MOE_FP8: "0"
VLLM_USE_DEEP_GEMM: "0"
VLLM_USE_DEEP_GEMM_MOE: "0"
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ accuracy_threshold: 0.88
num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_FLASHINFER_MOE_FP4: "0"
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ accuracy_threshold: 0.88
num_questions: 1319
num_fewshot: 5
server_args: "--enforce-eager --max-model-len 8192 --tensor-parallel-size 2"
env:
VLLM_USE_FLASHINFER_MOE_FP4: "0"
5 changes: 5 additions & 0 deletions tests/kernels/moe/modular_kernel_tools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
FusedMoEConfig,
FusedMoEParallelConfig,
FusedMoEQuantConfig,
RoutingMethodType,
)
from vllm.utils.import_utils import has_deep_ep, has_deep_gemm, has_pplx

Expand Down Expand Up @@ -574,10 +575,14 @@ def next_power_of_2(x):
num_experts=config.E,
experts_per_token=config.topk,
hidden_dim=config.K,
intermediate_size_per_partition=config.N,
num_local_experts=config.num_local_experts,
moe_parallel_config=moe_parallel_config,
in_dtype=config.dtype,
max_num_tokens=next_power_of_2(config.M),
activation="silu",
device=vllm_config.device_config.device,
routing_method=RoutingMethodType.DeepSeekV3,
)

# make modular kernel
Expand Down
Loading