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
@@ -249,7 +249,8 @@ def _make_topk_ids(
|
||||
device: str = "cuda",
|
||||
) -> torch.Tensor:
|
||||
"""Generate distinct expert IDs per token with the same top-k shape as
|
||||
production routing."""
|
||||
production routing.
|
||||
"""
|
||||
router_logits = torch.randn(num_tokens, num_experts, device=device)
|
||||
_, topk_ids = torch.topk(torch.softmax(router_logits, dim=-1), k=topk, dim=-1)
|
||||
return topk_ids.to(torch.int32)
|
||||
@@ -443,7 +444,8 @@ def test_aiter_fused_moe_custom_op_registered():
|
||||
|
||||
def test_aiter_asm_moe_tkw1_custom_op_registered():
|
||||
"""The tkw1 custom op should stay registered for FP8 apply-router-weight
|
||||
paths."""
|
||||
paths.
|
||||
"""
|
||||
_assert_aiter_supported()
|
||||
import vllm._aiter_ops as aiter_ops # noqa: F401
|
||||
|
||||
@@ -453,7 +455,8 @@ def test_aiter_asm_moe_tkw1_custom_op_registered():
|
||||
|
||||
def test_aiter_fused_moe_fake_tensor_support():
|
||||
"""The fused-MoE op should preserve fake-tensor compatibility for
|
||||
torch.compile-style tracing."""
|
||||
torch.compile-style tracing.
|
||||
"""
|
||||
_assert_aiter_supported()
|
||||
import vllm._aiter_ops # noqa: F401
|
||||
|
||||
@@ -516,7 +519,8 @@ def test_aiter_moe_enablement_follows_env(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
):
|
||||
"""The fused-MoE gate should depend only on the main AITER toggle and the
|
||||
MoE-specific toggle."""
|
||||
MoE-specific toggle.
|
||||
"""
|
||||
from vllm._aiter_ops import rocm_aiter_ops
|
||||
|
||||
_assert_aiter_supported()
|
||||
@@ -547,7 +551,8 @@ def test_aiter_moe_shared_experts_enablement_follows_env(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
):
|
||||
"""Shared-expert fusion should only be enabled when the fused-MoE path is
|
||||
enabled too."""
|
||||
enabled too.
|
||||
"""
|
||||
from vllm._aiter_ops import rocm_aiter_ops
|
||||
|
||||
_assert_aiter_supported()
|
||||
@@ -688,7 +693,8 @@ def test_aiter_mxfp4_quant_scheme_support_matches_gfx950():
|
||||
@pytest.mark.skipif(not on_gfx950(), reason="gfx950 ROCm only")
|
||||
def test_aiter_fused_moe_mi350_mxfp4_w4a16_accuracy():
|
||||
"""The gfx950 AITER MXFP4 W4A16 MoE path should match the dequantized
|
||||
MXFP4 reference."""
|
||||
MXFP4 reference.
|
||||
"""
|
||||
from vllm.model_executor.layers.fused_moe.activation import MoEActivation
|
||||
from vllm.model_executor.layers.fused_moe.experts.rocm_aiter_moe import (
|
||||
rocm_aiter_fused_experts,
|
||||
@@ -737,7 +743,8 @@ def test_aiter_fused_moe_mi350_mxfp4_w4a16_accuracy():
|
||||
@pytest.mark.skipif(not on_gfx950(), reason="gfx950 ROCm only")
|
||||
def test_aiter_fused_moe_mi350_mxfp4_w4a16_determinism():
|
||||
"""The gfx950 AITER MXFP4 W4A16 MoE path should stay bitwise
|
||||
deterministic."""
|
||||
deterministic.
|
||||
"""
|
||||
from vllm.model_executor.layers.fused_moe.activation import MoEActivation
|
||||
from vllm.model_executor.layers.fused_moe.experts.rocm_aiter_moe import (
|
||||
rocm_aiter_fused_experts,
|
||||
@@ -830,7 +837,8 @@ def test_aiter_fused_moe_bf16_accuracy(
|
||||
intermediate_dim: int,
|
||||
):
|
||||
"""The ROCm AITER fused-MoE BF16 path should match the float32 reference
|
||||
on representative shapes."""
|
||||
on representative shapes.
|
||||
"""
|
||||
from vllm.model_executor.layers.fused_moe.experts.rocm_aiter_moe import (
|
||||
ActivationMethod,
|
||||
QuantMethod,
|
||||
@@ -875,7 +883,8 @@ def test_aiter_fused_moe_bf16_accuracy(
|
||||
|
||||
def test_aiter_fused_moe_gelu_accuracy():
|
||||
"""The GELU activation variant should stay aligned with the float32
|
||||
reference."""
|
||||
reference.
|
||||
"""
|
||||
from vllm.model_executor.layers.fused_moe.experts.rocm_aiter_moe import (
|
||||
ActivationMethod,
|
||||
QuantMethod,
|
||||
@@ -920,7 +929,8 @@ def test_aiter_fused_moe_gelu_accuracy():
|
||||
|
||||
def test_aiter_fused_moe_determinism():
|
||||
"""The BF16 fused-MoE kernel should stay bitwise deterministic for the
|
||||
same inputs."""
|
||||
same inputs.
|
||||
"""
|
||||
from vllm.model_executor.layers.fused_moe.experts.rocm_aiter_moe import (
|
||||
ActivationMethod,
|
||||
QuantMethod,
|
||||
@@ -1075,7 +1085,8 @@ def test_aiter_fused_moe_mi3xx_bf16_accuracy():
|
||||
)
|
||||
def test_aiter_fused_moe_mi3xx_fp8_accuracy():
|
||||
"""The MI3xx FP8 per-tensor MoE path should stay within the measured FP8
|
||||
error budget."""
|
||||
error budget.
|
||||
"""
|
||||
from tests.kernels.moe.utils import make_test_weights
|
||||
from vllm._aiter_ops import rocm_aiter_ops
|
||||
from vllm.model_executor.layers.fused_moe.experts.rocm_aiter_moe import (
|
||||
|
||||
Reference in New Issue
Block a user