[CI] Ignore ruff D209, rejoin the docstrings it split, and silence incompatible-rule warnings (#57212)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1085b64425
commit
651a88c09a
@@ -132,8 +132,7 @@ def test_default_mm_lora_fails_with_overridden_lora_request(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
):
|
||||
"""Ensure that if the lora_request conflicts with default_mm_loras,
|
||||
we use the lora_request.
|
||||
"""
|
||||
we use the lora_request."""
|
||||
run_test(
|
||||
vllm_runner,
|
||||
audio_assets,
|
||||
|
||||
@@ -1123,8 +1123,7 @@ def test_fused_moe_lora_kernel_one_shot_early_exit(trigger, device):
|
||||
@pytest.mark.parametrize("device", DEVICES)
|
||||
def test_fused_moe_lora_kernel_zero_grid_no_crash(device):
|
||||
"""num_active_loras=0 (or num_slices=0) would otherwise launch a grid
|
||||
with a zero dimension. one-shot wrapper must short-circuit before launch.
|
||||
"""
|
||||
with a zero dimension. one-shot wrapper must short-circuit before launch."""
|
||||
torch.set_default_device(device)
|
||||
set_random_seed(0)
|
||||
num_tokens, top_k, E, max_loras, R, K, N = 8, 2, 8, 4, 16, 1024, 1024
|
||||
@@ -1186,8 +1185,7 @@ def test_fused_moe_lora_kernel_zero_grid_no_crash(device):
|
||||
def test_fused_moe_lora_kernel_rejects_bad_block_size_m(device):
|
||||
"""one-shot must surface a clear assertion when shrink_block_size_m is not
|
||||
a power of 2 / less than 16, instead of the cryptic Triton compile
|
||||
failure (`arange's range must be a power of 2`).
|
||||
"""
|
||||
failure (`arange's range must be a power of 2`)."""
|
||||
torch.set_default_device(device)
|
||||
set_random_seed(0)
|
||||
num_tokens, top_k, E, max_loras, R, K, N = 32, 2, 8, 4, 16, 1024, 1024
|
||||
|
||||
@@ -249,8 +249,7 @@ def _build_and_run_align(
|
||||
)
|
||||
def test_moe_lora_align_block_size_mixed_base_and_lora(max_loras):
|
||||
"""Regression test for issue #32235: real LoRA slot must not be skipped
|
||||
when ``active_lora_ids`` has -1 at position 0.
|
||||
"""
|
||||
when ``active_lora_ids`` has -1 at position 0."""
|
||||
out = _build_and_run_align(
|
||||
num_lora_tokens=8, num_base_tokens=8, max_loras=max_loras
|
||||
)
|
||||
@@ -289,8 +288,7 @@ def test_moe_lora_align_block_size_disabled_adapter_untouched():
|
||||
kernels. Pins the invariant protected by the ``adapter_enabled`` guard
|
||||
in ``lora_count_and_sort_expert_tokens_kernel``: without it the sort
|
||||
kernel reads uninitialized ``token_mask`` values for disabled slots and
|
||||
pollutes ``sorted_token_ids`` / ``cumsum_buffer``.
|
||||
"""
|
||||
pollutes ``sorted_token_ids`` / ``cumsum_buffer``."""
|
||||
max_loras = 1
|
||||
out = _build_and_run_align(
|
||||
num_lora_tokens=16,
|
||||
|
||||
@@ -19,8 +19,7 @@ NON_EXPERT_MODULES = ("q_proj", "k_proj", "v_proj", "o_proj", "gate")
|
||||
|
||||
def _expected_lora_modules() -> set[str]:
|
||||
"""Replicate the set ``WorkerLoRAManager._load_adapter`` would build
|
||||
from this model's ``packed_modules_mapping``.
|
||||
"""
|
||||
from this model's ``packed_modules_mapping``."""
|
||||
expected: set[str] = set(NON_EXPERT_MODULES)
|
||||
for expert in range(GLOBAL_NUM_EXPERTS):
|
||||
for proj in EXPERT_PROJECTIONS:
|
||||
@@ -43,8 +42,7 @@ def _load(lora_dir, peft_helper, *, moe_ep_spec, lora_id):
|
||||
def test_moe_lora_ep2_real_qwen3moe(qwen3moe_lora_files, ep_rank):
|
||||
"""ep_size=2 against the real Qwen3-MoE adapter: each rank's loaded
|
||||
LoRA has the right size, the right expert membership, and the
|
||||
right tensor values.
|
||||
"""
|
||||
right tensor values."""
|
||||
peft_helper = PEFTHelper.from_local_dir(
|
||||
qwen3moe_lora_files, max_position_embeddings=4096
|
||||
)
|
||||
|
||||
@@ -45,8 +45,7 @@ def _bgmv_shrink(
|
||||
inputs, lora_weight, output, seq_len_tensor, lora_indices, scaling=1.0
|
||||
):
|
||||
"""Memory-efficient shrink reference: per-LoRA matmul loop.
|
||||
output[mask] = scaling * inputs[mask] @ weight.T
|
||||
"""
|
||||
output[mask] = scaling * inputs[mask] @ weight.T"""
|
||||
exploded = torch.repeat_interleave(lora_indices, seq_len_tensor)
|
||||
for lid in exploded.unique():
|
||||
if lid < 0:
|
||||
@@ -67,8 +66,7 @@ def _bgmv_expand(
|
||||
add_inputs=False,
|
||||
):
|
||||
"""Memory-efficient expand reference: per-LoRA matmul loop.
|
||||
output[mask, offset:offset+n] (+)= inputs[mask] @ weight.T
|
||||
"""
|
||||
output[mask, offset:offset+n] (+)= inputs[mask] @ weight.T"""
|
||||
exploded = torch.repeat_interleave(lora_indices, seq_len_tensor)
|
||||
for lid in exploded.unique():
|
||||
if lid < 0:
|
||||
|
||||
@@ -877,8 +877,7 @@ def test_lora_shrink_fp8(
|
||||
quant_mode: str,
|
||||
):
|
||||
"""Test FP8 shrink kernel with per-tensor, per-channel, and block-wise
|
||||
quantization, comparing against the bf16 baseline.
|
||||
"""
|
||||
quantization, comparing against the bf16 baseline."""
|
||||
torch.set_default_device(device)
|
||||
set_random_seed(seed)
|
||||
|
||||
@@ -933,8 +932,7 @@ def test_lora_expand_fp8(
|
||||
quant_mode: str,
|
||||
):
|
||||
"""Test FP8 expand kernel with per-tensor, per-channel, and block-wise
|
||||
quantization, comparing against the bf16 baseline.
|
||||
"""
|
||||
quantization, comparing against the bf16 baseline."""
|
||||
torch.set_default_device(device)
|
||||
set_random_seed(seed)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user