MichaelAnthony commited on
Commit
9f56eae
·
verified ·
1 Parent(s): 5cf81eb

Keep vision/audio towers dense (fix image understanding)

Browse files
README.md CHANGED
@@ -35,19 +35,23 @@ tokenizer needed by MLX-VLM.
35
 
36
  ## What is quantized
37
 
38
- - **527 linear and embedding layers** (`q/k/v/o` projections, MLP gate/up/down,
39
- multimodal projectors, and the large embeddings) are 4-bit affine quantized:
40
- packed `uint32` `weight` (8 values per word, low nibble first) + float16
41
- `scales`/`biases`.
42
- - **Layer norms, convolutions, and biases stay float16** — matching MLX-VLM's
43
- standard affine quantization. The dense per-layer input embedding
44
- (`embed_tokens_per_layer`) **is** quantized here, so the package stays under
45
- ~2.9 GB rather than the ~7 GB a dense embedding would force.
 
 
 
 
46
 
47
  ## Package contents
48
 
49
- - `model-00001-of-00001.safetensors` (2,894,953,598 bytes): the 4-bit MLX model
50
- in a single shard (~2.9 GB total).
51
  - `model.safetensors.index.json`: complete shard map.
52
  - `config.json` (with `quantization` + `quantization_config`), `generation_config.json`,
53
  `processor_config.json`, tokenizer files, and `chat_template.jinja`.
@@ -57,13 +61,12 @@ tokenizer needed by MLX-VLM.
57
  The conversion host has no Apple-Silicon MLX runtime, so the quantized package
58
  was structurally validated before upload:
59
 
60
- - 1,951 source tensors mapped with no missing or extra keys; 527 linear +
61
- embedding layers quantized.
62
  - Quantized weight format matches the MLX affine contract: 4-bit values packed
63
  8-per-`uint32` (low nibble first), dequantization `scale * q + bias`, group 64.
64
- - Round-trip dequantization of sampled layers (attention projections + the
65
- 2.35B-param `embed_tokens_per_layer`) reproduces the source weights to within
66
- 4-bit precision (max relative error ≈ 5%).
67
 
68
  **Apple-Silicon MLX-VLM inference has not been run.** Treat this as a
69
  structurally validated quantization pending a real Apple-Silicon text / image /
 
35
 
36
  ## What is quantized
37
 
38
+ - **280 language-model layers** (`q/k/v/o` projections, MLP gate/up/down,
39
+ the multimodal embedding projections, and the large embeddings) are 4-bit
40
+ affine quantized: packed `uint32` `weight` (8 values per word, low nibble
41
+ first) + float16 `scales`/`biases`.
42
+ - **The vision tower and audio tower are left in float16 (dense)** — matching
43
+ MLX-VLM's `convert --quantize`, which skips multimodal modules. Their QAT
44
+ `ClippableLinear` layers carry input/output clipping parameters
45
+ (`input_max`/`input_min`/`output_max`/`output_min`) that must not be
46
+ affine-quantized, so they stay dense and are loaded as regular `nn.Linear`.
47
+ - The dense per-layer input embedding (`embed_tokens_per_layer`) **is**
48
+ quantized here, so the language model stays compact without exceeding the
49
+ Metal buffer cap.
50
 
51
  ## Package contents
52
 
53
+ - `model-00001-of-00001.safetensors` (3,550,670,830 bytes): the 4-bit MLX model
54
+ in a single shard (~3.55 GB total).
55
  - `model.safetensors.index.json`: complete shard map.
56
  - `config.json` (with `quantization` + `quantization_config`), `generation_config.json`,
57
  `processor_config.json`, tokenizer files, and `chat_template.jinja`.
 
61
  The conversion host has no Apple-Silicon MLX runtime, so the quantized package
62
  was structurally validated before upload:
63
 
64
+ - 1,951 source tensors mapped with no missing or extra keys; 280 language-model
65
+ layers quantized; vision/audio towers left dense.
66
  - Quantized weight format matches the MLX affine contract: 4-bit values packed
67
  8-per-`uint32` (low nibble first), dequantization `scale * q + bias`, group 64.
68
+ - Round-trip dequantization of sampled layers reproduces the source weights to
69
+ within 4-bit precision.
 
70
 
71
  **Apple-Silicon MLX-VLM inference has not been run.** Treat this as a
72
  structurally validated quantization pending a real Apple-Silicon text / image /
model-00001-of-00001.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:48ce7e8977c31fba22b0920b8462e6a7b7d7f94b76902e10f723430c9a88bcd8
3
- size 2894953598
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38de6d49e4d9cf80c90e5d739705f7bcebeeb29f851a3e30c8e78d7982eaeb13
3
+ size 3550670830
model.safetensors.index.json CHANGED
The diff for this file is too large to render. See raw diff