yasu-oh commited on
Commit
28413b5
·
1 Parent(s): f4dfe67
Files changed (5) hide show
  1. README.md +38 -5
  2. config.json +5 -3
  3. model.safetensors.index.json +0 -0
  4. recipe.yaml +36 -2
  5. tokenizer_config.json +46 -0
README.md CHANGED
@@ -46,10 +46,44 @@ The calibration dataset consists of:
46
  ```yaml
47
  default_stage:
48
  default_modifiers:
 
 
 
 
49
  QuantizationModifier:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  targets: [Linear]
51
- ignore: ['re:.*vision.*', 're:.*audio.*', lm_head, 're:.*embed.*']
52
- scheme: NVFP4
53
  kv_cache_scheme:
54
  num_bits: 8
55
  type: float
@@ -70,13 +104,12 @@ default_stage:
70
 
71
  The quantization code and calibration preprocessing are available at:
72
 
73
- [github.com/yasu-oh/gemma-4-31b-nvfp4-quantization](https://github.com/yasu-oh/gemma-4-31b-nvfp4-quantization)
74
 
75
  The quantization run used:
76
 
77
  ```text
78
  transformers: 5.12.1
79
- compressed-tensors: 0.17.2.a20260623
80
- llmcompressor: 0.12.1.dev63+g57ed2be4
81
  ```
82
 
 
46
  ```yaml
47
  default_stage:
48
  default_modifiers:
49
+ IMatrixGatherer:
50
+ targets: [Linear]
51
+ ignore: ['re:.*vision.*', 're:.*audio.*', lm_head, 're:.*embed.*', 're:.*router.*']
52
+ weight_observer: imatrix_mse
53
  QuantizationModifier:
54
+ config_groups:
55
+ group_0:
56
+ targets: [Linear]
57
+ weights:
58
+ num_bits: 4
59
+ type: float
60
+ symmetric: true
61
+ group_size: 16
62
+ strategy: tensor_group
63
+ block_structure: null
64
+ dynamic: false
65
+ actorder: null
66
+ scale_dtype: torch.float8_e4m3fn
67
+ zp_dtype: null
68
+ observer: imatrix_mse
69
+ observer_kwargs: {strict: true}
70
+ input_activations:
71
+ num_bits: 4
72
+ type: float
73
+ symmetric: true
74
+ group_size: 16
75
+ strategy: tensor_group
76
+ block_structure: null
77
+ dynamic: local
78
+ actorder: null
79
+ scale_dtype: torch.float8_e4m3fn
80
+ zp_dtype: null
81
+ observer: static_minmax
82
+ observer_kwargs: {}
83
+ output_activations: null
84
+ format: null
85
  targets: [Linear]
86
+ ignore: ['re:.*vision.*', 're:.*audio.*', lm_head, 're:.*embed.*', 're:.*router.*']
 
87
  kv_cache_scheme:
88
  num_bits: 8
89
  type: float
 
104
 
105
  The quantization code and calibration preprocessing are available at:
106
 
107
+ [gemma4-nvfp4-quantization](https://github.com/yasu-oh/gemma4-nvfp4-quantization)
108
 
109
  The quantization run used:
110
 
111
  ```text
112
  transformers: 5.12.1
113
+ llmcompressor: 0.12.1.dev87+g9bbfd9564
 
114
  ```
115
 
config.json CHANGED
@@ -45,8 +45,10 @@
45
  "dynamic": false,
46
  "group_size": 16,
47
  "num_bits": 4,
48
- "observer": "memoryless_minmax",
49
- "observer_kwargs": {},
 
 
50
  "scale_dtype": "torch.float8_e4m3fn",
51
  "strategy": "tensor_group",
52
  "symmetric": true,
@@ -269,7 +271,7 @@
269
  "quantization_status": "compressed",
270
  "sparsity_config": {},
271
  "transform_config": {},
272
- "version": "0.17.2.a20260623"
273
  },
