Downloads · 30 days
0
llllwxxx/Qwen3-Next-80B-A3B-Thinking-FP8-Dynamic
Qwen3-Next-80B-A3B-Thinking-FP8-Dynamic is a machine learning model from llllwxxx. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Sep 12, 2025
Repo size
—
Likes
5
Public
Click a slice to open those files.
.md4.7 KB · 76%
From the Hugging Face model README
uv pip install llmcompressor torch
uv pip install git+https://github.com/huggingface/transformers.git@main
Save the following script as quantize.py:
from llmcompressor.transformers import SparseAutoModelForCausalLM
from transformers import AutoTokenizer
model_name = "Qwen/Qwen3-Next-80B-A3B-Thinking"
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = SparseAutoModelForCausalLM.from_pretrained(
model_name,
dtype="auto",
device_map="auto"
)
from llmcompressor.transformers import oneshot
from llmcompressor.modifiers.quantization import QuantizationModifier
# Configure simple PTQ quantization
recipe = QuantizationModifier(
targets="Linear",
scheme="FP8_DYNAMIC",
ignore=[
"lm_head",
"re:.*mlp.gate$", # Ignore standard gate layers
"re:.*shared_expert_gate$", # Ignore shared expert gate layers
"re:.*router$" # Ignore router layers
]
)
# Apply quantization algorithm
oneshot(model=model, recipe=recipe)
# Save model
SAVE_DIR = model_name.split("/")[1] + "-FP8-Dynamic"
model.save_pretrained(SAVE_DIR)
tokenizer.save_pretrained(SAVE_DIR)
Run the script:
python quantize.py
The quantized model will be saved in the Qwen3-Next-80B-A3B-Thinking-FP8-Dynamic directory.
VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 vllm serve Qwen3-Next-80B-A3B-Thinking-FP8-Dynamic --port 8080 --tensor-parallel-size 2 --api-key 123 --gpu-memory-utilization 0.95 --max_num_seqs 2 --max-model-len 131072 --enable-auto-tool-choice --tool-call-parser hermes --reasoning-parser deepseek_r1 # --speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":2}'