metal-moe-decode

Metal decode kernels for MoE and hybrid linear-attention models on Apple Silicon (e.g. Qwen3.8-Flash-Next with transformers' streamed experts). Pure torch.mps.compile_shader (no build step, torch-metal noarch variant).

from kernels import get_kernel
k = get_kernel("ArthurZ/metal-moe-decode")
y = k.qmv4(x, w_packed, scales, biases, group_size=32)

Ops: qmv4, experts_down_sum, experts_gate_up_masked, gated_delta_rule, causal_conv1d_fn, causal_conv1d_update (all torch.library.custom_ops with fakes, compile-friendly).

Downloads last month
-
kernels
metal
apache-2.0
Supported hardwares new
Metal
Apple Silicon Ultra
Apple M5 Ultra
96GB
Apple Silicon Max
Apple M5 Max
36GB
Apple Silicon Pro
Apple M5 Pro
24GB
Apple Silicon
Apple M6
16GB
Apple Silicon
Apple MacBook Neo
8GB
Apple Silicon Ultra
Apple M3 Ultra
96GB
Apple Silicon
Apple M5
16GB
Apple Silicon Max
Apple M4 Max
36GB
Apple Silicon Pro
Apple M4 Pro
24GB
Apple Silicon
Apple M4
16GB
Apple Silicon Ultra
Apple M2 Ultra
64GB
Apple Silicon Max
Apple M3 Max
36GB
Apple Silicon Max
Apple M2 Max
32GB
Apple Silicon Pro
Apple M3 Pro
18GB
Apple Silicon Pro
Apple M2 Pro
16GB
Apple Silicon
Apple M3
8GB
Apple Silicon Ultra
Apple M1 Ultra
16GB
Apple Silicon
Apple M2
8GB
Apple Silicon Max
Apple M1 Max
16GB
Apple Silicon Pro
Apple M1 Pro
16GB
Apple Silicon
Apple M1
8GB