vllm.config.kernel ¶
Classes:
-
IrOpPriorityConfig–Configuration for vLLM IR op priority for dispatching/lowering during the
-
KernelConfig–Configuration for kernel selection and warmup behavior.
Functions:
-
validate_flashinfer_moe_ep_model–Reject flashinfer moe_ep backends for models that lack the FI path.
IrOpPriorityConfig ¶
Configuration for vLLM IR op priority for dispatching/lowering during the forward pass. Each member is a list of strings, which will be installed in worker init via vllm.ir.ops.
If specified manually, platform defaults will be appended to the lists. See KernelConfig.set_platform_defaults().
Methods:
-
compute_hash–Produces a hash unique to the pass configuration.
-
set_default–Permanently set the IR op priority for all op members.
-
set_priority–Context manager to set the IR op priority for all op members.
-
with_default–A helper to create an IrOpPriorityConfig where fields not specified in kwargs
Attributes:
-
fused_add_rms_norm(list[str]) –Priority list for vllm.ir.ops.fused_add_rms_norm
-
rms_norm(list[str]) –Priority list for vllm.ir.ops.rms_norm
Source code in vllm/config/kernel.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
fused_add_rms_norm = Field(default_factory=list) class-attribute instance-attribute ¶
Priority list for vllm.ir.ops.fused_add_rms_norm
rms_norm = Field(default_factory=list) class-attribute instance-attribute ¶
Priority list for vllm.ir.ops.rms_norm
_iter_op_priorities() ¶
Yield (IrOp, priority_list) for each field, after importing platform kernels and validating each entry.
Source code in vllm/config/kernel.py
compute_hash() ¶
Produces a hash unique to the pass configuration. Any new fields that affect compilation should be added to the hash. Any future fields that don't affect compilation should be excluded.
Also, manually add IR op impl UUIDs to make sure they affect the compile cache.
Source code in vllm/config/kernel.py
set_default() ¶
set_priority() ¶
Context manager to set the IR op priority for all op members. It also imports IR kernel implementations for the current platform to ensure all implementations are made available.
Source code in vllm/config/kernel.py
with_default(default, /, **kwargs) classmethod ¶
A helper to create an IrOpPriorityConfig where fields not specified in kwargs use the given default list.
Source code in vllm/config/kernel.py
KernelConfig ¶
Configuration for kernel selection and warmup behavior.
Methods:
-
compute_hash–Produces a hash unique to the pass configuration.
-
set_platform_defaults–Set platform-specific defaults for the kernel config.
Attributes:
-
enable_bf16x3_router_gemm(bool) –If True, use the experimental SM100 BF16x3 CuteDSL router GEMM.
-
enable_cutedsl_warmup(bool) –Deprecated: run legacy CuTeDSL warmup providers.
-
enable_flashinfer_autotune(bool) –If True, run FlashInfer autotuning during kernel warmup.
-
enable_jit_warmup(bool) –If True, run JIT compile warmup during kernel warmup.
-
ir_op_priority(IrOpPriorityConfig) –vLLM IR op priority for dispatching/lowering during the forward pass.
-
linear_backend(LinearBackend) –Backend for linear layer GEMM kernels. Available options:
-
moe_backend(MoEBackend) –Backend for MoE expert computation kernels. Available options:
Source code in vllm/config/kernel.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | |
enable_bf16x3_router_gemm = False class-attribute instance-attribute ¶
If True, use the experimental SM100 BF16x3 CuteDSL router GEMM.
enable_cutedsl_warmup = True class-attribute instance-attribute ¶
Deprecated: run legacy CuTeDSL warmup providers.
enable_flashinfer_autotune = None class-attribute instance-attribute ¶
If True, run FlashInfer autotuning during kernel warmup.
enable_jit_warmup = True class-attribute instance-attribute ¶
If True, run JIT compile warmup during kernel warmup.
ir_op_priority = Field(default_factory=IrOpPriorityConfig) class-attribute instance-attribute ¶
vLLM IR op priority for dispatching/lowering during the forward pass. Platform defaults appended automatically during VllmConfig.post_init.
linear_backend = 'auto' class-attribute instance-attribute ¶
Backend for linear layer GEMM kernels. Available options:
Layer types without an implementation from the requested backend use automatic selection.
- "auto": Automatically select the best backend based on model and hardware
- "cutlass": Use CUTLASS-based kernels
- "flashinfer_cutlass": Use FlashInfer with CUTLASS kernels
- "flashinfer_cutedsl": Use FlashInfer with CuTe-DSL kernels (BF16, NVFP4, MXFP8, W4A16_NVFP4)
- "flashinfer_trtllm": Use FlashInfer with TensorRT-LLM kernels
- "flashinfer_cudnn": Use FlashInfer with cuDNN kernels
- "flashinfer_b12x": Use FlashInfer b12x CuteDSL NVFP4 GEMM (SM120+)
- "b12x": Use native B12X FP8 and FP4 linear kernels on SM12x
- "marlin": Use Marlin kernels
- "triton": Use Triton-based kernels
- "deep_gemm": Use DeepGEMM kernels
- "torch": Use PyTorch native scaled_mm kernels
- "aiter": Use AMD AITer kernels (ROCm only)
- "machete": Use Machete kernels (mixed-precision)
- "fbgemm": Use FBGEMM kernels
- "conch": Use Conch mixed-precision kernels
- "exllama": Use Exllama mixed-precision kernels
- "emulation": Use slow dequant-to-BF16 emulation (for testing only)
- "xpu": Use XPU kernels
- "xpu_woq": Use XPU kernels for weight-only quantization (e.g. W8A16)
moe_backend = 'auto' class-attribute instance-attribute ¶
Backend for MoE expert computation kernels. Available options:
- "auto": Automatically select the best backend based on model and hardware
- "triton": Use Triton-based fused MoE kernels
- "batched_triton": Use batched Triton experts (moe_mmk) on the batched activation format ([E_local, max_num_tokens, K])
- "deep_gemm": Use DeepGEMM kernels (FP8 block-quantized only)
- "deep_gemm_mega_moe": Use DeepGEMM mega MoE kernels
- "cutlass": Use vLLM CUTLASS kernels
- "flashinfer_trtllm": Use FlashInfer with TRTLLM-GEN kernels
- "flashinfer_cutlass": Use FlashInfer with CUTLASS kernels
- "flashinfer_cutedsl": Use FlashInfer with CuteDSL kernels (FP4 only)
- "flashinfer_b12x": Use FlashInfer CuteDSL fused MoE for SM12x (RTX Pro 6000 / DGX Spark)
- "b12x": Use b12x FP4 MoE kernels on SM12x
- "flashinfer_moe_ep_mega_deep_gemm": Use the FlashInfer moe_ep expert-parallel mega-MoE with the DeepGEMM megakernel, which consumes an MXFP4 checkpoint verbatim (Blackwell, requires expert parallel; DeepSeek-V4 only)
- "flashinfer_moe_ep_mega_cutedsl": Same, with the CuteDSL megakernel (additionally requires NVSHMEM). The checkpoint selects the weight path: an NVFP4 checkpoint is consumed prequantized, MXFP4 weights are requantized at load
- "marlin": Use Marlin kernels (weight-only quantization)
- "humming": Use Humming Mixed Precision kernels
- "triton_unfused": Use Triton unfused MoE kernels
- "aiter": Use AMD AITer kernels (ROCm only)
- "aiter_triton_mxfp4_bf16": Use the AITER Triton MXFP4 W4A16 (moe_gemm_a16w4) MoE kernel (ROCm gfx942/gfx950/gfx1250)
- "flydsl": Use AMD FlyDSL kernels (ROCm only)
- "hpc": Use HPC kernels (FP8 and Hopper only)
- "emulation": use BF16/FP16 GEMM, dequantizing weights and running QDQ on activations.
_skip_none_validation(value, handler) classmethod ¶
Skip validation if the value is None when initialization is delayed.
Source code in vllm/config/kernel.py
compute_hash() ¶
Produces a hash unique to the pass configuration. Any new fields that affect compilation should be added to the hash. Any future fields that don't affect compilation should be excluded.
Source code in vllm/config/kernel.py
set_platform_defaults(vllm_config) ¶
Set platform-specific defaults for the kernel config.
Source code in vllm/config/kernel.py
validate_flashinfer_moe_ep_model(moe_backend, architectures) ¶
Reject flashinfer moe_ep backends for models that lack the FI path.