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,8 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""
|
||||
Structured key for identifying kernel config/autotune/benchmark cases.
|
||||
"""
|
||||
"""Structured key for identifying kernel config/autotune/benchmark cases."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""
|
||||
Configuration management for Helion kernels.
|
||||
"""Configuration management for Helion kernels.
|
||||
|
||||
This module provides centralized configuration file management for Helion custom
|
||||
operations, including naming conventions, directory resolution, and file I/O.
|
||||
|
||||
@@ -22,6 +22,7 @@ def import_all_kernels() -> list[str]:
|
||||
|
||||
Returns:
|
||||
The fully-qualified module names that were imported.
|
||||
|
||||
"""
|
||||
imported: list[str] = []
|
||||
for module_info in pkgutil.iter_modules(__path__):
|
||||
|
||||
@@ -68,7 +68,6 @@ def pick_config(args: tuple[Any, ...], config_keys: list[CaseKey]) -> CaseKey |
|
||||
the smallest num_tokens >= the input's num_tokens. If the input is
|
||||
larger than all available num_tokens, fall back to the largest.
|
||||
"""
|
||||
|
||||
if not config_keys:
|
||||
return None
|
||||
|
||||
|
||||
@@ -118,7 +118,6 @@ def pick_config(args: tuple[Any, ...], config_keys: list[CaseKey]) -> CaseKey |
|
||||
the smallest num_tokens >= the input's num_tokens. If the input is
|
||||
larger than all available num_tokens, fall back to the largest.
|
||||
"""
|
||||
|
||||
if not config_keys:
|
||||
return None
|
||||
|
||||
|
||||
@@ -94,7 +94,6 @@ def pick_config(args: tuple[Any, ...], config_keys: list[CaseKey]) -> CaseKey |
|
||||
the smallest num_tokens >= the input's num_tokens. If the input is
|
||||
larger than all available num_tokens, fall back to the largest.
|
||||
"""
|
||||
|
||||
if not config_keys:
|
||||
return None
|
||||
|
||||
|
||||
@@ -87,7 +87,6 @@ def pick_config(args: tuple[Any, ...], config_keys: list[CaseKey]) -> CaseKey |
|
||||
the smallest num_tokens >= the input's num_tokens. If the input is
|
||||
larger than all available num_tokens, fall back to the largest.
|
||||
"""
|
||||
|
||||
if not config_keys:
|
||||
return None
|
||||
|
||||
|
||||
@@ -112,7 +112,6 @@ def pick_config(args: tuple[Any, ...], config_keys: list[CaseKey]) -> CaseKey |
|
||||
the smallest num_tokens >= the input's num_tokens. If the input is
|
||||
larger than all available num_tokens, fall back to the largest.
|
||||
"""
|
||||
|
||||
if not config_keys:
|
||||
return None
|
||||
|
||||
|
||||
@@ -96,7 +96,6 @@ def pick_config(args: tuple[Any, ...], config_keys: list[CaseKey]) -> CaseKey |
|
||||
pick the smallest num_tokens >= the input's num_tokens. If the input is
|
||||
larger than all available num_tokens, fall back to the largest.
|
||||
"""
|
||||
|
||||
if not config_keys:
|
||||
return None
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""
|
||||
vLLM Helion kernel registration with pre-tuned config selection.
|
||||
"""vLLM Helion kernel registration with pre-tuned config selection.
|
||||
|
||||
This module leverages Helion's internal config selection infrastructure to use
|
||||
pre-tuned configs instead of runtime autotuning.
|
||||
@@ -164,8 +163,7 @@ class ConfiguredHelionKernel:
|
||||
return self._decorated_kernel(*args, **kwargs)
|
||||
|
||||
def _create_key_computer(self):
|
||||
"""
|
||||
Create a key computer function derived from the config picker.
|
||||
"""Create a key computer function derived from the config picker.
|
||||
|
||||
The returned function receives kernel arguments unpacked (*args) to match
|
||||
Helion's key signature (called as self._key_fn(*args)).
|
||||
@@ -412,6 +410,10 @@ def register_kernel(
|
||||
"""Register a Helion kernel with pre-tuned config selection.
|
||||
|
||||
Args:
|
||||
op_name: Name to register the op under. Defaults to the function name.
|
||||
fake_impl: Optional meta/fake implementation for tracing.
|
||||
mutates_args: Names of arguments the kernel mutates in place.
|
||||
helion_settings: Optional Helion settings override.
|
||||
config_picker: Required. Receives ``(args, config_keys)``
|
||||
where each config key is a ``dict[str, Any]`` mapping
|
||||
parameter names to values. Return the best-matching
|
||||
@@ -435,6 +437,7 @@ def register_kernel(
|
||||
"4096": (torch.randn(4096, device="cuda"), 0.5),
|
||||
"8192": (torch.randn(8192, device="cuda"), 0.5),
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
def decorator(kernel_func: Callable) -> HelionKernelWrapper:
|
||||
|
||||
@@ -60,8 +60,7 @@ def get_gpu_name(device_id: int | None = None) -> str:
|
||||
|
||||
|
||||
def canonicalize_gpu_name(name: str) -> str:
|
||||
"""
|
||||
Canonicalize GPU name for use as a platform identifier.
|
||||
"""Canonicalize GPU name for use as a platform identifier.
|
||||
|
||||
Converts to lowercase, replaces separators with underscores,
|
||||
and maps known variant names to their canonical form via _GPU_NAME_ALIASES.
|
||||
|
||||
Reference in New Issue
Block a user