vllm.model_executor.warmup.deep_gemm_warmup
¶
Warmup deep_gemm kernels. DeepGEMM JIT's the kernels. The warmup aims to JIT all the kernels that would be used during model execution beforehand.
_deep_gemm_linear_data(module)
¶
Return (weight, weight_scale) for a layer whose kernel stamped itself as
deep_gemm_warmup_provider in process_weights_after_loading, else None.
Source code in vllm/model_executor/warmup/deep_gemm_warmup.py
_extract_data_from_fused_moe_module(m_)
¶
Extract weights, weight scales and num_topk from MoERunner module.
Source code in vllm/model_executor/warmup/deep_gemm_warmup.py
_generate_optimal_warmup_m_values(max_tokens, n, device)
¶
Generate M values that cover all possible DeepGEMM kernel configurations.
The block sizes must mirror the layout candidates of the vendored DeepGEMM heuristic (csrc/jit_kernels/heuristics/sm100.hpp); a stale set here lets serving-time M values select kernel configs the warmup never compiled.
Parameters:
-
(max_tokens¶int) –Maximum number of tokens to warmup for
-
(n¶int) –The actual N dimension from the weight tensor
-
(device¶device) –The torch device to get properties from.
Source code in vllm/model_executor/warmup/deep_gemm_warmup.py
_get_fp8_fp4_mega_moe_m_values(module, max_tokens)
¶
Get the M values that reach every MegaMoE kernel and, where used, bf16_mega_gate config.
Source code in vllm/model_executor/warmup/deep_gemm_warmup.py
_get_fp8_gemm_nt_m_values(w, max_tokens)
¶
Get the M values to warmup for a given weight tensor.