Skip to content

Commit 2862871

Browse files
justinchubyCopilot
andcommitted
Fix remaining repo-wide lintrunner findings for green Lint gate
Follow-up to the gguf _builder.py lint fix: clears every other current lintrunner (Ruff) finding on main so the CI Lint gate is fully green, not just free of new alerts. All changes are mechanical and behavior-neutral (test files only): - _builder_test.py: RUF005 - replace list concatenation with iterable unpacking for new_shape; RUFF-FORMAT reflow of the out_proj.weight / out_proj.scales dict entries. - _config_mapping_test.py: D205 - join the wrapped docstring summary line in TestQwen35RopeInterleave onto one line so it is followed by a blank line before the description (matches the existing docstring convention elsewhere in this file); RUFF-FORMAT blank-line spacing before TestMuseGlimmerPostprocess. - _group_query_attention_test.py: RUFF-FORMAT collapse of a short multi-line assert onto one line and blank-line spacing before TestSlidingWindowSurvivesFusion. Verified with `lintrunner --all-files` (pinned ruff 0.16.2): clean. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
1 parent 4c03f47 commit 2862871

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

‎src/mobius/integrations/gguf/_builder_test.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ def _converter_reorder(tensor, dim, num_k_heads, num_v_per_k, head_dim):
11641164
shape = list(tensor.shape)
11651165
if dim < 0:
11661166
dim += len(shape)
1167-
new_shape = shape[:dim] + [num_k_heads, num_v_per_k, head_dim] + shape[dim + 1 :]
1167+
new_shape = [*shape[:dim], num_k_heads, num_v_per_k, head_dim, *shape[dim + 1 :]]
11681168
tensor = tensor.reshape(*new_shape)
11691169
perm = list(range(len(new_shape)))
11701170
perm[dim], perm[dim + 1] = perm[dim + 1], perm[dim]
@@ -1252,8 +1252,12 @@ def test_quantized_out_proj_columns_roundtrip(self):
12521252
}
12531253
blocks_per_head = n_blocks // n_v # 2
12541254
tiled = {
1255-
f"{p}out_proj.weight": self._converter_reorder(gw, 1, n_k, v_per_k, blocks_per_head),
1256-
f"{p}out_proj.scales": self._converter_reorder(gs, 1, n_k, v_per_k, blocks_per_head),
1255+
f"{p}out_proj.weight": self._converter_reorder(
1256+
gw, 1, n_k, v_per_k, blocks_per_head
1257+
),
1258+
f"{p}out_proj.scales": self._converter_reorder(
1259+
gs, 1, n_k, v_per_k, blocks_per_head
1260+
),
12571261
f"{p}out_proj.zero_points": self._converter_reorder(
12581262
gz, 1, n_k, v_per_k, blocks_per_head // 2
12591263
),

‎src/mobius/integrations/gguf/_config_mapping_test.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ def test_nextn_not_greater_than_block_count(self) -> None:
218218

219219

220220
class TestQwen35RopeInterleave:
221-
"""``rope.dimension_sections`` is M-RoPE section metadata, not a GPT-J
222-
adjacent-pair rotation signal.
221+
"""``rope.dimension_sections`` is M-RoPE section metadata, not a GPT-J adjacent-pair rotation signal.
223222
224223
Qwen3.5/3.8 rotate with split-half (NEOX) semantics. Deriving the flat
225224
``rope_interleave`` from section presence corrupts RoPE — the exported
@@ -273,6 +272,8 @@ def test_no_sections_still_not_interleaved(self) -> None:
273272
config = gguf_to_config(self._fake_model(self._base_metadata()))
274273

275274
assert config.rope_interleave is False
275+
276+
276277
class TestMuseGlimmerPostprocess:
277278
"""Muse Glimmer config postprocessing.
278279

‎src/mobius/rewrite_rules/_group_query_attention_test.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -897,9 +897,9 @@ def test_full_rotary_omits_rotary_embedding_dim(self):
897897

898898
for node in gqa_nodes:
899899
val = node.attributes.get("rotary_embedding_dim")
900-
assert val is None, (
901-
f"Unexpected rotary_embedding_dim on full-RoPE GQA node: {val}"
902-
)
900+
assert val is None, f"Unexpected rotary_embedding_dim on full-RoPE GQA node: {val}"
901+
902+
903903
class TestSlidingWindowSurvivesFusion:
904904
"""A window baked into the attention bias must reach ``local_window_size``.
905905

0 commit comments

Comments
 (0)