Triton MoE
Self-contained Triton implementation of the HF/OpenAI-style expert MoE layer.
Exports CUDA inference layers:
triton_moe.layers.MoE: functional benchmark signature.triton_moe.layers.OpenaiExperts: HFOpenaiExperts-compatible stateless layer signature.
The implementation uses Triton route grouping, ragged grouped GEMMs, fused routing-weight application, and token-wise top-k reduction. It does not implement backward.
Benchmarking against comparable kernels
Definitions for terms in the following benchmark results:
- HF Kernel Hub -> https://huggingface.co/kernels/kernels-community/triton-moe
- VLLM -> Runner code (https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/gpt_oss.py) with kernel source code (https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/layers/fused_moe/fused_moe.py)
We ran comparisons for decode (low batch size) and prefill (large batch size) scenarios. The configuration was for 128 experts with top-k 8.
Numbers in brackets are (-x) relative to (HF Kernel Hub | VLLM) respectively.
| Batch Size | HF Kernel Hub (ms) | VLLM (ms) | nCompass (ms) |
|---|---|---|---|
| 16 | 4.59 | 1.21 | 0.29 (15.9x, 4.2x) |
| 64 | 12.0 | 1.37 | 0.29 (40.9x, 4.7x) |
| 8192 | 20.4 | 1.46 | 0.35 (58.5x, 4.2x) |
| 16384 | 20.7 | 1.78 | 0.55 (37.9x, 3.3x) |
- Downloads last month
- -
Supported hardwares new
CUDA





