#!/bin/bash # ============================================================== # start-vllm.sh — Production vLLM launch script (current config) # Dual RTX 3090 · Qwen3.6-35B-A3B pack-quantized · 262K context # ============================================================== # CURRENT PRODUCTION CONFIG (validated 2026-08-03): NO MTP — output-correct. # ⚠️ MTP (--spec-method mtp) DISABLED 2026-08-03 — vLLM 0.26 correctness bug. # A/B (same 40 HumanEval, fair chat format, temp 0): MTP 27/40 (67.5%) vs # no-MTP 30/40 (75.0%). 5/40 outputs DIVERGED from greedy — spec-decode with # rejection sampling must be bit-identical to greedy; it is not. Output # corruption for code/agent work is unacceptable. Tracked upstream. # Throughput with MTP (2026-08-02, for reference only): single 215.7 tok/s, # 4-way 606.3, 32-way 1,576. Decode numbers in docs marked "speculative". # # Decode (no-MTP, real tokens): single ~150-160 tok/s · 4-way ~435 · # 32-way ~1,395. Prefill 32K 0.88s · 128K 6.2s · 256K 73.6s (survives). # Sustained burn: 416 tok/s agg, 0 errors in 1,292 req (10 min). # Cost: EUR0.043/1M tokens @ EUR0.11/kWh (1.5M tok/hr). # ============================================================== cd ~ source ~/vllm/bin/activate export VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0 CUDA_VISIBLE_DEVICES=0,1 \ vllm serve ~/models/qwen3.6-35b-a3b-awq \ --tensor-parallel-size 2 \ --dtype bfloat16 \ --max-model-len 262144 \ --max-num-seqs 32 \ --max-num-batched-tokens 32768 \ --gpu-memory-utilization 0.80 \ --kv-cache-dtype fp8 \ --attention-backend flashinfer \ --enable-prefix-caching \ --enable-auto-tool-choice \ --tool-call-parser qwen3_coder \ --port 8000 # ============================================================== # Flag choices and rationale (current production): # # --tensor-parallel-size 2 # 35B MoE model split across both GPUs. The old PP=2 split # (start-vllm.sh v1) is superseded — TP=2 with the current # flag set measures better and is the live config. # # VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0 # Disables CUDA graph memory over-estimation in vLLM v0.26. # Without this, KV cache allocation under-reserves VRAM. # With it, actual CUDA graph usage is 2.59 GiB (measured). # # --dtype bfloat16 # Explicit dtype avoids auto-detection mismatch. Weights are # int4 compressed-tensors; activations must be bfloat16 for # MoE routing and attention. # # --max-model-len 262144 # Full native context. 256K prefill validated: TTFT 73.6s, # GPU mem peaked 23,143 MiB / 24,576 MiB (1.4 GiB headroom). # # --max-num-seqs 32 / --max-num-batched-tokens 32768 # Throughput config for concurrent serving. 32 seqs saturates # both GPUs at ~99% util under 4-worker sustained load. # 32768 batched tokens keeps GDN-attention intermediates # bounded (0.90+ with 65536 batched OOM'd at 262K prefill). # # --gpu-memory-utilization 0.80 # THE OOM fix. At 0.95 the server died (EngineDeadError) at # 262K prefill — ~0 MiB headroom for attention intermediates. # 0.80 leaves ~1.4-4 GiB headroom and survives true 256K. # # --kv-cache-dtype fp8 # Halves KV cache footprint vs bf16 (8 vs 16 bytes/token). # At 0.80 this is the difference between 256K fitting or not. # # --attention-backend flashinfer # Fastest attention kernel for Ampere; handles variable-length # sequences efficiently. Required for 36K+ tok/s prefill at 32K ctx. # # --enable-prefix-caching # Caches KV by hash. Agent frameworks reuse system prompts → # TTFT near zero on repeat prefixes. Included in all validated runs. # # --enable-auto-tool-choice --tool-call-parser qwen3_coder # Native function calling for agent frameworks (Hermes etc.). # # (No --enable-chunked-prefill — vLLM V1 handles chunked prefill # internally; prefill scaling test confirmed clean TTFT curve.) # (No --enforce-eager — CUDA graphs work with flashinfer, 2.59 GiB.) # ==============================================================