weiweiz1 commited on
Commit
f7fcbf5
·
verified ·
1 Parent(s): b274fcc

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +97 -0
README.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - Qwen/Qwen3-Coder-30B-A3B-Instruct
5
+
6
+
7
+
8
+ ---
9
+
10
+
11
+ ## Model Details
12
+
13
+ This model is an int4 model with group_size 128 and symmetric quantization of [Qwen/Qwen3-Coder-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-Coder-30B-A3B-Instruct) generated by [intel/auto-round](https://github.com/intel/auto-round) algorithm.
14
+ Please follow the license of the original model.
15
+
16
+ ## How To Use
17
+
18
+
19
+ **vLLM usage**
20
+
21
+ ~~~bash
22
+ vllm serve Intel/Qwen3-Coder-30B-A3B-Instruct-int4-AutoRound --tensor-parallel-size 4 # --max-model-len 32768
23
+ ~~~
24
+
25
+ **INT4 Inference on CPU/Intel GPU/CUDA**
26
+
27
+ ~~~python
28
+ from transformers import AutoModelForCausalLM, AutoTokenizer
29
+
30
+ model_name = "Intel/Qwen3-Coder-30B-A3B-Instruct-int4-AutoRound"
31
+
32
+ # load the tokenizer and the model
33
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
34
+ model = AutoModelForCausalLM.from_pretrained(
35
+ model_name,
36
+ torch_dtype="auto",
37
+ device_map="auto"
38
+ )
39
+
40
+ # prepare the model input
41
+ prompt = "Write a quick sort algorithm."
42
+ messages = [
43
+ {"role": "user", "content": prompt}
44
+ ]
45
+ text = tokenizer.apply_chat_template(
46
+ messages,
47
+ tokenize=False,
48
+ add_generation_prompt=True,
49
+ )
50
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
51
+
52
+ # conduct text completion
53
+ generated_ids = model.generate(
54
+ **model_inputs,
55
+ max_new_tokens=65536
56
+ )
57
+ output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
58
+
59
+ content = tokenizer.decode(output_ids, skip_special_tokens=True)
60
+
61
+ print("content:", content)
62
+ """
63
+ ....will update later...
64
+ """
65
+ ~~~
66
+
67
+ ### Generate the model
68
+
69
+ Here is the sample command to reproduce the model
70
+
71
+ ~~~bash
72
+ auto-round --model Qwen/Qwen3-Coder-30B-A3B-Instruct --output_dir "./tmp_autoround" --enable_torch_compile --nsamples 512 --fp_layers mlp.gate
73
+ ~~~
74
+
75
+ ## Ethical Considerations and Limitations
76
+
77
+ 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.
78
+
79
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
80
+
81
+ ## Caveats and Recommendations
82
+
83
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
84
+
85
+ Here are a couple of useful links to learn more about Intel's AI software:
86
+
87
+ - Intel Neural Compressor [link](https://github.com/intel/neural-compressor)
88
+
89
+ ## Disclaimer
90
+
91
+ 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.
92
+
93
+ ## Cite
94
+
95
+ @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} }
96
+
97
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)