wenhuach commited on
Commit
cbccebe
·
verified ·
1 Parent(s): c78e4fd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +67 -1
README.md CHANGED
@@ -3,6 +3,18 @@ license: apache-2.0
3
  base_model:
4
  - Qwen/Qwen3-Coder-480B-A35B-Instruct
5
  ---
 
 
 
 
 
 
 
 
 
 
 
 
6
  from transformers import AutoModelForCausalLM, AutoTokenizer
7
 
8
  model_name = "Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-AutoRound"
@@ -272,4 +284,58 @@ class PostTrainingQuantizer:
272
  # Quantize weight
273
  q_weight, scale, zero_point = Quantizer.linear_quantize(
274
  weight
275
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  base_model:
4
  - Qwen/Qwen3-Coder-480B-A35B-Instruct
5
  ---
6
+
7
+ ## Model Details
8
+
9
+ This model is a mixed int4 model with group_size 64 and symmetric quantization of [Qwen/Qwen3-Coder-480B-A35B-Instruct](https://huggingface.co/Qwen3-Coder-480B-A35B-Instruct)] generated by [intel/auto-round](https://github.com/intel/auto-round) via **RTN** (no algorithm tuning). Non expert layers are fall back to 8 bits and group_size 128
10
+
11
+ Please follow the license of the original model.
12
+
13
+ ## How To Use
14
+
15
+ **INT4 Inference on CPU/Intel GPU/CUDA**
16
+
17
+ ~~~python
18
  from transformers import AutoModelForCausalLM, AutoTokenizer
19
 
20
  model_name = "Intel/Qwen3-Coder-480B-A35B-Instruct-int4-mixed-AutoRound"
 
284
  # Quantize weight
285
  q_weight, scale, zero_point = Quantizer.linear_quantize(
286
  weight
287
+ """
288
+
289
+ ~~~
290
+
291
+ ### Generate the model
292
+
293
+ Here is the sample command to reproduce the model
294
+
295
+ ```python
296
+ import torch
297
+ from transformers import AutoModelForCausalLM, AutoTokenizer
298
+ from auto_round import AutoRound
299
+
300
+ model_name = "Qwen3/Qwen3-Coder-480B-A35B-Instruct"
301
+
302
+ model = AutoModelForCausalLM.from_pretrained(model_name,
303
+ device_map="cpu", torch_dtype="auto")
304
+
305
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
306
+
307
+ layer_config = {}
308
+ for n, m in model.named_modules():
309
+ if isinstance(m, torch.nn.Linear) and (not "expert" in n or "shared_experts" in n) and n != "lm_head":
310
+ layer_config[n] = {"bits": 8, "group_size": 128}
311
+
312
+ autoround = AutoRound(model, tokenizer, iters=0, group_size=64, layer_config=layer_config)
313
+ autoround.quantize_and_save("./Qwen3-Coder-480B-A35B-Instruct-int4-mixed")
314
+
315
+ ```
316
+
317
+
318
+
319
+ ## Ethical Considerations and Limitations
320
+
321
+ The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
322
+
323
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
324
+
325
+ ## Caveats and Recommendations
326
+
327
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
328
+
329
+ Here are a couple of useful links to learn more about Intel's AI software:
330
+
331
+ - Intel Neural Compressor [link](https://github.com/intel/neural-compressor)
332
+
333
+ ## Disclaimer
334
+
335
+ The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
336
+
337
+ ## Cite
338
+
339
+ @article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
340
+
341
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)