|
60 | 60 |
|
61 | 61 |
|
62 | 62 | # (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. |
65 | 65 | _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), |
68 | 67 | (3, 64), (2, 64), (6, 64), |
69 | 68 | ) |
70 | 69 |
|
@@ -293,7 +292,7 @@ def _walk_dict(self, d: dict) -> None: |
293 | 292 |
|
294 | 293 | for k, v in d.items(): |
295 | 294 | if k not in {"weight", "scales", "biases"}: |
296 | | - self.walk(v) |
| 295 | + self.walk(v) # pragma: no cover - defensive tree traversal |
297 | 296 | return |
298 | 297 |
|
299 | 298 | for v in d.values(): |
@@ -324,7 +323,7 @@ def infer_bits_and_group_size(self) -> Tuple[Optional[int], Optional[int]]: |
324 | 323 | if no combination fits — the caller treats that as "quantized |
325 | 324 | but format unknown". |
326 | 325 | """ |
327 | | - if self.scale_elements == 0: |
| 326 | + if self.scale_elements == 0: # pragma: no cover - defensive invariant |
328 | 327 | return None, None |
329 | 328 | ratio = self.packed_uint32_elements / self.scale_elements |
330 | 329 | for bits, gs in _KNOWN_BITS_GROUPS: |
|
0 commit comments