MichaelAnthony commited on
Commit
e5a6a4b
·
verified ·
1 Parent(s): 4e1c80a

Keep vision/audio towers dense (fix image understanding)

Browse files
README.md CHANGED
@@ -35,20 +35,24 @@ 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 6-bit affine quantized:
40
- packed `uint32` `weight` (4 values per 3 bytes, low bits 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
- ~4.2 GB rather than the ~7 GB a dense embedding would force.
 
 
 
 
46
 
47
  ## Package contents
48
 
49
- - `model-00001-of-00002.safetensors` (4,000,099,030 bytes) and
50
- `model-00002-of-00002.safetensors` (166,857,424 bytes): the 6-bit MLX model
51
- (~4.2 GB total).
52
  - `model.safetensors.index.json`: complete shard map.
53
  - `config.json` (with `quantization` + `quantization_config`), `generation_config.json`,
54
  `processor_config.json`, tokenizer files, and `chat_template.jinja`.
@@ -58,14 +62,13 @@ tokenizer needed by MLX-VLM.
58
  The conversion host has no Apple-Silicon MLX runtime, so the quantized package
59
  was structurally validated before upload:
60
 
61
- - 1,951 source tensors mapped with no missing or extra keys; 527 linear +
62
- embedding layers quantized.
63
  - Quantized weight format matches the MLX affine contract: 6-bit values packed
64
  4-per-3-bytes (24-bit little-endian word), dequantization `scale * q + bias`,
65
  group 64.
66
- - Round-trip dequantization of sampled layers (attention projections + the
67
- 2.35B-param `embed_tokens_per_layer`) reproduces the source weights to within
68
- 6-bit precision (max relative error ≈ 1.4%).
69
 
70
  **Apple-Silicon MLX-VLM inference has not been run.** Treat this as a
71
  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 6-bit
40
+ affine quantized: packed `uint32` `weight` (4 values per 3 bytes, low bits
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-00002.safetensors` (3,993,096,556 bytes) and
54
+ `model-00002-of-00002.safetensors` (715,527,930 bytes): the 6-bit MLX model
55
+ (~4.71 GB total).
56
  - `model.safetensors.index.json`: complete shard map.
57
  - `config.json` (with `quantization` + `quantization_config`), `generation_config.json`,
58
  `processor_config.json`, tokenizer files, and `chat_template.jinja`.
 
62
  The conversion host has no Apple-Silicon MLX runtime, so the quantized package
63
  was structurally validated before upload:
64
 
65
+ - 1,951 source tensors mapped with no missing or extra keys; 280 language-model
66
+ layers quantized; vision/audio towers left dense.
67
  - Quantized weight format matches the MLX affine contract: 6-bit values packed
68
  4-per-3-bytes (24-bit little-endian word), dequantization `scale * q + bias`,
69
  group 64.
70
+ - Round-trip dequantization of sampled layers reproduces the source weights to
71
+ within 6-bit precision.
 
72
 
73
  **Apple-Silicon MLX-VLM inference has not been run.** Treat this as a
74
  structurally validated quantization pending a real Apple-Silicon text / image /
model-00001-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8336e228e847c64f20cd601798c394902c0f32609adc8e9446777a50775ae6a9
3
- size 4000099030
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7904e77f1eaefe819fe83087f49aa1a7fe10f7d03e98d8a4d2d30c1b65b11591
3
+ size 3993096556
model-00002-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f344f9aab6609b5e1b29c97f6f268105292224c0a78dcc06a62b5e658d08cfab
3
- size 166857424
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f61f16dabae23782fd868f6c8ac00ccbb6df864e3bb48f12410b20991eaefd6
3
+ size 715527930
model.safetensors.index.json CHANGED
The diff for this file is too large to render. See raw diff