---
base_model:
- meta-llama/Llama-3.1-405B-Instruct
license: llama3.1
---
# Model Overview
## Description:
The NVIDIA Llama 3.1 405B Instruct FP4 model is the quantized version of the Meta's Llama 3.1 405B Instruct model, which is an auto-regressive language model that uses an optimized transformer architecture. For more information, please check [here](https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct). The NVIDIA Llama 3.1 405B Instruct FP4 model is quantized with [TensorRT Model Optimizer](https://github.com/NVIDIA/TensorRT-Model-Optimizer).
This model is ready for commercial/non-commercial use.
## Third-Party Community Consideration
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 [(Meta-Llama-3.1-405B-Instruct) Model Card](https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct).
### License/Terms of Use:
[nvidia-open-model-license](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/)
[llama3.1](https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct/blob/main/LICENSE)
## Model Architecture:
**Architecture Type:** Transformers
**Network Architecture:** Llama3.1
## Input:
**Input Type(s):** Text
**Input Format(s):** String
**Input Parameters:** 1D (One Dimensional): Sequences
**Other Properties Related to Input:** Context length up to 128K
## Output:
**Output Type(s):** Text
**Output Format:** String
**Output Parameters:** 1D (One Dimensional): Sequences
**Other Properties Related to Output:** N/A
## Software Integration:
**Supported Runtime Engine(s):**
* Tensor(RT)-LLM
**Supported Hardware Microarchitecture Compatibility:**
* NVIDIA Blackwell
**Preferred Operating System(s):**
* Linux
## Model Version(s):
The model is quantized with nvidia-modelopt **v0.23.0**
## Datasets:
* Calibration Dataset: [cnn_dailymail](https://huggingface.co/datasets/abisee/cnn_dailymail)
** Data collection method: Automated.
** Labeling method: Unknown.
## Inference:
**Engine:** Tensor(RT)-LLM
**Test Hardware:** B200
## Post Training Quantization
This model was obtained by quantizing the weights and activations of Meta-Llama-3.1-405B-Instruct 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 16 to 4, reducing the disk size and GPU memory requirements by approximately 3.5x.
## Usage
### Deploy with TensorRT-LLM
To deploy the quantized checkpoint with [TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM) LLM API, follow the sample codes below:
* LLM API sample usage:
```
from tensorrt_llm import LLM, SamplingParams
def main():
prompts = [
"Hello, my name is",
"The president of the United States is",
"The capital of France is",
"The future of AI is",
]
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
llm = LLM(model="nvidia/Llama-3.1-405B-Instruct-FP4")
outputs = llm.generate(prompts, sampling_params)
# Print the outputs.
for output in outputs:
prompt = output.prompt
generated_text = output.outputs[0].text
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
# The entry point of the program need to be protected for spawning processes.
if __name__ == '__main__':
main()
```
Please refer to the [TensorRT-LLM llm-api documentation](https://nvidia.github.io/TensorRT-LLM/llm-api/index.html) for more details.
#### Evaluation
The accuracy benchmark results are presented in the table below:
Precision | MMLU | GSM8K_COT | ARC Challenge | IFEVAL |
BF16 | 87.3 | 96.8 | 96.9 | 88.6 |
FP4 | 87.2 | 96.1 | 96.6 | 89.5 |