vllm.model_executor.warmup.jit_warmup
¶
Shared interfaces and tracing helpers for explicit JIT warmup keys.
Classes:
-
JitWarmupRegistry–Collect and compile JIT kernels selected during runner setup.
-
VllmJitKernel–Kernel wrapper that owns dispatch, warmup keys, and compilation.
-
WarmupChoices–Expand an explicit finite set of values in a traced warmup method.
-
WarmupIntRange–Expand integers with range semantics or a custom monotonic progression.
Functions:
-
kernel_launcher–Delegate a declarative launch specification to its backend owner.
-
zip_inputs–Group row-wise dispatch inputs that should be expanded in lockstep.
JitWarmupRegistry
¶
Collect and compile JIT kernels selected during runner setup.
Methods:
-
activate–Collect registrations made in this context.
-
capture–Collect warmup registrations made while the decorated callable runs.
-
register–Register a kernel with the active registry, if one exists.
-
warmup–Expand registrations and compile each wrapper/key pair once.
activate()
¶
Collect registrations made in this context.
capture(init_fn)
classmethod
¶
Collect warmup registrations made while the decorated callable runs.
register(kernel, *args, **kwargs)
classmethod
¶
Register a kernel with the active registry, if one exists.
warmup()
¶
Expand registrations and compile each wrapper/key pair once.
VllmJitKernel
¶
Bases: Generic[CompileKeyT], ABC
Kernel wrapper that owns dispatch, warmup keys, and compilation.
Methods:
-
compile–Compile one warmup key.
-
compile_many–Compile a batch of warmup keys, allowing backend-specific scheduling.
-
dispatch–Build one compile key from one concrete dispatch point.
-
get_warmup_keys–Return compile keys that should be warmed for this kernel.
-
register_warmup–Register this kernel with the active runner's warmup registry.
-
warmup–Compile this kernel's warmup keys.
_expand_warmup_cases(cases_fn, *args, _value_expander=_expand_warmup_values, **kwargs)
¶
Expand symbolic domains declared inside a warmup-cases method.
_get_or_compile(compile_key, *, runtime_context=None)
¶
Return a cached executor, compiling it on a monitored cache miss.
compile(compile_key)
abstractmethod
¶
Compile one warmup key.
compile_many(compile_keys)
¶
Compile a batch of warmup keys, allowing backend-specific scheduling.
dispatch(*args, **kwargs)
¶
Build one compile key from one concrete dispatch point.
get_warmup_keys(*args, **kwargs)
abstractmethod
¶
Return compile keys that should be warmed for this kernel.
register_warmup(*args, **kwargs)
¶
Register this kernel with the active runner's warmup registry.
warmup(*args, **kwargs)
¶
Compile this kernel's warmup keys.
WarmupChoices
dataclass
¶
Expand an explicit finite set of values in a traced warmup method.
WarmupIntRange
dataclass
¶
Expand integers with range semantics or a custom monotonic progression.
_WarmupInputRows
dataclass
¶
Warmup dispatch inputs expanded in lockstep.
_same_registration(left, right)
¶
True if two (args, kwargs) registrations are equivalent.
_same_value(left, right)
¶
True if two registration values are the same object or compare equal.
Identity is checked first so shared singletons (e.g. vllm_config, torch
dtypes) short-circuit before any potentially deep or non-boolean __eq__.
_validate_dispatch_expr(node)
¶
Enforce the dispatch AST subset before compiling traced code.
_when(condition)
¶
Filter symbolic cases in an AST-traced warmup-cases method.
kernel_launcher(call_fn)
¶
Delegate a declarative launch specification to its backend owner.
zip_inputs(*rows)
¶
Group row-wise dispatch inputs that should be expanded in lockstep.