bdellabe commited on
Commit
447a4a0
·
verified ·
1 Parent(s): ccbaab9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -145
README.md CHANGED
@@ -4,153 +4,32 @@ base_model:
4
  - deepseek-ai/DeepSeek-R1
5
  license: mit
6
  ---
7
- # Model Overview
8
 
9
- ## Description:
10
- The NVIDIA DeepSeek R1 FP4 model is the quantized version of the DeepSeek AI's DeepSeek R1 model, which is an auto-regressive language model that uses an optimized transformer architecture. For more information, please check [here](https://huggingface.co/deepseek-ai/DeepSeek-R1). The NVIDIA DeepSeek R1 FP4 model is quantized with [TensorRT Model Optimizer](https://github.com/NVIDIA/TensorRT-Model-Optimizer).
11
 
12
- This model is ready for commercial/non-commercial use. <br>
13
-
14
- ## Third-Party Community Consideration
15
- This model is not owned or developed by NVIDIA. This model has been developed and built to a third-party’s requirements for this application and use case; see link to Non-NVIDIA [(DeepSeek R1) Model Card](https://huggingface.co/deepseek-ai/DeepSeek-R1).
16
-
17
- ### License/Terms of Use:
18
- [MIT](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/mit.md)
19
-
20
-
21
- ## Model Architecture:
22
- **Architecture Type:** Transformers <br>
23
- **Network Architecture:** DeepSeek R1 <br>
24
-
25
- ## Input:
26
- **Input Type(s):** Text <br>
27
- **Input Format(s):** String <br>
28
- **Input Parameters:** One Dimensional(1D): Sequences <br>
29
- **Other Properties Related to Input:** Context length up to 128K <br>
30
-
31
- ## Output:
32
- **Output Type(s):** Text <br>
33
- **Output Format:** String <br>
34
- **Output Parameters:** 1D: Sequences <br>
35
- **Other Properties Related to Output:** N/A <br>
36
-
37
- ## Software Integration:
38
- **Supported Runtime Engine(s):** <br>
39
- * TensorRT-LLM <br>
40
-
41
- **Supported Hardware Microarchitecture Compatibility:** <br>
42
- * NVIDIA Blackwell <br>
43
-
44
- **Preferred Operating System(s):** <br>
45
- * Linux <br>
46
-
47
- ## Model Version(s):
48
- The model is quantized with nvidia-modelopt **v0.23.0** <br>
49
-
50
- ## Datasets:
51
- * Calibration Dataset: [cnn_dailymail](https://huggingface.co/datasets/abisee/cnn_dailymail) <br>
52
- ** Data collection method: Automated. <br>
53
- ** Labeling method: Unknown. <br>
54
- * Evaluation Dataset: [MMLU](https://github.com/hendrycks/test) <br>
55
- ** Data collection method: Unknown. <br>
56
- ** Labeling method: N/A. <br>
57
-
58
-
59
- ## Inference:
60
- **Engine:** TensorRT-LLM <br>
61
- **Test Hardware:** B200 <br>
62
-
63
- ## Post Training Quantization
64
- This model was obtained by quantizing the weights and activations of DeepSeek R1 to FP4 data type, ready for inference with TensorRT-LLM. Only the weights and activations of the linear operators within transformers blocks are quantized. This optimization reduces the number of bits per parameter from 8 to 4, reducing the disk size and GPU memory requirements by approximately 1.6x.
65
-
66
- ## Usage
67
-
68
- ### Deploy with TensorRT-LLM
69
-
70
- To deploy the quantized FP4 checkpoint with [TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM) LLM API, follow the sample codes below (you need 8xB200 GPU and TensorRT LLM built from source with the latest main branch):
71
-
72
- * LLM API sample usage:
73
  ```
74
- from tensorrt_llm import SamplingParams
75
- from tensorrt_llm._torch import LLM
76
-
77
- def main():
78
-
79
- prompts = [
80
- "Hello, my name is",
81
- "The president of the United States is",
82
- "The capital of France is",
83
- "The future of AI is",
84
- ]
85
- sampling_params = SamplingParams(max_tokens=32)
86
-
87
- llm = LLM(model="nvidia/DeepSeek-R1-FP4", tensor_parallel_size=8, enable_attention_dp=True)
88
-
89
- outputs = llm.generate(prompts, sampling_params)
90
-
91
- # Print the outputs.
92
- for output in outputs:
93
- prompt = output.prompt
94
- generated_text = output.outputs[0].text
95
- print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
96
-
97
-
98
- # The entry point of the program need to be protected for spawning processes.
99
- if __name__ == '__main__':
100
- main()
101
-
102
  ```
103
 
104
- ### Evaluation
105
- The accuracy benchmark results are presented in the table below:
106
- <table>
107
- <tr>
108
- <td><strong>Precision</strong>
109
- </td>
110
- <td><strong>MMLU</strong>
111
- </td>
112
- <td><strong>GSM8K</strong>
113
- </td>
114
- <td><strong>AIME2024</strong>
115
- </td>
116
- <td><strong>GPQA Diamond</strong>
117
- </td>
118
- <td><strong>MATH-500</strong>
119
- </td>
120
- </tr>
121
- <tr>
122
- <td>FP8
123
- </td>
124
- <td>90.8
125
- </td>
126
- <td>96.3
127
- </td>
128
- <td>80.0
129
- </td>
130
- <td>69.7
131
- </td>
132
- <td>95.4
133
- </td>
134
- </tr>
135
- <tr>
136
- <td>FP4
137
- </td>
138
- <td>90.7
139
- </td>
140
- <td>96.1
141
- </td>
142
- <td>80.0
143
- </td>
144
- <td>69.2
145
- </td>
146
- <td>94.2
147
- </td>
148
- </tr>
149
- <tr>
150
- </table>
151
-
152
- ## Ethical Considerations
153
-
154
- NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
155
-
156
- Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
 
4
  - deepseek-ai/DeepSeek-R1
5
  license: mit
6
  ---
 
7
 
8
+ Results from running `vllm serve RedHatAI/DeepSeek-R1-NVFP4-FP8-BLOCK --tensor-parallel-size=4` on 4 B200s, with `python vllm/tests/evals/gsm8k/gsm8k_eval.py --port 8000`:
 
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ```
11
+ Running GSM8K evaluation: 1319 questions, 5-shot
12
+ Evaluating: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1319/1319 [01:49<00:00, 12.09it/s]
13
+
14
+ Results:
15
+ Accuracy: 0.952
16
+ Invalid responses: 0.000
17
+ Total latency: 109.097 s
18
+ Questions per second: 12.090
19
+ Total output tokens: 124914
20
+ Output tokens per second: 1144.985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  ```
22
 
23
+ Compare to results with `nvidia/DeepSeek-R1-NVFP4`
24
+ ```
25
+ Running GSM8K evaluation: 1319 questions, 5-shot
26
+ Evaluating: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1319/1319 [01:52<00:00, 11.74it/s]
27
+
28
+ Results:
29
+ Accuracy: 0.954
30
+ Invalid responses: 0.000
31
+ Total latency: 112.357 s
32
+ Questions per second: 11.739
33
+ Total output tokens: 128126
34
+ Output tokens per second: 1140.344
35
+ ```