Instructions to use Qwen/Qwen3-30B-A3B-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3-30B-A3B-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/Qwen3-30B-A3B-FP8") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-30B-A3B-FP8") model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-30B-A3B-FP8", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3-30B-A3B-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3-30B-A3B-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen3-30B-A3B-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/Qwen3-30B-A3B-FP8
- SGLang
How to use Qwen/Qwen3-30B-A3B-FP8 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Qwen/Qwen3-30B-A3B-FP8" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen3-30B-A3B-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Qwen/Qwen3-30B-A3B-FP8" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen3-30B-A3B-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Qwen/Qwen3-30B-A3B-FP8 with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3-30B-A3B-FP8
Remove vLLM FP8 Limitation
This has been fixed as of latest v0.8.5 release π
ERROR 04-29 09:46:24 [core.py:396] ValueError("type fp8e4nv not supported in this architecture. The supported fp8 dtypes are ('fp8e4b15', 'fp8e5')")
i got this when running it on an A100..does it not use the marlin kernels by default?
I'm still encountering this error on 0.8.5.
I'm using 2 3090s with -tp 2 if that makes a difference?
I'm also still encountering this issue on vLLM version 0.8.5.post1
Model: Qwen/Qwen3-30B-A3B-FP8
Running in WSL Ubuntu, 2x RTX 3090 gpus
Command:
vllm serve /mnt/d/models/Qwen3-30B-A3B-FP8
--enable-reasoning
--reasoning-parser deepseek_r1
--quantization fp8
--enforce-eager
--max-model-len 10000
--tensor-parallel-size 2
--gpu-memory-utilization .98
--served-model-name localmodel
--enable-auto-tool-choice
--tool-call-parser hermes
--port 5111
Error:
RuntimeError: Worker failed with error 'at 1:0:
def _per_token_group_quant_fp8(
^
ValueError("type fp8e4nv not supported in this architecture. The supported fp8 dtypes are ('fp8e4b15', 'fp8e5')")', please check the stack trace above for the root cause
this is w8a8, which needs hopper, ada lovelace, or later cards. I don't think 3090s (ampere) can run this.
Vllm's marlin kernel should allow you to run fp8 models at w8a16 on ampere https://docs.vllm.ai/en/latest/features/quantization/fp8.html
Vllm's marlin kernel should allow you to run fp8 models at w8a16 on ampere https://docs.vllm.ai/en/latest/features/quantization/fp8.html
FP8 Marlin doesn't support block-wise fp8 quant and MoE until https://github.com/vllm-project/vllm/pull/16850, which is not available in 0.8.5.post1. while 0.9.0 includes that PR, there isn't any prebuilt binary packages. so for now, ampere cards cannot run this.
Ah I see, thanks very much!
so, will vllm 0.9.0 support block-wise fp8 quant and MoE?
so, will vllm 0.9.0 support block-wise fp8 quant and MoE?
yes, it does. if you have met any issues, please consider report to vLLM or Qwen at GitHub.