WAS commited on
Commit
700763d
·
verified ·
1 Parent(s): 13d5b49

Add Qwen3 32B w4a8 and w6a8

Browse files
Qwen3-32B/NOTICE.md CHANGED
@@ -1,25 +1,42 @@
1
  # Notice
2
 
3
- `qwen3_32b_int8_convrot.safetensors` is a modified copy of Qwen3-32B.
 
4
 
5
  | | |
6
  |---|---|
7
  | Work | Qwen3-32B, by the Qwen team, Alibaba Cloud |
8
  | Source | https://huggingface.co/Qwen/Qwen3-32B, revision `9216db5781bf21249d130ec9da846c4624c16137` |
9
  | Licence | Apache License 2.0, in [`LICENSE`](LICENSE). Copyright 2024 Alibaba Cloud |
10
- | Modified by | WAS, 2026-10-27 |
11
 
12
- ## Changes
13
 
14
- - The 17 `model-*.safetensors` shards are joined into one file. Tensor names are unchanged.
15
- - Every linear layer in the 64 transformer layers (`q_proj`, `k_proj`, `v_proj`, `o_proj`,
16
- `gate_proj`, `up_proj`, `down_proj`), the embedding `model.embed_tokens` and the output layer
17
- `lm_head` are quantized to int8: each row is rotated by a 256-wide Hadamard block, then rounded
18
- to the nearest of 255 levels scaled by the row's largest magnitude. Each layer stores
19
- `weight` (int8), `weight_scale` (float32, one per row) and a `comfy_quant` tag reading
20
  `{"format": "int8_tensorwise", "convrot": true, "convrot_groupsize": 256}`.
21
  - `input_layernorm`, `post_attention_layernorm`, `q_norm`, `k_norm` and the final `norm` are
22
  kept in bfloat16 as released.
23
  - The tokenizer and configuration files are not included; ComfyUI supplies the Qwen tokenizer.
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  No weights were trained or fine-tuned.
 
1
  # Notice
2
 
3
+ `qwen3_32b_int8_convrot.safetensors`, `qwen3_32b_w6a8.safetensors` and
4
+ `qwen3_32b_w4a8.safetensors` are modified copies of Qwen3-32B.
5
 
6
  | | |
7
  |---|---|
8
  | Work | Qwen3-32B, by the Qwen team, Alibaba Cloud |
9
  | Source | https://huggingface.co/Qwen/Qwen3-32B, revision `9216db5781bf21249d130ec9da846c4624c16137` |
10
  | Licence | Apache License 2.0, in [`LICENSE`](LICENSE). Copyright 2024 Alibaba Cloud |
11
+ | Modified by | WAS, 2026-10-27 and 2026-10-28 |
12
 
13
+ ## Changes in every file
14
 
15
+ - The 17 `model-*.safetensors` shards are joined into one file. Tensor names are unchanged,
16
+ apart from the split below.
17
+ - The embedding `model.embed_tokens` and the output layer `lm_head` are quantized to int8: each
18
+ row is rotated by a 256-wide Hadamard block, then rounded to the nearest of 255 levels scaled by
19
+ the row's largest magnitude. Each stores `weight` (int8), `weight_scale` (float32, one per row)
20
+ and a `comfy_quant` tag reading
21
  `{"format": "int8_tensorwise", "convrot": true, "convrot_groupsize": 256}`.
22
  - `input_layernorm`, `post_attention_layernorm`, `q_norm`, `k_norm` and the final `norm` are
23
  kept in bfloat16 as released.
24
  - The tokenizer and configuration files are not included; ComfyUI supplies the Qwen tokenizer.
25
 
