vLLM 部署 Qwen3-235B-A22B-Instruct-2507
启动命令
1 | sudo docker run --gpus '"device=0,1,2,3,4,5,6,7"' \ |
启动日志(关键行)
1 | INFO 08-27 08:58:50 [__init__.py:241] Automatically detected platform cuda. |
调用日志
1 | (APIServer pid=1) INFO: 10.33.27.93:55840 - "POST /v1/chat/completions HTTP/1.1" 200 OK |
vLLM 部署 Qwen3-235B-A22B
vLLM Qwen3-235B-A22B 启动
20250430版本支持qwen3思考/非思考模式
1、–enable-prefix-caching、–chunked-prefill-enabled、–use-v2-block-manager默认开启;
2、–enforce-eager、–enable-expert-parallel默认关闭;
1 | CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m vllm.entrypoints.openai.api_server \ |
vLLM Qwen3-235B-A22B 优化
1、–enable-expert-parallel开启专家并行,Qwen3-235B-A22B-FP8的–tensor-parallel-size为4;
2、–enable-reasoning –reasoning-parser deepseek_r1 –enable-auto-tool-choice –tool-call-parser hermes来支持MCP;3、–max-num-batched-tokens 、–max_num_seqs默认为None;
1 | CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m vllm.entrypoints.openai.api_server \ |
–cpu-offload-gb:将每张卡应该装载到显存的模型卸载到CPU内存中,这个性能受限于PCIe速度和内存带宽,卸载到内存中的模型每次前向传播都会装载到GPU的显存中。
vLLM 0.8.5日志分析
- vLLM API server version 0.8.5
1 | INFO 04-29 01:18:54 [api_server.py:1044] args: Namespace(host=None, port=8995, ..., api_key='<YOUR_API_KEY>', ..., model='/models/Qwen3-235B-A22B', task='auto', ..., trust_remote_code=False, load_format='auto', dtype='auto', max_model_len=32000, reasoning_parser='deepseek_r1', ..., tensor_parallel_size=8, enable_expert_parallel=False, ..., gpu_memory_utilization=0.9, swap_space=4, ..., enable_prefix_caching=None, use_v2_block_manager=True, ..., served_model_name=['qwen3-235b-a22b'], ..., enable_reasoning=True, ...) |
- This model supports multiple tasks: {‘embed’, ‘classify’, ‘generate’, ‘reward’, ‘score’}. Defaulting to ‘generate’.
- Defaulting to use mp for distributed inference
- Chunked prefill is enabled with max_num_batched_tokens=8192.
1 | INFO 04-29 01:19:11 [core.py:58] Initializing a V1 LLM engine (v0.8.5) with config: model='/models/Qwen3-235B-A22B', ..., dtype=torch.bfloat16, max_seq_len=32000, tensor_parallel_size=8, ..., enable_prefix_caching=True, chunked_prefill_enabled=True, use_async_output_proc=True, ... |
- vLLM is using nccl==2.21.5
- Using Flash Attention backend on V1 engine.
- Using FlashInfer for top-p & top-k sampling.
- Using default completion sampling params from model: {‘temperature’: 0.6, ‘top_k’: 20, ‘top_p’: 0.95}
vLLM 0.8.5调用日志
1 | INFO 05-18 20:11:58 [logger.py:39] Received request chatcmpl-ba69850c020242479e52db988c7834ca: prompt: '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n<|im_start|>user\n你是谁?<|im_end|>\n<|im_start|>assistant\n', params: SamplingParams(n=1, presence_penalty=0.0, frequency_penalty=0.0, repetition_penalty=1.0, temperature=0.6, top_p=0.95, top_k=20, min_p=0.0, seed=None, stop=[], stop_token_ids=[], bad_words=[], include_stop_str_in_output=False, ignore_eos=False, max_tokens=31978, ...) |
思考模式:流式返回的首个token
1 | { |
思考模式:非流式返回
1 | { |
vLLM 使用 Kubernetes 部署
1 | apiVersion: apps/v1 |
vLLM 思考模式和非思考模式

vLLM qwen3moe 吞吐量较低
qwen3moe 在 2000 个 token 以上的提示下吞吐量较低
当token很少时,它运行正常,但随着输入的增加,它变得异常缓慢,就像Flash Attention之前的Transformers那样。在多GPU配置下,这个问题会更加严重,而单GPU的速度也比预期的要慢。
镜像: vllm/vllm-openai:v0.8.5.post1
硬件: 8xA100 80GB NVLink
CUDA 12.6
Prefill size is 20000~24000 tokens
使用 V0 引擎进行测试,强制执行开启和关闭,后端 FLASHINFER 和 FA2,专家并行开启和关闭,但所有组合都产生相同的结果。
Qwen3-30B-A3B/tp1
vllm serve /models/qwen/Qwen3-30B-A3B --port 7777 --tensor-parallel-size 1 --max-num-batched-tokens 131072 --max-model-len 32768 --enable-prefix-caching
21.0 tokens generated/sec on vllm
Qwen3-30B-A3B/tp8
vllm serve /models/qwen/Qwen3-30B-A3B --port 7777 --tensor-parallel-size 8 --max-num-batched-tokens 131072 --max-model-len 32768 --enable-prefix-caching
4.5 tokens generated/sec on vllm
80.0 tokens generated/sec on SGLang
Qwen3-235B-A22B/tp8
vllm serve /models/qwen/Qwen3-235B-A22B --port 7777 --tensor-parallel-size 8 --max-num-batched-tokens 131072 --max-model-len 32768 --enable-prefix-caching
2.2 tokens generated/sec on vllm
36.0 tokens generated/se on SGLang
SGLang 部署 Qwen3-235B-A22B
SGLang Qwen3-235B-A22B 启动
1 | ## server |
SGLang 使用 Kubernetes 部署
1 | apiVersion: apps/v1 |

