File size: 1,248 Bytes
acbc8f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
license: other
license_name: nvidia-open-model-license
license_link: >-
  https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/
base_model:
- nvidia/Llama-3_3-Nemotron-Super-49B-v1_5
---

# Llama-3_3-Nemotron-Super-49B-v1_5-FP8-Dynamic

FP8 quantization of https://huggingface.co/nvidia/Llama-3_3-Nemotron-Super-49B-v1_5

## Creation

Created with llmcompressor using the following code:

```
import sys

from transformers import AutoTokenizer, AutoModelForCausalLM
from llmcompressor.transformers import oneshot
from llmcompressor.modifiers.quantization import QuantizationModifier

MODEL_ID = sys.argv[1]
SAVE_DIR = sys.argv[2]

# Load the model
model = AutoModelForCausalLM.from_pretrained(MODEL_ID, device_map="auto", torch_dtype="auto", local_files_only=True, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, local_files_only=True, trust_remote_code=True)

# Configure the simple PTQ quantization
recipe = QuantizationModifier(targets="Linear", scheme="FP8_DYNAMIC", ignore=["lm_head"])

# Apply the quantization algorithm.
oneshot(model=model, recipe=recipe, trust_remote_code_model=True)

# Save the model
model.save_pretrained(SAVE_DIR)
tokenizer.save_pretrained(SAVE_DIR)
```