--- 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) ```