MichaelAnthony commited on
Commit
5cf81eb
·
verified ·
1 Parent(s): 04ebf0e

Update README for corrected quantization (527 layers, embeddings quantized)

Browse files
Files changed (1) hide show
  1. README.md +15 -14
README.md CHANGED
@@ -35,18 +35,19 @@ tokenizer needed by MLX-VLM.
35
 
36
  ## What is quantized
37
 
38
- - **525 linear layers** (`q/k/v/o` projections, MLP gate/up/down, multimodal
39
- projectors) are 4-bit affine quantized: packed `uint32` `weight` (8 values per
40
- word, low nibble first) + float16 `scales`/`biases`.
41
- - **Embeddings, layer norms, convolutions, and biases stay float16** — matching
42
- MLX-VLM's standard Linear-only affine quantization. The large per-layer input
43
- embedding (`embed_tokens_per_layer`) is retained at full precision, so the
44
- model needs ~7 GB unified memory on Apple Silicon.
 
45
 
46
  ## Package contents
47
 
48
- - `model-00001-of-00003.safetensors` `model-00003-of-00003.safetensors`: the
49
- one 4-bit MLX model (~6.8 GB total).
50
  - `model.safetensors.index.json`: complete shard map.
51
  - `config.json` (with `quantization` + `quantization_config`), `generation_config.json`,
52
  `processor_config.json`, tokenizer files, and `chat_template.jinja`.
@@ -56,13 +57,13 @@ tokenizer needed by MLX-VLM.
56
  The conversion host has no Apple-Silicon MLX runtime, so the quantized package
57
  was structurally validated before upload:
58
 
59
- - 1,951 source tensors mapped with no missing or extra keys; 525 linear layers
60
- quantized; embeddings left dense.
61
  - Quantized weight format matches the MLX affine contract: 4-bit values packed
62
  8-per-`uint32` (low nibble first), dequantization `scale * q + bias`, group 64.
63
- - Round-trip dequantization of sampled layers (language + audio towers) reproduces
64
- the source weights to within 4-bit precision (max absolute error ≤ ~0.015).
65
- - Config matches MLX-VLM `convert --quantize` output (group_size / bits / mode).
66
 
67
  **Apple-Silicon MLX-VLM inference has not been run.** Treat this as a
68
  structurally validated quantization pending a real Apple-Silicon text / image /
 
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
  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 /