Skip to content

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:

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..set_default(). A single comma-separated string is accepted as well,

If specified manually, platform defaults will be appended to the lists. See KernelConfig.set_platform_defaults().

Methods:

  • compile_factors –

    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 = 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

rotary_embedding = Field(default_factory=list) class-attribute instance-attribute

Priority list for vllm.ir.ops.rotary_embedding

rotary_embedding_query_only = Field(default_factory=list) class-attribute instance-attribute

Priority list for vllm.ir.ops.rotary_embedding_query_only

_iter_op_priorities()

Yield (IrOp, priority_list) for each field, after importing platform kernels and validating each entry.

compile_factors()

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.

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. It also imports IR kernel implementations for the current platform to ensure all implementations are made available.

with_default(default, /, **kwargs) classmethod

A helper to create an IrOpPriorityConfig where fields not specified in kwargs use the given default list.

KernelConfig

Configuration for kernel selection and warmup behavior.

Methods:

Attributes:

b12x_moe_uncompressed_scales = False class-attribute instance-attribute

Decode csf-compressed NVFP4 MoE block scales at load. By default the B12X MoE backend keeps them compressed on the GPU and expands the routed experts' scales on each call, which saves memory (2.57 GiB on Qwen3.8-Flash-Next-FP4-Local) at some latency at higher batch sizes.

enable_cutedsl_warmup = True class-attribute instance-attribute

Deprecated: run legacy CuTeDSL warmup providers.

enable_flashinfer_autotune = None class-attribute instance-attribute

Benchmark FlashInfer kernel implementations during warmup and use the fastest. Enabled by default except at -O0; disable for faster startup.

enable_flashinfer_mm_encoder_autotune = False class-attribute instance-attribute

Include multimodal encoders and projectors in FlashInfer autotuning. Disabled by default because profiling can increase startup time. Requires enable_flashinfer_autotune and Model Runner V2. Skipped when skip_mm_profiling is set.

enable_jit_warmup = True class-attribute instance-attribute

If True, run JIT compile warmup during kernel warmup.

enable_rocm_aiter_gemm_warmup = False class-attribute instance-attribute

If True, run a dummy forward at every AITER tuned-GEMM token bucket up to max_num_batched_tokens during kernel warmup on ROCm, so AITER builds those kernels at startup instead of stalling the first requests that hit each bucket. Costs one dummy forward per bucket (164 at 8192 tokens).

enable_rocm_segmented_attn_autotune = False class-attribute instance-attribute

If True, autotune ROCm segmented attention during kernel warmup on RDNA GPUs.

flashinfer_sparse_mla_kernel = 'auto' class-attribute instance-attribute

Kernel of the SM100 FLASHINFER_MLA_SPARSE backend for D576 sparse MLA. Available options:

  • "auto": prims_ts for nvfp4_ds_mla, and for a per-tensor fp8 cache under DCP (decode_context_parallel_size > 1) when it can run; else trtllm-gen
  • "trtllm": trtllm-gen; nvfp4_ds_mla caches cannot use this backend
  • "prims_ts": FlashInfer's task-scheduled sparse MLA decode, also for a per-tensor fp8 cache

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.

Deprecated: vLLM IR is being removed, and this option will be removed in v0.34.0. Kernels will be selected by the platform, as for other custom ops.

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. Out-of-tree platforms can add names to the in-tree 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 with MXFP4, MXFP8, NVFP4 or BF16 experts on SM100, or MXFP4 or 128x128 block-FP8 on SM90
  • "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 (NVFP4, and MXFP8 with --all2all-backend deepep_low_latency or nixl_ep, on Blackwell; unquantized bf16/fp16 on Hopper)
  • "flashinfer_moe_ep_cutedsl": Use FlashInfer's CuTeDSL MoE-EP mega-kernel with NVFP4 or MXFP4 weights on Blackwell (SM100/SM103, where MXFP4 checkpoints are requantized to NVFP4 at load, or SM107, where MXFP4 runs with MXFP8 activations), or with block-FP8 (128x128) or MXFP4 weights on Hopper; requires 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_mega_moe": Use the AITER MegaMoE fused dispatch/GEMM/combine kernel (ROCm gfx950, requires DP+EP with a MoRI all2all backend; DeepSeek-V4 and V4.1 only)
  • "aiter_triton_mxfp4_bf16": Use the AITER Triton MXFP4 W4A16 (moe_gemm_a16w4) MoE kernel (ROCm gfx942/gfx950/gfx1250)
  • "aiter_triton_mxfp4_mxfp4": Use the AITER Triton/Gluon MXFP4 W4A4 (moe_gemm_a4w4) MoE kernel (ROCm gfx1250)
  • "aiter_triton_mxfp8_mxfp8": Use the AITER Triton MXFP8 W8A8 (moe_gemm_a8w8) MoE kernel (ROCm gfx942)
  • "flydsl": Use AMD FlyDSL kernels (ROCm only)
  • "rdna3": Use the fused RDNA3 W4A16 HIP kernel (ROCm gfx1100 only)
  • "rdna3_int4_int8": Int4 MoE decode with int8 activations per 32 values on RDNA3/RDNA3.5 (ROCm gfx11) for up to 64 tokens, Triton WNA16 otherwise; auto-selected for quantization_config.moe.activation int8_per_group_32
  • "hpc": Use HPC kernels (FP8 and Hopper only)
  • "emulation": use BF16/FP16 GEMM, dequantizing weights and running QDQ on activations.

