File size: 3,735 Bytes
72da91f 3c66d60 72da91f cc5c84e 72da91f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
---
base_model:
- deepseek-ai/DeepSeek-V3.2
pipeline_tag: text-generation
---
## Model Details
This model is an int4 model with group_size 128 and symmetric quantization of [deepseek-ai/DeepSeek-V3.2](https://huggingface.co/deepseek-ai/DeepSeek-V3.2) generated by [intel/auto-round](https://github.com/intel/auto-round) **without algorithm tuning**. Please follow the license of the original model.
## How to Use
### Environment
```bash
git clone -b 457-ds32 https://github.com/yiliu30/transformers.git
cd transformers && pip install -e .
git clone -b ds-v32 https://github.com/intel/auto-round.git
cd auto-round && pip install .
```
###
### HF Usage
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_PATH = "Intel/DeepSeek-V3.2-int4-AutoRound"
messages = "Give me a short introduction to large language model."
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
inputs = tokenizer(
messages,
return_tensors="pt",
)
model = AutoModelForCausalLM.from_pretrained(
pretrained_model_name_or_path=MODEL_PATH,
torch_dtype=torch.bfloat16,
device_map="auto",
)
inputs = inputs.to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=512, do_sample=False)
output_text = tokenizer.decode(generated_ids[0][inputs.input_ids.shape[1] :])
print(output_text)
```
### VLLM Usage
```bash
# Prepare environment
# https://docs.vllm.ai/projects/recipes/en/latest/DeepSeek/DeepSeek-V3_2.html#launching-deepseek-v32
pip install git+https://github.com/deepseek-ai/DeepGEMM.git@v2.1.1.post3 --no-build-isolation
git clone https://github.com/vllm-project/vllm.git
cd vllm && git checkout 773d7073a
VLLM_PRECOMPILED_WHEEL_COMMIT=7f42dc20bb2800d09faa72b26f25d54e26f1b694 VLLM_USE_PRECOMPILED=1 pip install --editable .
# Start server
VLLM_ALLREDUCE_USE_SYMM_MEM=0 NCCL_NVLS_ENABLE=0 VLLM_USE_FUSED_MOE_GROUPED_TOPK=0 \
vllm serve Intel/DeepSeek-V3.2-int4-AutoRound \
--tensor-parallel-size 4 \
--tokenizer-mode deepseek_v32 \
--tool-call-parser deepseek_v32 \
--enable-auto-tool-choice \
--reasoning-parser deepseek_v3
```
## Generate the Model
```bash
git clone -b ds-v32 https://github.com/intel/auto-round.git
cd auto-round/ds32
python quant_ds_v32.py --model_name deepseek-ai/DeepSeek-V3.2 --output_dir DeepSeek-V3.2-int4-autoround
```
## Ethical Considerations and Limitations
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.
Therefore, before deploying any applications of the model, developers should perform safety testing.
## Caveats and Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
Here are a couple of useful links to learn more about Intel's AI software:
- [Intel Neural Compressor](https://github.com/intel/neural-compressor)
- [AutoRound](https://github.com/intel/auto-round)
## Disclaimer
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.
## Cite
```
@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} }
[arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)
``` |