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)
|
||||
|
||||
Reference in New Issue
Block a user