---
title: DeepSeek-V2-Lite-Chat-FP8-A16
canonical_url: "https://www.modelscope.cn/models/okwinds/DeepSeek-V2-Lite-Chat-FP8-A16"
md_url: "https://www.modelscope.cn/models/okwinds/DeepSeek-V2-Lite-Chat-FP8-A16.md"
repository: okwinds/DeepSeek-V2-Lite-Chat-FP8-A16
chinese_name: "DeepSeek-V2-Lite-Chat-FP8-A16 量化高精校准"
last_updated: 2024-10-22
license: other
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - deepseek_v2
architectures:
  - DeepseekV2ForCausalLM
parameters: 15.7B
tensor_type:
  - F8_E4M3
  - F32
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - Pytorch
language:
  - en
  - zh
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 230
stars: 2
tags:
  - MOE
  - Instruct
  - Chat
---

# DeepSeek-V2-Lite-Chat-FP8-A16

> DeepSeek-V2-Lite-Chat-FP8-A16 - okwinds 在 ModelScope 开源的模型。DeepSeek-V2-Lite-Chat-FP8-A16 量化高精校准

okwinds/DeepSeek-V2-Lite-Chat-FP8-A16 是 ModelScope 魔搭社区上的 15.7B 参数text-generation模型，采用 other 许可，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: okwinds/DeepSeek-V2-Lite-Chat-FP8-A16
- **License**: other
- **Tasks**: text-generation
- **Parameters**: 15.7B
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Tags**: MOE, Instruct, Chat
- **Downloads**: 230
- **Stars**: 2
- **Last updated**: 2024-10-22

Source: https://www.modelscope.cn/models/okwinds/DeepSeek-V2-Lite-Chat-FP8-A16

---

# DeepSeek-V2-Lite-Chat-FP8-A16 量化高精校准

原模型 [deepseek-ai/DeepSeek-V2-Lite-Chat](https://www.modelscope.cn/models/deepseek-ai/DeepSeek-V2-Lite-Chat)

SDK下载
```bash
#安装ModelScope
pip install modelscope
```
```python
#SDK模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('okwinds/DeepSeek-V2-Lite-Chat-FP8-A16')
```
Git下载
```
#Git模型下载
git clone https://www.modelscope.cn/okwinds/DeepSeek-V2-Lite-Chat-FP8-A16.git
```
## 模型概述

DeepSeek-V2-Lite-Chat-FP8-A16 是一个基于 [deepseek-ai/DeepSeek-V2-Lite-Chat](https://www.modelscope.cn/models/deepseek-ai/DeepSeek-V2-Lite-Chat) 的 FP8 量化模型。

- **模型名称:** DeepSeek-V2-Lite-Chat-FP8-A16
- **模型架构:** DeepSeek-V2
- **权重量化:** FP8

该模型通过将 [deepseek-ai/DeepSeek-V2-Lite-Chat](https://www.modelscope.cn/models/deepseek-ai/DeepSeek-V2-Lite-Chat) 的权重量化为 FP8 数据类型而实现。

量化过程将每个参数从 16bit 减少到 8bit，将模型占用磁盘空间大小，以及推理时加载模型需要的GPU显存空间，减少到了大约为原模型的1/2。

FP8（Floating Point 8-bit）是一种8位浮点数数据格式，由Nvidia、Arm、Intel联合推出，旨在加速深度学习的训练和推理过程。
本模型的量化，采用 F8_E4M3 数据类型仅对 transformer 中的 Linear 层权重进行 static 量化，其他层均保持为原模型数据类型，采用混合精度的计算方式，尽可能减少模型量化后所带来的精度损失。
并且，在量化过程中，进行了数据校准，以进一步提升模型生成精度。

> <span style="color: red;">注意：本模型需要 compute capability > 8.0（Ampere、Ada Lovelace、Hopper 架构）的 Nvidia GPU 来支持 FP8 及**混合精度**计算。</span>

## 部署推理

#### 推荐使用 vLLM （ <span style="color: red;">version > 0.6.3.post1</span> ）

Openai api 兼容模式

```bash
>>> vllm serve "/home/gavin/llm/DeepSeek-V2-Lite-Chat-FP8-A16" --host 0.0.0.0 --port 8000 --gpu-memory-utilization 0.9 --served-model-name "DeepSeek-V2-Lite-Chat-FP8-A16"
```

## Benchmark

| Benchmark                    | [DeepSeek-V2-Lite-Chat](https://www.modelscope.cn/models/deepseek-ai/DeepSeek-V2-Lite-Chat) (原模型) | _FP8-A16 (本模型)_ | Recovery |
| ---------------------------- | -------------------- |--------------| -------- |
|**Overall**|52.09|51.72|99.29%|
|Exam|56.63|56.59|99.93%|
|Language|34.74|32.37|93.18%|
|Knowledge|45.23|45.10|99.71%|
|Understanding|75.48|74.34|98.49%|
|Coding|58.82|60.21|102.36%|
|Reasoning|42.95|42.25|98.37%|
|Instruct Follow|50.80|51.18|100.75%|
|**Exam**|-|-|-|
|C-Eval|58.67|58.28|99.34%|
|MMLU|57.56|57.07|99.15%|
|CMMLU|61.80|61.24|99.09%|
|GaokaoBench|48.48|49.79|102.70%|
|**Language**|-|-|-|
|WSC|69.23|64.42|93.05%|
|Tydiqa-goldp|15.80|15.74|99.62%|
|**Knowledge**|-|-|-|
|TriviaQA|64.62|64.58|99.94%|
|Natual Questions|25.84|25.62|99.15%|
|**Understanding**|-|-|-|
|Race-middle|78.20|77.09|98.58%|
|Race-high|72.76|71.58|98.38%|
|**Coding**|-|-|-|
|Human eval|61.22|62.44|101.99%|
|Sanitized MBPP|56.42|57.98|102.76%|
|**Reasoning**|-|-|-|
|MATH|27.24|27.58|101.25%|
|GSM8K|60.50|59.29|98.00%|
|Winogrande|60.93|59.83|98.19%|
|Hellaswag|66.81|65.95|98.71%|
|BBH|49.70|49.31|99.22%|
|TheoremQA|16.75|16.12|96.24%|
|GPQA diamond|18.69|17.68|94.60%|
|**Instruct Follow**|-|-|-|
|Prompt-level-strict-accuracy|44.36|43.81|98.76%|
|Prompt-level-strict-accuracy|54.20|55.76|102.88%|
|Prompt-level-loose-accuracy|47.32|46.77|98.84%|
|Inst-level-loose-accuracy|57.31|58.39|101.88%|
