{"slug": "running-qwen4-35b-a3b-on-two-rtx-3090s-with-vllm-and-llama-cpp", "title": "Running Qwen4-35B-A3B on Two RTX 3090s with vLLM and llama.cpp", "summary": "A hands-on test found that Qwen4-35B-A3B, released December 4, runs on two Ampere-generation RTX 3090 GPUs from the stock vllm/vllm-openai:qwen4 image at tensor parallel 2 with a 433K-token context, despite vLLM's announcement naming only Ada, Hopper and Blackwell cards. The author ran RadixArk's 43.67 GiB NVFP4 checkpoint and Qwen's FP8 checkpoint on vLLM, where vLLM's Marlin kernels keep weights quantized and compute at 16 bits because Ampere lacks native FP8 math, and also got a llama.cpp setup working. The setups fall back to NCCL communication because SymmMem and P2P are unavailable, and the author advises leaving out --kv-cache-dtype nvfp4, which needs Ada or newer.", "body_md": "# Running Qwen4-35B-A3B on Two RTX 3090s with vLLM and llama.cpp\n\nQwen4-35B-A3B came out December 4. vLLM runs it, but its\n[announcement](https://vllm.ai/blog/2026-12-04-qwen4-35b-a3b) names Ada, Hopper, and Blackwell\ncards, and my RTX 3090s are Ampere, the generation before Ada. I wanted to see if the two in\n[the six-GPU box](https://doug.sh/posts/six-gpus-one-x16-slot/) could run it anyway.\n\nThey can, from the stock `vllm/vllm-openai:qwen4` image, with a 433K-token context. That’s room for\nroughly 320,000 words at once. The rest of this post is the three setups I got working, two on vLLM\nand one on llama.cpp, with the commands for each and\n[the numbers side by side](#numbers-on-the-same-two-cards).\n\n## What Ampere is missing [🔗](#what-ampere-is-missing)\n\nI’d assumed an unlisted card wouldn’t load the model at all. It loads, and every start logs what it can’t use. Capability 8.6 in the first line is CUDA’s number for Ampere, also written SM86.\n\n```\nSymmMemCommunicator: Device capability 8.6 not supported, communicator is not available.\nCustom allreduce is disabled because your platform lacks GPU P2P capability or P2P test failed.\nYour GPU does not have native support for FP8 computation but FP8 quantization is being used.\nWeight-only FP8 compression will be used leveraging the Marlin kernel.\n```\n\nvLLM runs the model at tensor parallel 2 (TP2), which splits every layer across both cards, so the cards have to swap partial results. They do it through NCCL (NVIDIA’s GPU-to-GPU communication library) instead of SymmMem, a communicator vLLM has for newer cards, or P2P (peer-to-peer, one card copying straight into the other’s memory).\n\nThe P2P line isn’t about Ampere. You get it from the stock NVIDIA driver on a GeForce card of any\ngeneration, and [the P2P post](https://doug.sh/posts/gpu-p2p-tensor-parallel/) covers it.\n\nBoth checkpoints (the published weight files) I ran on vLLM are quantized, or stored in fewer bits. Qwen’s own is FP8 (8-bit floats), and RadixArk’s is NVFP4, NVIDIA’s 4-bit float format.\n\nThe last two lines mean Ampere can’t do FP8 math itself. vLLM’s Marlin kernels (compiled GPU routines) keep the weights quantized and compute at 16 bits. That covers NVFP4 too.\n\nThe KV (key-value) cache is the GPU memory holding what the model has already read. NVFP4’s format\nfor it is the part that needs Ada or newer, so I’d leave `--kv-cache-dtype nvfp4` out, though\n[vLLM’s recipe](https://recipes.vllm.ai/Qwen/Qwen4-35B-A3B) has it. I didn’t test it.\n\n## NVFP4 on vLLM [🔗](#nvfp4-on-vllm)\n\nNVFP4 was the easy one. The command comes from\n[vLLM issue 71952](https://github.com/vllm-project/vllm/issues/71952), where someone was already\nrunning [RadixArk’s checkpoint](https://huggingface.co/RadixArk/Qwen4-35B-A3B-NVFP4) on two 3090s. I\njust added `--max-model-len auto`.\n\nDownload the checkpoint, which is 43.67 GiB:\n\n```\nhf download RadixArk/Qwen4-35B-A3B-NVFP4 --local-dir ~/models/qwen4-nvfp4\n```\n\nThen start the server from the stock image, which is 24.8 GB:\n\n```\ndocker run -d \\\n  --name qwen4-vllm \\\n  --gpus all \\\n  --shm-size 16g \\\n  -p 8000:8000 \\\n  -v ~/models/qwen4-nvfp4:/models/qwen4:ro \\\n  -v ~/models/vllm-cache:/root/.cache \\\n  -v ~/models/vllm-cache/triton:/root/.triton \\\n  -e HF_HUB_OFFLINE=1 \\\n  -e VLLM_USE_RUST_FRONTEND=1 \\\n  vllm/vllm-openai:qwen4 \\\n  /models/qwen4 \\\n  --served-model-name qwen4-35b-a3b \\\n  --trust-remote-code \\\n  --tensor-parallel-size 2 \\\n  --max-model-len auto \\\n  --kv-cache-dtype auto \\\n  --attention-config.indexer_kv_dtype bf16 \\\n  --mamba-ssm-cache-dtype bfloat16 \\\n  --speculative-config '{\"method\":\"mtp\",\"num_speculative_tokens\":3,\"index_share_for_mtp_iteration\":false}' \\\n  --max-num-batched-tokens 8192 \\\n  --max-num-seqs 64 \\\n  --gpu-memory-utilization 0.95 \\\n  --compilation-config '{\"max_cudagraph_capture_size\": 64}' \\\n  --enable-prefix-caching \\\n  --disable-flashinfer-autotune \\\n  --enable-auto-tool-choice \\\n  --tool-call-parser qwen4 \\\n  --reasoning-parser qwen4\n```\n\nWithout `--max-model-len auto`, vLLM asks for the model’s full one million tokens and stops with a\n`ValueError`. That was my one failed start. With it, the server cut the context to the 433K tokens\nit had cache for and was ready in 107 seconds.\n\nThe weights take about 13 GiB a card with the vision encoder (the part that reads images) and the multi-token prediction (MTP) draft head loaded, and 12 without them. The draft head guesses a few tokens ahead for the model to keep or reject.\n\nIf you want a longer context, drop `--speculative-config`, which turns the draft head off. That\nfrees enough for 612K tokens.\n\nThe `.triton` mount keeps compiled kernels between starts, so the second start skips the compile.\n\nA chat request and a tool call came back right, and so did a code hidden in a 200K-token prompt. That’s all the quality testing I did, so I can’t tell you what these quantizations cost in answers.\n\n## FP8, the official checkpoint [🔗](#fp8-the-official-checkpoint)\n\nQwen’s own checkpoint is a tighter fit.\n[The other two-3090 setup I found](https://github.com/lulakien/qwen4-35b-a3b-2x3090) says “Qwen’s\nofficial checkpoints do not fit two 24 GB cards”, but the FP8 one does, with image input on or off.\n\nIt’s 56 GiB on disk. With image input off it puts about 18.4 GiB of weights on each card, against NVFP4’s 12 to 13, which leaves you about 1.4 GiB a card for cache.\n\nIt took one fix to start. By default vLLM plans for 256 requests at once (it calls them sequences),\nand each needs a block of state memory, the Mamba cache. I had room for 150:\n`max_num_seqs (256) exceeds available Mamba cache blocks (150).` Set `--max-num-seqs` yourself. I\nused 16.\n\nDownload the checkpoint:\n\n```\nhf download Qwen/Qwen4-35B-A3B-FP8 --local-dir ~/models/qwen4-fp8\n```\n\nThen start the server:\n\n```\ndocker run -d \\\n  --name qwen4-vllm \\\n  --gpus all \\\n  --shm-size 16g \\\n  -p 8000:8000 \\\n  -v ~/models/qwen4-fp8:/models/qwen4:ro \\\n  -v ~/models/vllm-cache:/root/.cache \\\n  -v ~/models/vllm-cache/triton:/root/.triton \\\n  -e HF_HUB_OFFLINE=1 \\\n  -e VLLM_USE_RUST_FRONTEND=1 \\\n  vllm/vllm-openai:qwen4 \\\n  /models/qwen4 \\\n  --served-model-name qwen4-35b-a3b \\\n  --trust-remote-code \\\n  --enable-prefix-caching \\\n  --tensor-parallel-size 2 \\\n  --max-model-len auto \\\n  --max-num-seqs 16 \\\n  --kv-cache-dtype fp8 \\\n  --limit-mm-per-prompt '{\"image\":0,\"video\":0}' \\\n  --disable-flashinfer-autotune \\\n  --enable-auto-tool-choice \\\n  --tool-call-parser qwen4 \\\n  --reasoning-parser qwen4\n```\n\nIt was ready in 71 seconds with a 230K-token context. By the end of benchmarking, each card was at 21.9 of 24 GiB.\n\n`--limit-mm-per-prompt` turns image and video input off. Leave it out and the server still starts,\nand mine answered a question about an image, but the context drops to 146K tokens.\n\nFor more context, set the cache size yourself. `--kv-cache-memory 2400M` gave me 405K tokens. I\nchecked that one with a 394K-token prompt and with 16 clients, which left each card at 22.9 of\n24 GiB. I didn’t run the full benchmark on it.\n\nAn FP8 KV cache still works on Ampere, and you want it. A 600 MB cache held about 43K tokens as BF16 (16-bit floats) and about 80K as FP8. At 1,100 MB it was 91K and 171K.\n\nThe recipe’s `--attention-config.indexer_kv_dtype fp8` puts one more cache in FP8: the indexer’s, a\nsmall attention pass that picks which earlier tokens the full attention reads. These cards can’t\ncompile the kernel for that: `type fp8e4nv not supported in this architecture`. Leave the flag out\nor set `bf16`. [The fix](https://github.com/vllm-project/vllm/pull/71748), which rejects `fp8` there\non cards older than Ada, merged after the image I pulled was pushed.\n\nWith FP8, MTP needs the cache sized by hand. Add `--speculative-config` and automatic sizing stops with\n`Cannot auto-fit max_model_len: not enough GPU memory available to serve even a single token.`\nvLLM’s log suggested a 2.2 GiB cache. That answered its health check and then ran out of memory on a\n2K prompt. `--kv-cache-memory 1400M` held, with a 174K-token context.\n\n## llama.cpp with a Q4_K_M GGUF [🔗](#llamacpp-with-a-q4_k_m-gguf)\n\nllama.cpp was the boring one. It worked on the first launch and was ready in 13 seconds. GGUF is llama.cpp’s file format, and Q4_K_M is one of its 4-bit quantizations.\n\nDownload the three Q4_K_M files, which are 30.6 GiB together:\n\n```\nhf download ggml-org/Qwen4-35B-A3B-GGUF \\\n  --include \"Qwen4-35B-A3B-Q4_K_M-*\" \\\n  --local-dir ~/models/qwen4-gguf\n```\n\nThen start the server. The digest is the `server-cuda` tag from December 4, build 12977:\n\n```\nIMAGE=ghcr.io/ggml-org/llama.cpp@sha256:e401af28fa80f68225d6190cec7e7d4c2743bb14cbfa0ec201a36abf12a4a620\n\ndocker run -d \\\n  --name qwen4-llamacpp \\\n  --gpus all \\\n  -p 8000:8000 \\\n  -v ~/models/qwen4-gguf:/models:ro \\\n  \"$IMAGE\" \\\n  -m /models/Qwen4-35B-A3B-Q4_K_M-00001-of-00003.gguf \\\n  --alias qwen4-35b-a3b \\\n  --host 0.0.0.0 \\\n  --port 8000 \\\n  -ngl 999 \\\n  -fa on \\\n  --jinja \\\n  -c 262144 \\\n  -np 8 \\\n  -kvu\n```\n\n`-c 262144 -np 8 -kvu` gives you eight slots, llama.cpp’s word for requests served at once, that\nshare one 262K-token cache.\n\nAll 41 layers fit on a single 3090 if you give it a smaller context. It’s the same flags with one card, a 115K-token context, and four slots:\n\n```\ndocker run -d \\\n  --name qwen4-llamacpp \\\n  --gpus device=0 \\\n  -p 8000:8000 \\\n  -v ~/models/qwen4-gguf:/models:ro \\\n  \"$IMAGE\" \\\n  -m /models/Qwen4-35B-A3B-Q4_K_M-00001-of-00003.gguf \\\n  --alias qwen4-35b-a3b \\\n  --host 0.0.0.0 \\\n  --port 8000 \\\n  -ngl 999 \\\n  -fa on \\\n  --jinja \\\n  -c 114688 \\\n  -np 4 \\\n  -kvu\n```\n\nThat loaded at about 23.2 GiB, and `-c 131072` failed with `cudaMalloc failed: out of memory`.\n\n## Numbers on the same two cards [🔗](#numbers-on-the-same-two-cards)\n\nI ran five setups on the two cards, each card capped at 350 W: NVFP4 and FP8 with and without MTP, and llama.cpp. Every figure is one run.\n\nPrefill is the server reading your prompt, and decode is it writing the answer, both in tokens per second (tok/s). Thinking was on, so decode counts reasoning tokens.\n\nOne request at a time:\n\n| Setup | Context | Prefill, 32K prompt | First token, 125K prompt | Decode | \n|---|---|---|---|---|\n| NVFP4, MTP | 433K | 8,253 tok/s | 16 s | 183 tok/s | \n| NVFP4, no MTP | 612K | 8,588 tok/s | 15 s | 129 tok/s | \n| FP8, no MTP | 230K | 7,027 tok/s | 18 s | 118 tok/s | \n| FP8, MTP | 174K | 7,263 tok/s | 18 s | 172 tok/s | \n| llama.cpp Q4_K_M | 262K | 4,453 tok/s | 29 s | 111 tok/s | \n\nNVFP4 prefills about twice as fast as llama.cpp, and stays near 8K tok/s from a 2K prompt to a 125K\none. Two of the box’s Radeon AI PRO R9700s prefill this model at 11K to 13K tok/s, per\n[the R9700 post](https://doug.sh/posts/qwen4-35b-a3b-r9700-benchmarks/).\n\nMTP adds 42% to one request’s decode.\n\nllama.cpp on one 3090 decoded at 115 tok/s, against 111 on two. The second card gets you context but no speed.\n\nMany requests at once, in total tok/s:\n\n| Setup | 1 client | 4 | 8 | 16 | Power at 8 | Tokens per joule at 8 | \n|---|---|---|---|---|---|---|\n| NVFP4, MTP | 157 | 410 | 582 | 826 | 646 W | 0.90 | \n| NVFP4, no MTP | 125 | 380 | 620 | 923 | 625 W | 0.99 | \n| FP8, no MTP | 115 | 338 | 542 | 793 | 627 W | 0.86 | \n| FP8, MTP | 143 | 374 | 361 | 372 | 642 W | 0.56 | \n| llama.cpp Q4_K_M | 95 | 216 | 281 | not run | 448 W | 0.63 | \n\nWith more clients MTP costs you: at 16, NVFP4 gave 923 tok/s without it and 826 with it.\n\nFP8 with MTP stopped scaling at 4 clients. It gave about 370 tok/s at 4, 8, and 16, and the server didn’t have more than 5 requests running at once. I don’t know what limits it.\n\n## Host RAM [🔗](#host-ram)\n\nWith tensor parallel, count host RAM as well as VRAM (the cards’ own memory). The model ships a 20.5 GB n-gram table, a lookup of two- and three-token sequences. vLLM runs one worker per card, and each pins (locks) its own copy in host RAM.\n\nThe container used between about 39 and 53 GiB across these configs, page cache included. llama.cpp reads the table from disk as needed and used about 4 GiB once loaded.\n\n## Which one I’d run [🔗](#which-one-id-run)\n\nIf you have two 3090s serving several clients or an agent, I’d run NVFP4 on vLLM with MTP. It has the best decode for one request, about twice llama.cpp’s prefill, and vision, and you don’t have to size the cache by hand. Drop MTP if you want the longer context or serve many clients.\n\nFor one 3090, or if you want to be serving in twenty seconds, use llama.cpp. I didn’t try either vLLM checkpoint on a single card, because the weights alone are about 25 GiB for NVFP4 and about 37 GiB for FP8.\n\nI’d run FP8 only if you need Qwen’s own checkpoint. You get about half the context of NVFP4 with MTP, and a third of it with image input on.\n\n*I had help with this one. Claude ran the tests on the box and helped me draft this post. I read all\nthe words and checked the numbers, so the mistakes are mine.*\n\n## Sources [🔗](#sources)\n\n- [vLLM’s Qwen4-35B-A3B launch post](https://vllm.ai/blog/2026-12-04-qwen4-35b-a3b) , the supported GPU list\n- [vLLM recipe for Qwen4-35B-A3B](https://recipes.vllm.ai/Qwen/Qwen4-35B-A3B) , the serving flags by hardware\n- [vLLM issue 71952](https://github.com/vllm-project/vllm/issues/71952) , the baseline NVFP4 command for two RTX 3090s and the FP8 indexer crash on SM86\n- [vLLM PR 71748](https://github.com/vllm-project/vllm/pull/71748) , the fix that rejects the FP8 indexer cache below SM89 (Ada)\n- [RadixArk/Qwen4-35B-A3B-NVFP4](https://huggingface.co/RadixArk/Qwen4-35B-A3B-NVFP4) , the 4-bit checkpoint\n- [Qwen/Qwen4-35B-A3B-FP8](https://huggingface.co/Qwen/Qwen4-35B-A3B-FP8) , the official FP8 checkpoint\n- [ggml-org/Qwen4-35B-A3B-GGUF](https://huggingface.co/ggml-org/Qwen4-35B-A3B-GGUF) , the Q4_K_M files\n- [Hugging Face discussion 69](https://huggingface.co/Qwen/Qwen4-35B-A3B/discussions/69) and[its repo](https://github.com/lulakien/qwen4-35b-a3b-2x3090) , a patched vLLM with a custom 4-bit checkpoint on two RTX 3090s", "url": "https://wpnews.pro/news/running-qwen4-35b-a3b-on-two-rtx-3090s-with-vllm-and-llama-cpp", "canonical_source": "https://doug.sh/posts/qwen4-vllm-llamacpp-rtx-3090/", "published_at": "2026-12-05 00:00:00+00:00", "updated_at": "2026-12-05 18:12:49.016560+00:00", "lang": "en", "topics": ["large-language-models", "ai-infrastructure"], "entities": ["Qwen4-35B-A3B", "vLLM", "llama.cpp", "NVIDIA", "RTX 3090", "RadixArk", "Marlin", "NCCL"], "also_reported_by": [], "takeaway": "On Ampere RTX 3090s, run Qwen4-35B-A3B at tensor parallel 2 with --max-model-len auto and --kv-cache-dtype auto, since Marlin kernels compute FP8/NVFP4 weights at 16 bits and nvfp4 KV cache requires Ada or newer.", "recommendation": {"advice": "On Ampere cards, serve Qwen4-35B-A3B with --max-model-len auto and --kv-cache-dtype auto, skipping nvfp4 KV cache, and rely on Marlin kernels to compute FP8/NVFP4 weights at 16 bits.", "playbook": "inference-serving", "playbook_url": "https://wpnews.pro/playbooks/inference-serving"}, "alternates": {"html": "https://wpnews.pro/news/running-qwen4-35b-a3b-on-two-rtx-3090s-with-vllm-and-llama-cpp", "markdown": "https://wpnews.pro/news/running-qwen4-35b-a3b-on-two-rtx-3090s-with-vllm-and-llama-cpp.md", "text": "https://wpnews.pro/news/running-qwen4-35b-a3b-on-two-rtx-3090s-with-vllm-and-llama-cpp.txt", "jsonld": "https://wpnews.pro/news/running-qwen4-35b-a3b-on-two-rtx-3090s-with-vllm-and-llama-cpp.jsonld"}}