zhiyucheng commited on
Commit
4daeb23
·
1 Parent(s): 32a067e

add model card

Browse files
Files changed (1) hide show
  1. README.md +148 -1
README.md CHANGED
@@ -1,3 +1,150 @@
1
  ---
2
- license: mit
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model:
3
+ - deepseek-ai/DeepSeek-R1
4
  ---
5
+ # Model Overview
6
+
7
+ ## Description:
8
+ 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).
9
+
10
+ This model is ready for commercial/non-commercial use. <br>
11
+
12
+ ## Third-Party Community Consideration
13
+ 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).
14
+
15
+ ### License/Terms of Use:
16
+ [nvidia-open-model-license](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/)
17
+
18
+
19
+ ## Model Architecture:
20
+ **Architecture Type:** Transformers <br>
21
+ **Network Architecture:** DeepSeek R1 <br>
22
+
23
+ ## Input:
24
+ **Input Type(s):** Text <br>
25
+ **Input Format(s):** String <br>
26
+ **Input Parameters:** 1D (One Dimensional): Sequences <br>
27
+ **Other Properties Related to Input:** Context length up to 128K <br>
28
+
29
+ ## Output:
30
+ **Output Type(s):** Text <br>
31
+ **Output Format:** String <br>
32
+ **Output Parameters:** 1D (One Dimensional): Sequences <br>
33
+ **Other Properties Related to Output:** N/A <br>
34
+
35
+ ## Software Integration:
36
+ **Supported Runtime Engine(s):** <br>
37
+ * Tensor(RT)-LLM <br>
38
+
39
+ **Supported Hardware Microarchitecture Compatibility:** <br>
40
+ * NVIDIA Blackwell <br>
41
+
42
+ **Preferred Operating System(s):** <br>
43
+ * Linux <br>
44
+
45
+ ## Model Version(s):
46
+ The model is quantized with nvidia-modelopt **v0.23.0** <br>
47
+
48
+ ## Datasets:
49
+ * Calibration Dataset: [cnn_dailymail](https://huggingface.co/datasets/abisee/cnn_dailymail) <br>
50
+ ** Data collection method: Automated. <br>
51
+ ** Labeling method: Unknown. <br>
52
+ * Evaluation Dataset: [MMLU](https://github.com/hendrycks/test) <br>
53
+ ** Data collection method: Unknown. <br>
54
+ ** Labeling method: N/A. <br>
55
+
56
+
57
+ ## Inference:
58
+ **Engine:** Tensor(RT)-LLM <br>
59
+ **Test Hardware:** B200 <br>
60
+
61
+ ## Post Training Quantization
62
+ 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.
63
+
64
+ ## Usage
65
+
66
+ ### Deploy with TensorRT-LLM
67
+
68
+ To deploy the quantized checkpoint with [TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM) LLM API, follow the sample codes below:
69
+
70
+ * LLM API sample usage:
71
+ ```
72
+ from tensorrt_llm import LLM, SamplingParams
73
+
74
+
75
+ def main():
76
+
77
+ prompts = [
78
+ "Hello, my name is",
79
+ "The president of the United States is",
80
+ "The capital of France is",
81
+ "The future of AI is",
82
+ ]
83
+ sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
84
+
85
+ llm = LLM(model="nvidia/DeepSeek-R1-FP4")
86
+
87
+ outputs = llm.generate(prompts, sampling_params)
88
+
89
+ # Print the outputs.
90
+ for output in outputs:
91
+ prompt = output.prompt
92
+ generated_text = output.outputs[0].text
93
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
94
+
95
+
96
+ # The entry point of the program need to be protected for spawning processes.
97
+ if __name__ == '__main__':
98
+ main()
99
+
100
+ ```
101
+
102
+
103
+ * Accuracy evaluation:
104
+
105
+ 1) Prepare the MMLU dataset:
106
+ ```sh
107
+ mkdir data; wget https://people.eecs.berkeley.edu/~hendrycks/data.tar -O data/mmlu.tar
108
+ tar -xf data/mmlu.tar -C data && mv data/data data/mmlu
109
+ ```
110
+
111
+ 2) Measure MMLU:
112
+
113
+ ```sh
114
+ python examples/mmlu_llmapi.py --data_dir data/mmlu --hf_model_dir nvidia/DeepSeek-R1-FP4 --backend=pytorch
115
+ ```
116
+
117
+ * Throughputs evaluation:
118
+
119
+ Please refer to the [TensorRT-LLM benchmarking documentation](https://github.com/NVIDIA/TensorRT-LLM/tree/main/benchmarks) for details.
120
+
121
+ #### Evaluation
122
+ The accuracy (MMLU, 5-shot) benchmark results are presented in the table below:
123
+ <table>
124
+ <tr>
125
+ <td><strong>Precision</strong>
126
+ </td>
127
+ <td><strong>MMLU</strong>
128
+ </td>
129
+ </tr>
130
+ <tr>
131
+ <td>FP8
132
+ </td>
133
+ <td>90.8
134
+ </td>
135
+ </tr>
136
+ <tr>
137
+ <td>FP4
138
+ </td>
139
+ <td>86.9
140
+ </td>
141
+ </tr>
142
+ <tr>
143
+ </table>
144
+
145
+
146
+ ## Ethical Considerations
147
+
148
+ 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.
149
+
150
+ Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).