[MyPy][3/N] Fix MyPy errors in test groups (part 3) (#55939)

Signed-off-by: Taimys <ffy2281693949@gmail.com>
Signed-off-by: Luyi Xiao <81631911+luyixiao95@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Luyi Xiao <81631911+luyixiao95@users.noreply.github.com>
Co-authored-by: Taimys <ffy2281693949@gmail.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Taimys
2026-09-30 11:06:07 +00:00
committed by GitHub
co-authored by Codex Luyi Xiao Taimys Harry Mellor Claude Opus 5.5
parent c4fa6f36a7
commit 5225f1bacb
118 changed files with 948 additions and 605 deletions
+9 -9
View File
@@ -193,7 +193,7 @@ class DummyFusedMoE:
def make_config(**overrides) -> INCConfig:
kwargs = {
kwargs: dict[str, Any] = {
"weight_bits": 4,
"group_size": 128,
"sym": True,
@@ -208,7 +208,7 @@ def make_config(**overrides) -> INCConfig:
def make_layer_config(**overrides) -> INCLayerConfig:
kwargs = {
kwargs: dict[str, Any] = {
"bits": 4,
"group_size": 128,
"sym": True,
@@ -423,7 +423,7 @@ def test_inc_get_quant_method_unquantized_routed_experts_with_model_prefix(
config = make_config(extra_config={"model.moe_layer": {"bits": 16}})
layer = object.__new__(RoutedExperts)
layer.moe_config = None
layer.moe_config = None # type: ignore[assignment] # No MoE config used by this stub.
method = config.get_quant_method(layer, "moe_layer")
@@ -730,7 +730,7 @@ def test_wna16_cuda_low_bit_moe_routes_to_humming(monkeypatch, bits) -> None:
)
layer = object.__new__(RoutedExperts)
layer.moe_config = DummyMoeConfig()
layer.moe_config = DummyMoeConfig() # type: ignore[assignment]
layer_config = make_layer_config(bits=bits)
method = INCWna16Scheme().get_moe_method(
make_config(), layer, "model.layers.0.mlp", layer_config
@@ -861,7 +861,7 @@ def test_qwen3_30b_a3b_w4a16_autoround_routes_to_gptq_moe(
config = make_qwen3_autoround_config("qwen3_30b_a3b_w4a16")
layer = object.__new__(RoutedExperts)
layer.moe_config = DummyMoeConfig()
layer.moe_config = DummyMoeConfig() # type: ignore[assignment]
method = config.get_quant_method(layer, "model.layers.0.mlp")
@@ -890,7 +890,7 @@ def test_qwen3_30b_a3b_mxfp4_autoround_routes_to_mxfp4_moe(
config = make_qwen3_autoround_config("qwen3_30b_a3b_mxfp4")
layer = object.__new__(RoutedExperts)
layer.moe_config = DummyMoeConfig()
layer.moe_config = DummyMoeConfig() # type: ignore[assignment]
ignored_method = config.get_quant_method(
object.__new__(LinearBase), "model.layers.0.self_attn.q_proj"
@@ -1186,7 +1186,7 @@ def test_wna16_xpu_moe_routes_to_gptq_moe(monkeypatch) -> None:
)
layer = object.__new__(RoutedExperts)
layer.moe_config = DummyMoeConfig()
layer.moe_config = DummyMoeConfig() # type: ignore[assignment]
method = INCWna16Scheme().get_moe_method(
make_config(),
layer,
@@ -1669,7 +1669,7 @@ def test_inc_get_quant_method_unquantized_moe_returns_unquantized(
when extra_config has bits >= 16."""
config = make_config(extra_config={"layer": {"bits": 16}})
layer = object.__new__(RoutedExperts)
layer.moe_config = None # UnquantizedFusedMoEMethod accepts moe_config
layer.moe_config = None # type: ignore[assignment] # No MoE config used by this stub.
class DummyUnquantizedFusedMoEMethod:
def __init__(self, moe_config) -> None:
@@ -2094,7 +2094,7 @@ def _with_w4a8_kernel(monkeypatch) -> None:
def _dispatch(layer_config=None):
return INCWna16Scheme().get_linear_method(
object(), object(), "layer", layer_config or make_layer_config()
make_config(), object(), "layer", layer_config or make_layer_config()
)