monokernel = False class-attribute instance-attribute

If True, run decode steps on the model's specialized decode (RFC #60904), e.g. a persistent kernel covering most or all of a decoder layer. Equivalent to --additional-config '{"decode_backend": "latency_specialized"}'. Which models, hardware and parallel layouts support it is model-specific; an unsupported deployment is refused at startup.

rdna_hybrid_w4a16_prefill_dequant = 'disable' class-attribute instance-attribute

Cache a dense dequantized copy of each weight for the RDNA hybrid W4A16 linear kernel's prefill GEMM. Applies only on gfx11/gfx12 RDNA GPUs, where that kernel is selected; a no-op for every other kernel. Prefill GEMMs then run on the dense copy instead of dequantizing int4 every step, cutting TTFT by 20-25% on gfx1151 for Qwen3 and Gemma-4. Decode stays on int4, so TPOT is unchanged. The copy is ~4x the size of the int4 weight and comes out of the gpu_memory_utilization budget, leaving less room for KV cache, so it suits unified-memory parts where TTFT matters more than KV capacity. Available options:

  • "disable": Keep prefill on the int4 path (default)
  • "enable": Cache every layer's copy; startup fails if they do not fit in the budget

sparse_indexer_topk_backend = 'auto' class-attribute instance-attribute

Backend for the DSA sparse indexer top-k kernel. Available options:

  • "auto": Decode uses the pre-existing chain (cooperative -> persistent -> per_row) on CUDA and per_row on ROCm; prefill ranks BF16 logits with DeepSelect on SM100a/SM103a (except under VLLM_BATCH_INVARIANT) and uses top_k_per_row_prefill elsewhere. 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 (CUDA and ROCm)
  • "per_row": Use vLLM's top_k_per_row_decode kernel
  • "flashinfer": Use FlashInfer's top_k_ragged_transform kernel
  • "flashinfer_gvr2": Use FlashInfer's self-sampling GVR V2 top-k (top_k_varlen(backend="gvr_2")). SM100 family, fp32 logits, topk in {512, 1024, 2048}. Also routes prefill chunks of >= 1024 row-relative rows to gvr_2. Its latency depends on the logit distribution (rows with strong position skew or many ties at the k-th value are slower)
  • "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.

On SM100 decode without DCP, cooperative and persistent (including auto selecting them) read BF16 logits directly and widen scores inside the kernel, avoiding a full FP32 logits copy.

step5_attention_backend = 'native' class-attribute instance-attribute

Step5 attention backend. PrimTS supports SM100, SM103 and SM107 and handles all FP8 attention and BF16 prefill. BF16 decode uses PrimTS for MTP=3/Q=4 batches with at least 32 requests, using the padded batch size for full CUDA graphs.

_skip_none_validation(value, handler) classmethod

Skip validation if the value is None when initialization is delayed.

compile_factors()

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.

set_platform_defaults(vllm_config)

Set platform-specific defaults for the kernel config.

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.

validate_flashinfer_moe_ep_model(moe_backend, architectures)

Reject model-specific FlashInfer MoE-EP backends.

validate_moe_backend(moe_backend)

Reject names that neither vLLM nor the platform plugin provides.