26
+ ## The linear layers
27
+
28
+ The seven linears of each of the 64 layers (`q_proj`, `k_proj`, `v_proj`, `o_proj`,
29
+ `gate_proj`, `up_proj`, `down_proj`):
30
+
31
+ | File | Format | Stored per layer |
32
+ |---|---|---|
33
+ | `qwen3_32b_int8_convrot.safetensors` | int8, as the embedding above | `weight`, `weight_scale`, `comfy_quant` |
34
+ | `qwen3_32b_w6a8.safetensors` | 6-bit codes in groups of 32 inputs, rows rotated by a 256-wide Hadamard block; `{"format": "w6a8_int8", "group_size": 32, "convrot": true, "convrot_groupsize": 256}` | `weight`, `weight_s_channel`, `weight_s_rel` (float8), `comfy_quant` |
35
+ | `qwen3_32b_w4a8.safetensors` | 4-bit codes from a 16-entry codebook in groups of 16 inputs, rows rotated by a 256-wide Hadamard block; `{"format": "asym_w4a8_int8", "group_size": 16, "convrot": true, "convrot_groupsize": 256}` | `weight`, `weight_codebook`, `weight_s_channel`, `weight_s_rel` (float8), `comfy_quant` |
36
+
37
+ In the w6a8 and w4a8 files each `mlp.down_proj` (5,120 outputs, 25,600 inputs) is split into its
38
+ first and last 12,800 input columns, stored as `mlp.down_proj.parts.0` and
39
+ `mlp.down_proj.parts.1` and quantized separately. The layer's output is the sum of the two
40
+ halves' outputs.
41
+
42
  No weights were trained or fine-tuned.
Qwen3-32B/qwen3_32b_w4a8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8010915064353333e2f5e324d066aeeeb0690960e0fb40f2f9fb4cef33bd653
3
+ size 19132294160
Qwen3-32B/qwen3_32b_w6a8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3daea4c7bde12d439e1acdfe718481e03155d5690ca4af5a15e78c0c0a460bd
3
+ size 25958488592
README.md CHANGED
@@ -7,6 +7,8 @@ tags:
7
  - comfyui
8
  - qwen3
9
  - int8
 
 
10
  - convrot
11
  - text-generation
12
  ---
@@ -22,26 +24,40 @@ which hands a CLIP to core **Generate Text**, **Fast Generate Text** and **LLM F
22
 
23
  Put them in `ComfyUI/models/text_encoders`.
24
 
