1from vllm import LLM, SamplingParams
2from transformers import AutoTokenizer
3
4model_id = "RedHatAI/Qwen3-32B-FP8-dynamic"
5number_gpus = 1
6sampling_params = SamplingParams(temperature=0.6, top_p=0.95, top_k=20, min_p=0, max_tokens=256)
7
8messages = [
9 {"role": "user", "content": prompt}
10]
11
12tokenizer = AutoTokenizer.from_pretrained(model_id)
13
14messages = [{"role": "user", "content": "Give me a short introduction to large language model."}]
15
16prompts = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
17
18llm = LLM(model=model_id, tensor_parallel_size=number_gpus)
19
20outputs = llm.generate(prompts, sampling_params)
21
22generated_text = outputs[0].outputs[0].text
23print(generated_text)1from llmcompressor.modifiers.quantization import QuantizationModifier
2from llmcompressor.transformers import oneshot
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5# Load model
6model_stub = "Qwen/Qwen3-32B"
7model_name = model_stub.split("/")[-1]
8
9model = AutoModelForCausalLM.from_pretrained(model_stub)
10
11tokenizer = AutoTokenizer.from_pretrained(model_stub)
12
13# Configure the quantization algorithm and scheme
14recipe = QuantizationModifier(
15 ignore=["lm_head"],
16 targets="Linear",
17 scheme="FP8_dynamic",
18)
19
20# Apply quantization
21oneshot(
22 model=model,
23 recipe=recipe,
24)
25
26# Save to disk in compressed-tensors format
27save_path = model_name + "-FP8-dynamic"
28model.save_pretrained(save_path)
29tokenizer.save_pretrained(save_path)
30print(f"Model and tokenizer saved to: {save_path}")lm_eval \
--model vllm \
--model_args pretrained="RedHatAI/Qwen3-32B-FP8-dynamic",dtype=auto,gpu_memory_utilization=0.5,max_model_len=8192,enable_chunk_prefill=True,tensor_parallel_size=2 \
--tasks openllm \
--apply_chat_template\
--fewshot_as_multiturn \
--batch_size autolm_eval \
--model vllm \
--model_args pretrained="RedHatAI/Qwen3-32B-FP8-dynamic",dtype=auto,gpu_memory_utilization=0.5,max_model_len=8192,enable_chunk_prefill=True,tensor_parallel_size=2 \
--tasks mgsm \
--apply_chat_template\
--batch_size autolm_eval \
--model vllm \
--model_args pretrained="RedHatAI/Qwen3-32B-FP8-dynamic",dtype=auto,gpu_memory_utilization=0.5,max_model_len=16384,enable_chunk_prefill=True,tensor_parallel_size=2 \
--tasks leaderboard \
--apply_chat_template\
--fewshot_as_multiturn \
--batch_size auto1model_parameters:
2 model_name: RedHatAI/Qwen3-32B-FP8-dynamic
3 dtype: auto
4 gpu_memory_utilization: 0.9
5 tensor_parallel_size: 2
6 max_model_length: 40960
7 generation_parameters:
8 temperature: 0.6
9 top_k: 20
10 min_p: 0.0
11 top_p: 0.95
12 max_new_tokens: 32768lighteval vllm \
--model_args lighteval_model_arguments.yaml \
--tasks lighteval|aime24|0|0 \
--use_chat_template = truelighteval vllm \
--model_args lighteval_model_arguments.yaml \
--tasks lighteval|aime25|0|0 \
--use_chat_template = truelighteval vllm \
--model_args lighteval_model_arguments.yaml \
--tasks lighteval|math_500|0|0 \
--use_chat_template = truelighteval vllm \
--model_args lighteval_model_arguments.yaml \
--tasks lighteval|gpqa:diamond|0|0 \
--use_chat_template = truelighteval vllm \
--model_args lighteval_model_arguments.yaml \
--tasks extended|lcb:codegeneration \
--use_chat_template = true| Category | Benchmark | Qwen3-32B | Qwen3-32B-FP8-dynamic (this model) | Recovery |
|---|---|---|---|---|
| OpenLLM v1 | MMLU (5-shot) | 80.96 | 80.89 | 99.9% |
| ARC Challenge (25-shot) | 69.03 | 68.00 | 98.5% | |
| GSM-8K (5-shot, strict-match) | 87.64 | 88.32 | 100.8% | |
| Hellaswag (10-shot) | 71.10 | 71.44 | 100.5% | |
| Winogrande (5-shot) | 69.77 | 69.85 | 100.1% | |
| TruthfulQA (0-shot, mc2) | 58.63 | 59.13 | 100.9% | |
| Average | 72.86 | 72.94 | 100.1% | |
| OpenLLM v2 | MMLU-Pro (5-shot) | 54.24 | 54.78 | 101.0% |
| IFEval (0-shot) | 86.23 | 86.23 | 100.0% | |
| BBH (3-shot) | 44.29 | 43.70 | 98.7% | |
| Math-lvl-5 (4-shot) | 54.61 | 57.26 | 104.9% | |
| GPQA (0-shot) | 5.53 | 5.46 | --- | |
| MuSR (0-shot) | 7.85 | 8.81 | --- | |
| Average | 42.13 | 42.71 | 101.4% | |
| Multilingual | MGSM (0-shot) | 32.57 | ||
| Reasoning (generation) | AIME 2024 | 79.37 | 79.37 | 100.0% |
| AIME 2025 | 71.77 | 70.42 | 98.1% | |
| GPQA diamond | 66.67 | 68.69 | 103.0% | |
| Math-lvl-5 | 96.20 | 96.40 | 100.2% | |
| LiveCodeBench | 62.45 | 63.32 | 101.4% |