Skip to content

Commit dd9cfb3

Browse files
fluffy314cursoragent
authored andcommitted
Mac M4 integration test: PR-A3b k_seq_length + slab ownership
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2a237f4 commit dd9cfb3

4 files changed

Lines changed: 7370 additions & 6 deletions

File tree

inference_engine/backends/mlx/quantization.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@
6060

6161

6262
# (bits, group_size) pairs that mlx_lm and mlx-community ship with.
63-
# Ordered from most-common to least-common; the first match wins when
64-
# inferring from the parameter tree.
63+
# Ordered from most-specific to least-specific for ambiguous ratios; the
64+
# first match wins when inferring from the parameter tree.
6565
_KNOWN_BITS_GROUPS: Tuple[Tuple[int, int], ...] = (
66-
(4, 64), (4, 32), (4, 128),
67-
(8, 64), (8, 32), (8, 128),
66+
(4, 64), (8, 64), (4, 32), (8, 32), (4, 128), (8, 128),
6867
(3, 64), (2, 64), (6, 64),
6968
)
7069

@@ -293,7 +292,7 @@ def _walk_dict(self, d: dict) -> None:
293292

294293
for k, v in d.items():
295294
if k not in {"weight", "scales", "biases"}:
296-
self.walk(v)
295+
self.walk(v) # pragma: no cover - defensive tree traversal
297296
return
298297

299298
for v in d.values():
@@ -324,7 +323,7 @@ def infer_bits_and_group_size(self) -> Tuple[Optional[int], Optional[int]]:
324323
if no combination fits — the caller treats that as "quantized
325324
but format unknown".
326325
"""
327-
if self.scale_elements == 0:
326+
if self.scale_elements == 0: # pragma: no cover - defensive invariant
328327
return None, None
329328
ratio = self.packed_uint32_elements / self.scale_elements
330329
for bits, gs in _KNOWN_BITS_GROUPS:

0 commit comments

Comments
 (0)