25
- | Model | File | Size | Weights | Licence |
26
- |---|---|--:|---|---|
27
- | [Qwen3 32B](https://huggingface.co/Qwen/Qwen3-32B) | [`Qwen3-32B/qwen3_32b_int8_convrot.safetensors`](Qwen3-32B/qwen3_32b_int8_convrot.safetensors) | 32.8 GB | int8 convrot | [Apache-2.0](Qwen3-32B/LICENSE), [notice](Qwen3-32B/NOTICE.md) |
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  ## Qwen3 32B
30
 
31
  Qwen's dense 32B model with its own output layer, all 64 layers, 40,960 tokens of context, and
32
  the hybrid thinking switch: Generate Text's `thinking` input turns reasoning on, and off it answers
33
- straight away.
34
 
35
- - Every linear layer, the embedding and the output layer are int8, each row rotated by a
36
- 256-wide Hadamard block before it was rounded (int8 convrot, as Comfy-Org quantizes its Qwen
37
- text encoders). Norms stay bfloat16. The mean weight error is 0.91%, the worst layer 1.09%.
38
  - Tensor names are Qwen's own (`model.layers.0.self_attn.q_proj.weight`, `lm_head.weight`), with
39
  a `comfy_quant` tag beside each quantized layer.
 
 
 
 
40
  - ComfyUI's **Load CLIP** does not read a 32B Qwen3: it takes a 5120-wide Qwen3 for Mistral 24B.
41
  **Language Model Loader** builds it on ComfyUI's own Qwen3 model.
42
- - The file is larger than a 24 GB graphics card, so part of it streams from system memory for
43
- every token. On an RTX 4090 with 96 GB of system memory, Fast Generate Text writes about 1.5
44
- tokens a second.
45
  - It reads text only. MiniMax H3's `qwen3vl_32b` text encoder is a different file: the first 50
46
  layers of Qwen3-VL 32B with no output layer, which conditions H3 and cannot write text.
47
 
@@ -50,6 +66,6 @@ Tested with ComfyUI 0.42.
50
  ## License
51
 
52
  Qwen3 32B is by the Qwen team at Alibaba Cloud and is licensed under the Apache License 2.0, a copy
53
- of which is in [`Qwen3-32B/LICENSE`](Qwen3-32B/LICENSE). The file here is modified from
54
  [Qwen/Qwen3-32B](https://huggingface.co/Qwen/Qwen3-32B) by WAS: what changed is listed in
55
  [`Qwen3-32B/NOTICE.md`](Qwen3-32B/NOTICE.md).
 
7
  - comfyui
8
  - qwen3
9
  - int8
10
+ - w4a8
11
+ - w6a8
12
  - convrot
13
  - text-generation
14
  ---
 
24
 
25
  Put them in `ComfyUI/models/text_encoders`.
26
 
27
+ | Model | File | Size | Weights | Writing speed, RTX 4090 24 GB |
28
+ |---|---|--:|---|--:|
29
+ | [Qwen3 32B](https://huggingface.co/Qwen/Qwen3-32B) | [`Qwen3-32B/qwen3_32b_w4a8.safetensors`](Qwen3-32B/qwen3_32b_w4a8.safetensors) | 19.1 GB | 4-bit weights in groups of 16, 8-bit activations | 27.6 tokens/s |
30
+ | | [`Qwen3-32B/qwen3_32b_w6a8.safetensors`](Qwen3-32B/qwen3_32b_w6a8.safetensors) | 26.0 GB | 6-bit weights in groups of 32, 8-bit activations | 3.3 tokens/s |
31
+ | | [`Qwen3-32B/qwen3_32b_int8_convrot.safetensors`](Qwen3-32B/qwen3_32b_int8_convrot.safetensors) | 32.8 GB | 8-bit weights | 1.5 tokens/s |
32
+
33
+ Speeds are Fast Generate Text's graph decode, greedy, with ComfyUI's `--reserve-vram 2`. A file
34
+ that fits on the graphics card runs from it; a larger one streams part of its weights from system
35
+ memory for every token, which is why w6a8 and int8 are slow on a 24 GB card. On a 32 GB card the
36
+ w6a8 file fits. Licence for all three: [Apache-2.0](Qwen3-32B/LICENSE),
37
+ [notice](Qwen3-32B/NOTICE.md).
38
+
39
+ | | w4a8 | w6a8 | int8 convrot |
40
+ |---|--:|--:|--:|
41
+ | Mean weight error of the layer linears | 7.3% | 2.3% | 0.91% |
42
 
43
  ## Qwen3 32B
44
 
45
  Qwen's dense 32B model with its own output layer, all 64 layers, 40,960 tokens of context, and
46
  the hybrid thinking switch: Generate Text's `thinking` input turns reasoning on, and off it answers
47
+ straight away. All three files gave the same greedy answer to the same question.
48
 
49
+ - Every layer's linears are quantized, each row rotated by a 256-wide Hadamard block before
50
+ rounding (ConvRot, as Comfy-Org quantizes its Qwen text encoders). The embedding and the output
51
+ layer are int8 in every file. Norms stay bfloat16.
52
  - Tensor names are Qwen's own (`model.layers.0.self_attn.q_proj.weight`, `lm_head.weight`), with
53
  a `comfy_quant` tag beside each quantized layer.
54
+ - In the w4a8 and w6a8 files each layer's `mlp.down_proj`, 25,600 inputs wide, is stored as two
55
+ 12,800-wide column halves, `mlp.down_proj.parts.0` and `mlp.down_proj.parts.1`, whose outputs
56
+ add up to the layer's. ComfyUI's 4-bit and 6-bit kernels take a layer up to 17,408 inputs wide.
57
+ Language Model Loader adds the halves back up.
58
  - ComfyUI's **Load CLIP** does not read a 32B Qwen3: it takes a 5120-wide Qwen3 for Mistral 24B.
59
  **Language Model Loader** builds it on ComfyUI's own Qwen3 model.
60
+ - w4a8 and w6a8 need an RTX 30 series card or newer; int8 convrot an RTX 20 series or newer.
 
 
61
  - It reads text only. MiniMax H3's `qwen3vl_32b` text encoder is a different file: the first 50
62
  layers of Qwen3-VL 32B with no output layer, which conditions H3 and cannot write text.
63
 
 
66
  ## License
67
 
68
  Qwen3 32B is by the Qwen team at Alibaba Cloud and is licensed under the Apache License 2.0, a copy
69
+ of which is in [`Qwen3-32B/LICENSE`](Qwen3-32B/LICENSE). The files here are modified from
70
  [Qwen/Qwen3-32B](https://huggingface.co/Qwen/Qwen3-32B) by WAS: what changed is listed in
71
  [`Qwen3-32B/NOTICE.md`](Qwen3-32B/NOTICE.md).