Views
No views yet
vllm serve RedHatAI/Qwen3-Next-80B-A3B-Thinking-FP8-dynamic --tensor_parallel_size 21from openai import OpenAI
2
3# Modify OpenAI's API key and API base to use vLLM's API server.
4openai_api_key = "EMPTY"
5openai_api_base = "http://<your-server-host>:8000/v1"
6
7client = OpenAI(
8 api_key=openai_api_key,
9 base_url=openai_api_base,
10)
11
12model = "RedHatAI/Qwen3-Next-80B-A3B-Thinking-FP8-dynamic"
13
14messages = [
15 {"role": "user", "content": "Explain quantum mechanics clearly and concisely."},
16]
17
18
19outputs = client.chat.completions.create(
20 model=model,
21 messages=messages,
22)
23
24generated_text = outputs.choices[0].message.content
25print(generated_text)1from datasets import load_dataset
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4from llmcompressor import oneshot
5from llmcompressor.modifiers.quantization import QuantizationModifier
6from llmcompressor.utils import dispatch_for_generation
7
8# NOTE: Requires a minimum of transformers 4.57.0
9
10MODEL_ID = "Qwen/Qwen3-Next-80B-A3B-Thinking"
11
12# Load model.
13model = AutoModelForCausalLM.from_pretrained(MODEL_ID, torch_dtype="auto")
14tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
15
16
17# Configure the quantization algorithm and scheme.
18# In this case, we:
19# * quantize the weights to fp8 with per channel via ptq
20# * quantize the activations to fp8 with dynamic per token
21recipe = QuantizationModifier(
22 targets="Linear", scheme="FP8_DYNAMIC", ignore=[
23 "lm_head",
24 "re:.*mlp.gate$",
25 "re:.*mlp.shared_expert_gate$",
26 "re:.*linear_attn.*",
27 ],
28)
29
30# Apply quantization.
31oneshot(model=model, recipe=recipe)
32
33# Confirm generations of the quantized model look sane.
34print("========== SAMPLE GENERATION ==============")
35dispatch_for_generation(model)
36input_ids = tokenizer("Hello my name is", return_tensors="pt").input_ids.to(
37 model.device
38)
39output = model.generate(input_ids, max_new_tokens=20)
40print(tokenizer.decode(output[0]))
41print("==========================================")
42
43# Save to disk in compressed-tensors format.
44SAVE_DIR = MODEL_ID.rstrip("/").split("/")[-1] + "-FP8-dynamic"
45model.save_pretrained(SAVE_DIR)
46tokenizer.save_pretrained(SAVE_DIR)lm_eval \
--model vllm \
--model_args pretrained="RedHatAI/Qwen3-Next-80B-A3B-Thinking-FP8-dynamic",dtype=auto,add_bos_token=True,max_model_len=16384,tensor_parallel_size=2,gpu_memory_utilization=0.9,enable_chunked_prefill=True,trust_remote_code=True \
--tasks openllm \
--write_out \
--batch_size auto \
--show_configlm_eval \
--model vllm \
--model_args pretrained="RedHatAI/Qwen3-Next-80B-A3B-Thinking-FP8-dynamic",dtype=auto,add_bos_token=False,max_model_len=16384,tensor_parallel_size=2,gpu_memory_utilization=0.7,disable_log_stats=True,enable_chunked_prefill=True,trust_remote_code=True \
--tasks leaderboard \
--apply_chat_template \
--fewshot_as_multiturn \
--write_out \
--batch_size auto \
--show_configevalplus.evaluate --model "RedHatAI/Qwen3-Next-80B-A3B-Thinking-FP8-dynamic" \
--dataset "humaneval" \
--backend vllm \
--tp 2 \
--greedy
evalplus.evaluate --model "RedHatAI/Qwen3-Next-80B-A3B-Thinking-FP8-dynamic" \
--dataset "mbpp" \
--backend vllm \
--tp 2 \
--greedy
| Category | Metric | Qwen/Qwen3-Next-80B-A3B-Thinking | RedHatAI/Qwen3-Next-80B-A3B-Thinking-FP8-dynamic | Recovery (%) |
|---|---|---|---|---|
| OpenLLM V1 | ARC-Challenge (Acc-Norm, 25-shot) | 70.14 | 70.05 | 99.87 |
| GSM8K (Strict-Match, 5-shot) | 84.61 | 84.76 | 100.18 | |
| HellaSwag (Acc-Norm, 10-shot) | 62.19 | 62.06 | 99.79 | |
| MMLU (Acc, 5-shot) | 84.95 | 85.05 | 100.12 | |
| TruthfulQA (MC2, 0-shot) | 59.29 | 59.51 | 100.37 | |
| Winogrande (Acc, 5-shot) | 77.98 | 77.90 | 99.90 | |
| Average Score | 73.19 | 73.22 | 100.04 | |
| OpenLLM V2 | IFEval (Inst Level Strict Acc, 0-shot) | 44.84 | 42.45 | 94.67 |
| BBH (Acc-Norm, 3-shot) | 29.73 | 30.74 | 103.40 | |
| Math-Hard (Exact-Match, 4-shot) | 18.35 | 16.84 | 91.77 | |
| GPQA (Acc-Norm, 0-shot) | 26.34 | 26.59 | 100.95 | |
| MUSR (Acc-Norm, 0-shot) | 42.33 | 41.01 | 96.88 | |
| MMLU-Pro (Acc, 5-shot) | 72.70 | 72.77 | 100.10 | |
| Average Score | 39.05 | 38.40 | 98.34 | |
| Reasoning | AIME25 (pass@1, n=8) | 60.00 | 50.00 | 83.33 |
| MATH-500 (pass@1, n=8) | 94.00 | 86.80 | 92.34 | |
| GPQA-Diamond (pass@1, n=8) | 73.74 | 74.75 | 101.37 | |
| Average Score | 75.91 | 70.52 | 92.90 |