wenhuach commited on
Commit
8e96186
·
verified ·
1 Parent(s): e19ad6a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +64 -1
README.md CHANGED
@@ -1,4 +1,67 @@
1
  ---
2
  base_model:
3
  - deepseek-ai/DeepSeek-V3.1
4
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  base_model:
3
  - deepseek-ai/DeepSeek-V3.1
4
+ pipeline_tag: text-generation
5
+ ---
6
+
7
+ ## Model Details
8
+
9
+ This model is an mixed int4 model with group_size 128 and symmetric quantization of [deepseek-ai/DeepSeek-V3.1](https://huggingface.co/deepseek-ai/DeepSeek-V3.1) generated by [intel/auto-round](https://github.com/intel/auto-round) **via RTN(no algorithm tuning)**.
10
+ Non expert layers are fallback to 8 bits. Please refer to Section Generate the model for more details.
11
+ Please follow the license of the original model.
12
+
13
+ ## How To Use
14
+
15
+
16
+
17
+ ### Generate the model
18
+
19
+ This pr is required if the model is fp8 and the device supports fp8 https://github.com/intel/auto-round/pull/750
20
+
21
+ ```python
22
+ import torch
23
+ from transformers import AutoModelForCausalLM, AutoTokenizer
24
+ import transformers
25
+ from auto_round import AutoRound
26
+
27
+ model_name = "deepseek-ai/DeepSeek-V3.1-Base"
28
+
29
+ layer_config = {}
30
+ for n, m in model.named_modules():
31
+ if isinstance(m, torch.nn.Linear):
32
+ if "expert" in n and "shared_experts" not in n:
33
+ layer_config[n] = {"bits": 4}
34
+ print(n, 4)
35
+ elif n != "lm_head":
36
+ layer_config[n] = {"bits": 8}
37
+ print(n, 8)
38
+
39
+ autoround = AutoRound(model_name, iters=0, layer_config=layer_config)
40
+ autoround.quantize_and_save(format="auto_round", output_dir="tmp_autoround")
41
+
42
+ ```
43
+
44
+
45
+ ## Ethical Considerations and Limitations
46
+
47
+ 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.
48
+
49
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
50
+
51
+ ## Caveats and Recommendations
52
+
53
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
54
+
55
+ Here are a couple of useful links to learn more about Intel's AI software:
56
+
57
+ - Intel Neural Compressor [link](https://github.com/intel/neural-compressor)
58
+
59
+ ## Disclaimer
60
+
61
+ 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.
62
+
63
+ ## Cite
64
+
65
+ @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} }
66
+
67
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)