meenchen commited on
Commit
880c740
·
1 Parent(s): e935c3c

upload model card

Browse files
Files changed (1) hide show
  1. README.md +181 -0
README.md CHANGED
@@ -1,3 +1,184 @@
1
  ---
 
 
 
2
  license: mit
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ pipeline_tag: text-generation
3
+ base_model:
4
+ - deepseek-ai/DeepSeek-R1-0528
5
  license: mit
6
+ library_name: Model Optimizer
7
+ tags:
8
+ - nvidia
9
+ - ModelOpt
10
+ - DeepSeekR1
11
+ - quantized
12
+ - FP4
13
  ---
14
+ # Model Overview
15
+
16
+ ## Description:
17
+ 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-0528). The NVIDIA DeepSeek R1 FP4 model is quantized with [TensorRT Model Optimizer](https://github.com/NVIDIA/TensorRT-Model-Optimizer).
18
+
19
+ This model is ready for commercial/non-commercial use. <br>
20
+
21
+ ## Third-Party Community Consideration
22
+ 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-0528).
23
+
24
+ ### License/Terms of Use:
25
+ [MIT](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/mit.md)
26
+
27
+
28
+ ## Model Architecture:
29
+ **Architecture Type:** Transformers <br>
30
+ **Network Architecture:** DeepSeek R1 <br>
31
+
32
+ ## Input:
33
+ **Input Type(s):** Text <br>
34
+ **Input Format(s):** String <br>
35
+ **Input Parameters:** 1D (One Dimensional): Sequences <br>
36
+ **Other Properties Related to Input:** DeepSeek recommends adhering to the following configurations when utilizing the DeepSeek-R1 series models, including benchmarking, to achieve the expected performance: \
37
+
38
+ - Set the temperature within the range of 0.5-0.7 (0.6 is recommended) to prevent endless repetitions or incoherent outputs.
39
+ - Avoid adding a system prompt; all instructions should be contained within the user prompt.
40
+ - For mathematical problems, it is advisable to include a directive in your prompt such as: "Please reason step by step, and put your final answer within \boxed{}."
41
+ - When evaluating model performance, it is recommended to conduct multiple tests and average the results. <br>
42
+
43
+ ## Output:
44
+ **Output Type(s):** Text <br>
45
+ **Output Format:** String <br>
46
+ **Output Parameters:** 1D (One Dimensional): Sequences <br>
47
+
48
+ ## Software Integration:
49
+ **Supported Runtime Engine(s):** <br>
50
+ * Tensor(RT)-LLM <br>
51
+
52
+ **Supported Hardware Microarchitecture Compatibility:** <br>
53
+ * NVIDIA Blackwell <br>
54
+
55
+ **Preferred Operating System(s):** <br>
56
+ * Linux <br>
57
+
58
+ ## Model Version(s):
59
+ ** The model is quantized with nvidia-modelopt **v0.3123.0** <br>
60
+
61
+ ## Training Dataset: <br>
62
+ ** Data Collection Method by dataset: Hybrid: Human, Automated <br>
63
+ ** Labeling Method by dataset: Hybrid: Human, Automated <br>
64
+
65
+ ## Testing Dataset: <br>
66
+ ** Data Collection Method by dataset: Hybrid: Human, Automated <br>
67
+ ** Labeling Method by dataset: Hybrid: Human, Automated <br>
68
+
69
+ ## Evaluation Dataset: <br>
70
+ ** Data Collection Method by dataset: Hybrid: Human, Automated <br>
71
+ ** Labeling Method by dataset: Hybrid: Human, Automated <br>
72
+
73
+ ## Calibration Datasets:
74
+ * Calibration Dataset: [cnn_dailymail](https://huggingface.co/datasets/abisee/cnn_dailymail) <br>
75
+ ** Data collection method: Automated. <br>
76
+ ** Labeling method: Unknown. <br>
77
+ * Evaluation Dataset: [MMLU](https://github.com/hendrycks/test) <br>
78
+ ** Data collection method: Unknown. <br>
79
+ ** Labeling method: N/A. <br>
80
+
81
+
82
+ ## Inference:
83
+ **Engine:** Tensor(RT)-LLM <br>
84
+ **Test Hardware:** B200 <br>
85
+
86
+ ## Post Training Quantization
87
+ 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.
88
+
89
+ ## Usage
90
+
91
+ ### Deploy with TensorRT-LLM
92
+
93
+ 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):
94
+
95
+ * LLM API sample usage:
96
+ ```
97
+ from tensorrt_llm import SamplingParams
98
+ from tensorrt_llm._torch import LLM
99
+
100
+ def main():
101
+
102
+ prompts = [
103
+ "Hello, my name is",
104
+ "The president of the United States is",
105
+ "The capital of France is",
106
+ "The future of AI is",
107
+ ]
108
+ sampling_params = SamplingParams(max_tokens=32)
109
+
110
+ llm = LLM(model="nvidia/DeepSeek-R1-0528-FP4", tensor_parallel_size=8, enable_attention_dp=True)
111
+
112
+ outputs = llm.generate(prompts, sampling_params)
113
+
114
+ # Print the outputs.
115
+ for output in outputs:
116
+ prompt = output.prompt
117
+ generated_text = output.outputs[0].text
118
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
119
+
120
+
121
+ # The entry point of the program need to be protected for spawning processes.
122
+ if __name__ == '__main__':
123
+ main()
124
+
125
+ ```
126
+
127
+ ### Evaluation
128
+ The accuracy benchmark results are presented in the table below:
129
+ <table>
130
+ <tr>
131
+ <td><strong>Precision</strong>
132
+ </td>
133
+ <td><strong>MMLU-Pro</strong>
134
+ </td>
135
+ <td><strong>GPQA Diamond</strong>
136
+ </td>
137
+ <td><strong>HLE</strong>
138
+ </td>
139
+ <td><strong>LiveCodeBench</strong>
140
+ </td>
141
+ <td><strong>AIME2024</strong>
142
+ </td>
143
+ </tr>
144
+ <tr>
145
+ <td>FP8
146
+ </td>
147
+ <td>85.0
148
+ </td>
149
+ <td>81.0
150
+ </td>
151
+ <td>17.7
152
+ </td>
153
+ <td>73.3
154
+ </td>
155
+ <td>91.4
156
+ </td>
157
+ </tr>
158
+ <tr>
159
+ <td>FP4
160
+ </td>
161
+ <td>X
162
+ </td>
163
+ <td>X
164
+ </td>
165
+ <td>X
166
+ </td>
167
+ <td>X
168
+ </td>
169
+ <td>X
170
+ </td>
171
+ </tr>
172
+ <tr>
173
+ </table>
174
+
175
+ ## Model Limitations:
176
+ The base model was trained on data that contains toxic language and societal biases originally crawled from the internet. Therefore, the model may amplify those biases and return toxic responses especially when prompted with toxic prompts. The model may generate answers that may be inaccurate, omit key information, or include irrelevant or redundant text producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive.
177
+
178
+ ## Ethical Considerations
179
+
180
+ 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.
181
+
182
+ Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
183
+
184
+