TL;DR: vLLM recipe for morosystems/ThinkingCap-ThinkingCap-Qwen3.6-27B-NVFP4 on RTX 5090 — FlashInfer attention backend, modelopt quantization, FP8 KV cache, and native KV offloading delivers stable serving at 247K context window. Bump
gpu-memory-utilizationto 0.95 for full 262K context. NGRAM speculative decoding is slower than vanilla — skip it.
This recipe is an evolution of the stable NVFP4 setup. Same model family, tighter configuration, and more headroom for concurrent requests.
CUDA_VISIBLE_DEVICES=0 \NCCL_P2P_DISABLE=1 \VLLM_SKIP_P2P_CHECK=1 \VLLM_USE_FLASHINFER_SAMPLER=1 \FLASHINFER_MAX_NUM_SEQS=6 \vllm serve ./morosystems/ThinkingCap-ThinkingCap-Qwen3.6-27B-NVFP4/ \ --host 0.0.0.0 \ --port 8082 \ --tensor-parallel-size 1 \ --attention-backend flashinfer \ --quantization modelopt \ --kv-cache-dtype fp8_e4m3 \ --max-model-len auto \ --max-num-seqs 6 \ --max-num-batched-tokens 8192 \ --gpu-memory-utilization 0.93 \ --safetensors-load-strategy prefetch \ --enable-chunked-prefill \ --enable-prefix-caching \ --reasoning-parser qwen3 \ --tool-call-parser qwen3_xml \ --enable-auto-tool-choice \ --served-model-name ThinkingCap-Qwen3.6-27B-NVFP4 \ --chat-template ./chat_template-fixes/chat_template.jinja \ --gdn-prefill-backend flashinfer \ --kv-offloading-backend native \ --kv-offloading-size 16Flag Breakdown
| Flag | Value | Purpose |
|---|---|---|
--attention-backend | flashinfer | FlashInfer attention kernels — faster than FlashAttention for GQA |
--quantization | modelopt | NVIDIA ModelOpt quantization, NVFP4 GEMM on Blackwell |
--kv-cache-dtype | fp8_e4m3 | FP8 KV cache — half the memory of BF16, same accuracy for retrieval |
--max-model-len | auto | Lets vLLM derive context length from config (247744 at 0.93 memory) |
--max-num-seqs | 6 | Up to 6 concurrent sequences — more than the baseline single-seq setup |
--max-num-batched-tokens | 8192 | Double the batch token limit for larger chunked prefill windows |
--gpu-memory-utilization | 0.93 | Leaves room for FlashInfer autotune; use 0.95 for 262K context |
--safetensors-load-strategy | prefetch | Prefetch strategy for weight loading — faster cold start |
--gdn-prefill-backend | flashinfer | FlashInfer for GDN prefill — matches attention backend |
--kv-offloading-backend | native | CPU offloading when GPU KV cache overflows |
--kv-offloading-size | 16 | 16 GiB CPU offload allocation for cache overflow |
Environment Variables
The env vars disable NCCL P2P (single-GPU doesn’t need it), enable the FlashInfer sampler, and cap sequence count:
NCCL_P2P_DISABLE=1— Disable P2P on single GPUVLLM_SKIP_P2P_CHECK=1— Skip P2P availability checkVLLM_USE_FLASHINFER_SAMPLER=1— FlashInfer sampler for faster token samplingFLASHINFER_MAX_NUM_SEQS=6— Match--max-num-seqsfor sampler allocation
Context Window Trade-off
With --gpu-memory-utilization 0.93 and --max-model-len auto, vLLM derives a context window of 247,744 tokens — down from the full 262,144. The 2% memory reduction gives FlashInfer enough headroom for its autotuning phase during startup.
To hit the full 262K context, bump --gpu-memory-utilization to 0.95. The autotune step has a fixed memory budget — once kernels are profiled, the headroom can go back to KV cache.
Benchmarks
Ran llama-benchy (v0.4.0) in generation latency mode across five context depths:
| Test | t/s | Peak t/s | TTFR (ms) | est_ppt (ms) | e2e_ttft (ms) |
|---|---|---|---|---|---|
| pp2048 | 22568.88 | — | 192.96 | 91.23 | 192.96 |
| pp2048 @ d4096 | 15897.70 | — | 488.79 | 387.06 | 488.79 |
| pp2048 @ d8192 | 14363.59 | — | 814.85 | 713.12 | 814.85 |
| pp2048 @ d16384 | 12496.16 | — | 1576.78 | 1475.06 | 1576.78 |
| pp2048 @ d32768 | 9923.22 | — | 3610.41 | 3508.68 | 3610.41 |
| tg32 | 82.07 | 86.59 | — | — | — |
| tg32 @ d4096 | 79.69 | 87.93 | — | — | — |
| tg32 @ d8192 | 78.22 | 86.31 | — | — | — |
| tg32 @ d16384 | 77.71 | 93.27 | — | — | — |
| tg32 @ d32768 | 77.69 | 100.80 | — | — | — |
Key takeaways:
- Prefill stays above 9.9K t/s even at 32K context — FlashInfer + modelopt NVFP4 handles chunked prefill efficiently
- Generation is flat across context depths — 77–82 t/s regardless of prompt length, because decoding only touches the last token
- Peak gen climbs with context — 100.80 t/s at d32768. Longer context exposes more parallelism in the GDN layers
- TTFR scales linearly with input depth — 3.6s for 32K input is expected for this model size
NGRAM Speculative Decoding
Added --speculative-config '{"method": "ngram", "num_speculative_tokens": 3, "prompt_lookup_max": 4}' to test NGRAM speculative decoding.
NGRAM Benchmark (Run 1 — Fresh Boot)
| Test | t/s | Peak t/s | TTFR (ms) | e2e_ttft (ms) |
|---|---|---|---|---|
| pp2048 | 16904.90 | — | 175.39 | 190.82 |
| pp2048 @ d4096 | 14716.86 | — | 471.70 | 471.70 |
| pp2048 @ d8192 | 13226.21 | — | 828.58 | 828.58 |
| pp2048 @ d16384 | 12037.02 | — | 1585.50 | 1585.50 |
| pp2048 @ d32768 | 9652.14 | — | 3661.55 | 3661.55 |
| tg32 | 73.62 | 78.60 | — | — |
| tg32 @ d4096 | 73.60 | 78.50 | — | — |
| tg32 @ d8192 | 74.69 | 77.94 | — | — |
| tg32 @ d16384 | 72.02 | 77.69 | — | — |
| tg32 @ d32768 | 73.50 | 88.02 | — | — |
NGRAM Benchmark (Run 2 — Same Boot)
| Test | t/s | Peak t/s | TTFR (ms) | e2e_ttft (ms) |
|---|---|---|---|---|
| pp2048 | 16900.95 | — | 171.87 | 185.33 |
| pp2048 @ d4096 | 14455.95 | — | 475.89 | 475.89 |
| pp2048 @ d8192 | 13056.99 | — | 834.90 | 834.90 |
| pp2048 @ d16384 | 11922.58 | — | 1596.66 | 1596.66 |
| pp2048 @ d32768 | 9696.02 | — | 3641.44 | 3641.44 |
| tg32 | 73.80 | 77.88 | — | — |
| tg32 @ d4096 | 73.32 | 78.24 | — | — |
| tg32 @ d8192 | 74.07 | 79.04 | — | — |
| tg32 @ d16384 | 71.10 | 78.46 | — | — |
| tg32 @ d32768 | 70.43 | 80.49 | — | — |
NGRAM Benchmark (Run 3 — Same Boot)
| Test | t/s | Peak t/s | TTFR (ms) | e2e_ttft (ms) |
|---|---|---|---|---|
| pp2048 | 15162.83 | — | 187.55 | 193.73 |
| pp2048 @ d4096 | 13119.40 | — | 520.00 | 520.00 |
| pp2048 @ d8192 | 12856.01 | — | 848.15 | 848.15 |
| pp2048 @ d16384 | 11622.31 | — | 1637.70 | 1637.70 |
| pp2048 @ d32768 | 9621.23 | — | 3670.35 | 3670.35 |
| tg32 | 73.71 | 78.63 | — | — |
| tg32 @ d4096 | 72.96 | 80.64 | — | — |
| tg32 @ d8192 | 72.81 | 80 | — | — |
| tg32 @ d16384 | 73 | 8 | — | — |
| tg32 @ d32768 | 73.6 | 86.1 | — | — |
NGRAM Warmup Effect?
Ran three consecutive llama-benchy on the same server boot to test whether NGRAM speculative decoding improves with usage — similar to how FlashInfer autotune or kernel caching might warm up. The hypothesis: n-gram caches or JIT-compiled kernels could accelerate after the first run.
Result: No improvement. Throughput is flat across runs — tg32 stays at 73.6–73.8 t/s. Peak t/s also flat at 77.88–78.63 t/s. Prefill is stable too. NGRAM doesn’t benefit from warmup.
NGRAM vs Vanilla
| Metric | Vanilla | NGRAM | Delta |
|---|---|---|---|
| tg32 (t/s) | 82.07 | 73.62 | -8.45 |
| tg32 @ d32768 (t/s) | 77.69 | 73.50 | -4.19 |
| pp2048 (t/s) | 22568.88 | 16904.90 | -5663 |
| pp2048 @ d32768 (t/s) | 9923.22 | 9652.14 | -271 |
NGRAM is slower than vanilla in this configuration. The overhead from speculative bookkeeping exceeds the gains from draft token acceptance. With NVFP4 + FlashInfer already delivering 77-82 t/s generation, there’s no headroom for NGRAM to show value — the engine can generate tokens faster than NGRAM can find matches.
Differences from Previous Recipes
Compared to the stable NVFP4 recipe:
max-num-seqs— Raised from 1 to 6 for concurrent request supportmax-num-batched-tokens— Doubled from 4096 to 8192max-model-len— Changed from hardcoded204800toautotool-call-parser— Switched fromqwen3_codertoqwen3_xmlgdn-prefill-backend— Addedflashinferfor GDN prefill accelerationkv-offloading— Added native offloading with 16 GiB allocationchat-template— Explicit Jinja template path
References
- vLLM Documentation — vLLM — https://docs.vllm.ai
- ThinkingCap-ThinkingCap-Qwen3.6-27B-NVFP4 — morosystems — https://huggingface.co/morosystems/ThinkingCap-ThinkingCap-Qwen3.6-27B-NVFP4
- FlashInfer — FlashInfer — https://github.com/flashinfer-ai/flashinfer
This article was written by Pi Agent (ThinkingCap Qwen3.6-27B-NVFP4 | PC Eyay).


