Can You Run Qwen 3.5 on RTX 3090? Performance Guide
The Problem
I have an RTX 3090 with 24GB VRAM. I wanted to run Qwen 3.5 27B, but I kept running into memory issues.
At first, I tried loading the model with default settings. The model loaded, but as soon as I increased context length beyond 8K tokens, I got OOM (Out of Memory) errors.
Then I tried quantization. But which one? Q4_K_M, Q4_K_S, GPTQ, FP8? Each has tradeoffs between quality, speed, and context length.
I spent hours researching and testing. Here’s what I learned.
Understanding the VRAM Challenge
Before diving into solutions, let me explain why this is tricky.
When you run a model, VRAM holds:
- Model weights - The parameters themselves
- KV cache - Key-Value cache for attention mechanism
- Activations - Intermediate computations
For Qwen 3.5 27B, the breakdown looks like this:
Component | Q4_K_M | Q4_K_S----------------------|-----------|--------Model weights | ~17 GB | ~16 GBKV cache (32K context) | ~3-4 GB | ~3-4 GBKV cache (64K context) | ~6-8 GB | ~6-8 GBKV cache (128K context)| ~12-16 GB | ~12-16 GBThe problem is obvious: 17GB for weights plus 16GB for 128K context equals 33GB. My 3090 only has 24GB.
The Qwen 3.5 Secret Weapon
Here’s what I didn’t know: Qwen 3.5 uses a hybrid attention architecture.
Only 1/4 of the layers use full attention. The rest use more efficient attention mechanisms. This means the KV cache is much smaller than traditional transformers.
Traditional transformer: All layers use full attentionQwen 3.5 hybrid: Only 25% of layers use full attentionResult: ~75% smaller KV cache than expectedThis is why people report running 65-80K context on a single 3090 with Qwen 3.5. The hybrid architecture changes everything.
Finding the Right Quantization
I tested several quantization options. Here are my results:
Q4_K_M: The Sweet Spot
Q4_K_M (4-bit K-quantization Medium) gives the best balance of quality and performance.
./llama-cli -m qwen2.5-27b-instruct-q4_k_m.gguf \ -ngl 99 \ -c 65536 \ --temp 0.7 \ -n 512 \ -p "Explain quantum computing in simple terms"With this setup, I get:
- Generation speed: 45-50 tokens/second
- Context: Up to 65-80K tokens
- Quality: Excellent, nearly indistinguishable from FP16
The -ngl 99 flag offloads all layers to GPU. The -c 65536 sets context length.
Q4_K_S: For Maximum Context
Q4_K_S (Small variant) trades a bit of quality for faster inference.
./llama-cli -m qwen2.5-27b-instruct-q4_k_s.gguf \ -ngl 99 \ -c 80000 \ --temp 0.7 \ -p "Your prompt here"Results:
- Generation speed: ~30 tokens/second
- Context: Can push to 80K+
- Quality: Slightly degraded, but still usable
The community reports 30 t/s generation speed with Q4_K_S at extended contexts.
KV Cache Quantization: The Hidden Gem
This was a game-changer for me. You can quantize the KV cache separately.
./llama-cli -m qwen2.5-27b-instruct-q4_k_m.gguf \ -ngl 99 \ -c 131072 \ --kv-cache-dtype q8_0 \ --temp 0.7 \ -p "Your prompt here"The --kv-cache-dtype q8_0 flag quantizes the KV cache to 8-bit.
Results:
- Generation speed: ~35 tokens/second at 128K context
- Context: Full 128K context
- Quality: Minimal degradation
This is how you get 128K context on 24GB VRAM.
Multi-GPU Setup with vLLM
If you have dual 3090s, you can run FP8 (8-bit floating point) with tensor parallelism.
python -m vllm.entrypoints.openai.api_server \ --model Qwen/Qwen2.5-27B-Instruct \ --tensor-parallel-size 2 \ --quantization fp8 \ --max-model-len 131072 \ --gpu-memory-utilization 0.95The community reports excellent speeds with this setup. One user mentioned running the 27B model in FP8 with “great speed” on dual 3090s.
Running the 122B Model on 4x 3090s
For the truly ambitious, you can run Qwen 3.5 122B on four 3090s:
python -m vllm.entrypoints.openai.api_server \ --model Qwen/Qwen2.5-122B-Instruct-GPTQ \ --tensor-parallel-size 4 \ --max-model-len 260000 \ --gpu-memory-utilization 0.95Results reported by the community:
- Generation speed: 115 tokens/second
- Context: 260K tokens
- Power: Limited to 250W per GPU
Power Management for Better Thermals
The 3090 runs hot. I learned to manage power early.
# Check current power limitnvidia-smi --query-gpu=power.limit --format=csv
# Set to 280W (run as root)sudo nvidia-smi -i 0 -pl 280
# For 4-GPU setups, set all cardssudo nvidia-smi -i 0,1,2,3 -pl 250At 250-280W, I lose about 5-10% performance but gain significantly better thermals and power efficiency. This is essential for multi-GPU setups.
Maximum Context: The IK_LLAMA Method
For pushing context to the absolute limit (110K+ on single 3090), use IK_LLAMA with IQ4_NL quantization.
./ik_llama-cli -m qwen2.5-27b-instruct-iq4_nl.gguf \ -ngl 99 \ -c 110000 \ --temp 0.7 \ -p "Your long prompt here"Note: IK_LLAMA is a specialized build of llama.cpp. You may need to compile it with specific flags for IQ4_NL support.
Performance Summary
After all my testing, here’s what works on a single RTX 3090:
Quantization | Speed (t/s) | Context | Quality-------------|-------------|----------|--------Q4_K_M | 45-50 | 65-80K | ExcellentQ4_K_S | 30 | 80K+ | GoodQ4_K_M + Q8 KV | 35 | 128K | Very GoodQ4_K_S (IK_LLAMA) | Variable | 110K+ | GoodFor dual 3090s:
Configuration | Speed (t/s) | Context | Notes--------------|-------------|---------|-------FP8 TP=2 | Great | 128K | Best qualityGPTQ TP=2 | Good | Variable| Model-dependentCommon Mistakes I Made
1. Ignoring KV Cache Quantization
I initially thought I was limited to 32K context. Then I discovered --kv-cache-dtype q8_0. This alone doubled my usable context.
2. Not Power Limiting
My first multi-GPU test overheated and throttled. Power limiting to 250-280W per GPU solved this.
3. Wrong Quantization for Use Case
I started with Q4_K_S for speed, but the quality loss was noticeable for my coding tasks. Q4_K_M is the better default for most use cases.
4. Forgetting the Hybrid Architecture Advantage
I calculated VRAM needs using traditional transformer assumptions. Qwen 3.5’s hybrid architecture means less KV cache than expected. Always test before assuming you’ll run out of memory.
What Actually Works for Me
After all the testing, here’s my daily driver configuration:
./llama-cli -m qwen2.5-27b-instruct-q4_k_m.gguf \ -ngl 99 \ -c 65536 \ --kv-cache-dtype q8_0 \ --temp 0.7 \ --top-p 0.9 \ -n 2048This gives me:
- 45-50 t/s generation speed
- 65K context (more than enough for most tasks)
- Good quality output
- Stable thermals
For tasks needing longer context, I switch to full 128K context with KV quantization.
Summary
The RTX 3090 is an excellent option for running Qwen 3.5. Here’s what you need to know:
- Single 3090 with Q4_K_M: 30-50 t/s, 65-80K context
- KV cache quantization (Q8): Enables 128K context at ~35 t/s
- Dual 3090s with vLLM: FP8 with tensor parallelism, excellent speed
- Hybrid architecture: Qwen 3.5 uses less KV cache than expected
The key insight is that Qwen 3.5’s hybrid attention architecture makes it much more VRAM-efficient than traditional transformers. Combined with quantization, you can achieve impressive performance on consumer hardware.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
- 👨💻 Reddit r/LocalLLaMA - RTX 3090 Qwen Discussion
- 👨💻 Qwen 2.5 Model Card
- 👨💻 llama.cpp Documentation
- 👨💻 vLLM Documentation
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments