Add pydocstyle to the ruff rules (#52136)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: Harry Mellor <hej.mellor@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
804e5377aa
commit
8c1557a79c
@@ -1,7 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""
|
||||
Warmup deep_gemm kernels.
|
||||
"""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.
|
||||
"""
|
||||
@@ -36,16 +35,15 @@ from vllm.utils.platform_utils import num_compute_units
|
||||
def _generate_optimal_warmup_m_values(
|
||||
max_tokens: int, n: int, device: torch.device
|
||||
) -> list[int]:
|
||||
"""
|
||||
Generate M values that cover all possible DeepGEMM kernel configurations.
|
||||
"""Generate M values that cover all possible DeepGEMM kernel configurations.
|
||||
Reference: https://github.com/deepseek-ai/DeepGEMM/blob/79f48ee15a82dd5fad5cd9beaa393c1f755e6b55/csrc/jit_kernels/heuristics/common.hpp
|
||||
|
||||
Args:
|
||||
max_tokens: Maximum number of tokens to warmup for
|
||||
n: The actual N dimension from the weight tensor
|
||||
device: The torch device to get properties from.
|
||||
"""
|
||||
|
||||
"""
|
||||
# DeepGEMM's possible block sizes
|
||||
block_ms = [64, 128, 256]
|
||||
block_ns = list(range(16, min(257, n + 1), 16))
|
||||
@@ -82,9 +80,7 @@ def _generate_optimal_warmup_m_values(
|
||||
def _extract_data_from_fused_moe_module(
|
||||
m_: torch.nn.Module,
|
||||
) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, int]:
|
||||
"""
|
||||
Extract weights, weight scales and num_topk from MoERunner module.
|
||||
"""
|
||||
"""Extract weights, weight scales and num_topk from MoERunner module."""
|
||||
assert isinstance(m_, MoERunner)
|
||||
m = m_.routed_experts
|
||||
w13 = m.w13_weight
|
||||
@@ -111,8 +107,7 @@ def _extract_data_from_fused_moe_module(
|
||||
def _deep_gemm_linear_data(
|
||||
module: torch.nn.Module,
|
||||
) -> tuple[torch.Tensor, torch.Tensor] | None:
|
||||
"""
|
||||
Return (weight, weight_scale) for a layer whose kernel stamped itself as
|
||||
"""Return (weight, weight_scale) for a layer whose kernel stamped itself as
|
||||
``deep_gemm_warmup_provider`` in ``process_weights_after_loading``, else None.
|
||||
"""
|
||||
provider = getattr(module, "deep_gemm_warmup_provider", None)
|
||||
|
||||
@@ -99,7 +99,6 @@ def compile_tilelang(jit_impl: Any, *args: Any, **kwargs: Any) -> None:
|
||||
parsed key as ``__call__`` so runtime does not report a cache miss for an
|
||||
already materialized specialization.
|
||||
"""
|
||||
|
||||
with _quiet_tilelang_warmup_logs():
|
||||
compiled = jit_impl.compile(*args, **kwargs)
|
||||
func = getattr(jit_impl, "func", None)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""
|
||||
Warmup kernels used during model execution.
|
||||
"""Warmup kernels used during model execution.
|
||||
This is useful specifically for JIT'ed kernels as we don't want JIT'ing to
|
||||
happen during model execution.
|
||||
"""
|
||||
@@ -369,8 +368,7 @@ def _run_flashinfer_autotune_dummy_runs(
|
||||
|
||||
|
||||
def flashinfer_autotune(runner: "GPUModelRunner") -> None:
|
||||
"""
|
||||
Autotune FlashInfer operations.
|
||||
"""Autotune FlashInfer operations.
|
||||
FlashInfer have many implementations for the same operation,
|
||||
autotuning runs benchmarks for each implementation and stores
|
||||
the results. The results are cached transparently and
|
||||
|
||||
@@ -18,8 +18,8 @@ logger = init_logger(__name__)
|
||||
|
||||
def qwen4_exp_qsa_triton_warmup(worker: "Worker") -> None:
|
||||
"""Warm every reachable QSA specialization: indexer decode-query-length
|
||||
profiles plus the sparse attention split-K/merge configs."""
|
||||
|
||||
profiles plus the sparse attention split-K/merge configs.
|
||||
"""
|
||||
qsa_module = sys.modules.get("vllm.models.qwen4_exp.nvidia.indexer_qsa")
|
||||
attn_module = sys.modules.get("vllm.models.qwen4_exp.nvidia.qsa")
|
||||
if qsa_module is None or attn_module is None:
|
||||
|
||||
Reference in New Issue
Block a user