274
  "text_config": {
275
  "attention_bias": false,
 
45
  "dynamic": false,
46
  "group_size": 16,
47
  "num_bits": 4,
48
+ "observer": "imatrix_mse",
49
+ "observer_kwargs": {
50
+ "strict": true
51
+ },
52
  "scale_dtype": "torch.float8_e4m3fn",
53
  "strategy": "tensor_group",
54
  "symmetric": true,
 
271
  "quantization_status": "compressed",
272
  "sparsity_config": {},
273
  "transform_config": {},
274
+ "version": "0.1.dev546+g4ed496d"
275
  },
276
  "text_config": {
277
  "attention_bias": false,
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
recipe.yaml CHANGED
@@ -1,9 +1,43 @@
1
  default_stage:
2
  default_modifiers:
 
 
 
 
3
  QuantizationModifier:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  targets: [Linear]
5
- ignore: ['re:.*vision.*', 're:.*audio.*', lm_head, 're:.*embed.*']
6
- scheme: NVFP4
7
  kv_cache_scheme:
8
  num_bits: 8
9
  type: float
 
1
  default_stage:
2
  default_modifiers:
3
+ IMatrixGatherer:
4
+ targets: [Linear]
5
+ ignore: ['re:.*vision.*', 're:.*audio.*', lm_head, 're:.*embed.*', 're:.*router.*']
6
+ weight_observer: imatrix_mse
7
  QuantizationModifier:
8
+ config_groups:
9
+ group_0:
10
+ targets: [Linear]
11
+ weights:
12
+ num_bits: 4
13
+ type: float
14
+ symmetric: true
15
+ group_size: 16
16
+ strategy: tensor_group
17
+ block_structure: null
18
+ dynamic: false
19
+ actorder: null
20
+ scale_dtype: torch.float8_e4m3fn
21
+ zp_dtype: null
22
+ observer: imatrix_mse
23
+ observer_kwargs: {strict: true}
24
+ input_activations:
25
+ num_bits: 4
26
+ type: float
27
+ symmetric: true
28
+ group_size: 16
29
+ strategy: tensor_group
30
+ block_structure: null
31
+ dynamic: local
32
+ actorder: null
33
+ scale_dtype: torch.float8_e4m3fn
34
+ zp_dtype: null
35
+ observer: static_minmax
36
+ observer_kwargs: {}
37
+ output_activations: null
38
+ format: null
39
  targets: [Linear]
40
+ ignore: ['re:.*vision.*', 're:.*audio.*', lm_head, 're:.*embed.*', 're:.*router.*']
 
41
  kv_cache_scheme:
42
  num_bits: 8
43
  type: float
tokenizer_config.json CHANGED
@@ -85,6 +85,52 @@
85
  "type": "object",
86
  "x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
87
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  "soc_token": "<|channel>",
89
  "sot_token": "<|turn>",
90
  "stc_token": "<|tool_call>",
 
85
  "type": "object",
86
  "x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
87
  },
88
+ "response_template": {
89
+ "defaults": {
90
+ "role": "assistant"
91
+ },
92
+ "fields": {
93
+ "content": {
94
+ "close": [
95
+ "<turn|>",
96
+ "<|tool_response>",
97
+ "<eos>"
98
+ ],
99
+ "content": "text"
100
+ },
101
+ "thinking": {
102
+ "close": "<channel|>",
103
+ "content": "text",
104
+ "open": "<|channel>thought\n"
105
+ },
106
+ "tool_calls": {
107
+ "close": "<tool_call|>",
108
+ "content": "json",
109
+ "content_args": {
110
+ "string_delims": [
111
+ [
112
+ "<|\"|>",
113
+ "<|\"|>"
114
+ ]
115
+ ],
116
+ "unquoted_keys": true
117
+ },
118
+ "open_pattern": "<\\|tool_call>call:(?P<name>\\w+)",
119
+ "repeats": true,
120
+ "transform": {
121
+ "function": {
122
+ "arguments": "{content}",
123
+ "name": "{name}"
124
+ },
125
+ "type": "function"
126
+ }
127
+ }
128
+ },
129
+ "start_anchor": [
130
+ "<|turn>model\n",
131
+ "<tool_response|>"
132
+ ]
133
+ },
134
  "soc_token": "<|channel>",
135
  "sot_token": "<|turn>",
136
  "stc_token": "<|tool_call>",