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:
-
bind_passthrough_all2all_backend–Bind
all2all_backend="passthrough"to MoE backends that own their -
validate_flashinfer_moe_ep_model–Reject model-specific FlashInfer MoE-EP backends.
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
-
gelu_and_mul_sparse(list[str]) –Priority list for vllm.ir.ops.gelu_and_mul_sparse
-
rms_norm(list[str]) –Priority list for vllm.ir.ops.rms_norm
Source code in vllm/config/kernel.py
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
gelu_and_mul_sparse = Field(default_factory=list)
class-attribute
instance-attribute
¶
Priority list for vllm.ir.ops.gelu_and_mul_sparse
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_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:
-
linear_backend_per_quant(dict[str, LinearBackend] | None) –Backend overrides keyed by linear quantization scheme. Overrides take
-
moe_backend(MoEBackend) –Backend for MoE expert computation kernels. Available options:
-
sparse_indexer_topk_backend(SparseIndexerTopkBackend) –Backend for the DSA sparse indexer decode top-k kernel. Available options:
Source code in vllm/config/kernel.py
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 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | |
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)
linear_backend_per_quant = Field(default=None, min_length=1)
class-attribute
instance-attribute
¶
Backend overrides keyed by linear quantization scheme. Overrides take
precedence over linear_backend; for example,
{"nvfp4_w4a16": "humming"}.
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_moe_ep_cutedsl": Use FlashInfer's CuTeDSL MoE-EP mega-kernel with NVFP4 weights (MXFP4 checkpoints are requantized at load); requires Blackwell, expert parallelism, and NVSHMEM
- "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)
- "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)
- "rdna3": Use the fused RDNA3 W4A16 HIP kernel (ROCm gfx1100 only)
- "hpc": Use HPC kernels (FP8 and Hopper only)
- "emulation": use BF16/FP16 GEMM, dequantizing weights and running QDQ on activations.
sparse_indexer_topk_backend = 'auto'
class-attribute
instance-attribute
¶
Backend for the DSA sparse indexer decode top-k kernel. Available options:
- "auto": The pre-existing chain (cooperative -> persistent -> per_row); the other backends are opt-in
- "deep_select": Use DeepSelect kernels (SM100a/SM103a only)
- "cooperative": Use vLLM's cooperative_topk kernel
- "persistent": Use vLLM's persistent_topk kernel
- "per_row": Use vLLM's top_k_per_row_decode kernel
- "flashinfer": Use FlashInfer's top_k_ragged_transform kernel
- "torch": Use a plain torch.topk implementation (debug reference)
- "aiter": Use AITER's top_k_per_row_decode kernel (ROCm gfx950 only, requires VLLM_ROCM_USE_AITER)
Explicit values raise RuntimeError when their constraints are not met.
_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
bind_passthrough_all2all_backend(moe_backend, parallel_config)
¶
Bind all2all_backend="passthrough" to MoE backends that own their
expert-parallel communication (currently the FlashInfer MoE-EP megakernels).
Such a deployment gets passthrough when the all2all backend is left at
its default and rejects any other explicit choice; the value is meaningless
with a MoE backend that relies on the framework to communicate. The CLI does
not offer the value; the early return keeps repeated
set_platform_defaults calls idempotent.
Source code in vllm/config/kernel.py
validate_flashinfer_moe_ep_model(moe_backend, architectures)
¶
Reject model-specific FlashInfer MoE-EP backends.