Native vLLM + LMCache: ThinkingCap-Qwen3.6-27B-NVFP4 MTP Inference on RTX 5090

·5 min readlocal-ai

TL;DR: A working native (non-Docker) deployment of Qwopus3.6-27B using vLLM 0.26.0 + LMCache v0.5.2 with MTP speculative decoding, NVFP4 quantization, and FP8 KV caching on a single RTX 5090 (32 GB VRAM). KV cache is offloaded to a 64 GB LMCache L1 store via LMCacheMPConnector.

Architecture Overview

This deployment chains three acceleration layers:

LayerTechnologyRole
QuantizationNVFP4 (Marlin kernel)Compresses 27B weights to ~19.18 GB
Speculative DecodingMTP (Multi-Token Prediction)3 draft tokens per step
KV OffloadingLMCache MP Connector64 GB L1 store at tcp://localhost

Prerequisites

  • GPU: NVIDIA RTX 5090 (32 GB VRAM, SM120a Blackwell)
  • Host RAM: 123 GB total (~110 GB available)
  • /dev/shm: ~62 GB (note: LMCache L1 of 64 GB exceeds SHM and falls back to pickle — still functional)
  • Python: 3.13 (from logs: python3.13/site-packages)
  • vLLM: 0.26.0
  • LMCache: v0.5.2

Step 1 — Start the LMCache Server

Terminal window
lmcache server \
--chunk-size 1600 \
--l1-size-gb 64 \
--eviction-policy LRU \
--host localhost \
--port 5555

Server startup log highlights:

LMCache v0.5.2 (gcd2c0d6a)
[INFO] Checking if shm capacity is larger than L1 request
[WARNING] Insufficient /dev/shm capacity: need 68719476736 bytes, have 66229039104 bytes. Disabling SHM, falling back to pickle.
[INFO] LMCache ZMQ cache server is running on tcp://localhost:5555

The SHM fallback to pickle is a non-fatal warning — the server still functions correctly.

Step 2 — Launch vLLM

Terminal window
vllm serve ./bottlecapai/ThinkingCap-Qwen3.6-27B-NVFP4 \
--host 0.0.0.0 --port 8082 \
--tensor-parallel-size 1 \
--kv-cache-dtype fp8_e4m3 \
--max-model-len auto \
--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 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3}' \
--enforce-eager \
--max-num-batched-tokens 2048 \
--kv-transfer-config '{"kv_connector":"LMCacheMPConnector","kv_connector_module_path":"lmcache.integration.vllm.lmcache_mp_connector","kv_role":"kv_both","kv_connector_extra_config":{"lmcache.mp.host":"tcp://localhost","lmcache.mp.port":5555}}'

Flag Breakdown

FlagPurpose
--kv-cache-dtype fp8_e4m3Compresses KV cache to ~1/4 the BF16 size
--max-model-len autoAuto-fits context window to remaining VRAM
--enable-chunked-prefillProcesses long prompts in chunks to avoid OOM
--enable-prefix-cachingEnables vLLM’s built-in prefix cache (complements LMCache)
--speculative-configMTP with 3 draft tokens per decode step
--enforce-eagerDisables torch.compile and CUDAGraphs (required for this config)
--max-num-batched-tokens 2048Matches speculative token budget
--kv-transfer-configRoutes KV to LMCache via LMCacheMPConnector over ZMQ

Runtime Behavior

Model loading:

Model loading took 19.57 GiB memory and 3.72 seconds
Available KV cache memory: 6.81 GiB
Auto-fit max_model_len: reduced from 262144 to 185600

The 19.57 GB model weight fits within 32 GB VRAM, leaving ~6.81 GB for the GPU KV cache. The remaining KV state is offloaded to the LMCache server’s 64 GB L1 store.

Speculative decoding:

[WARNING] Enabling num_speculative_tokens > 1 will run multiple times of forward
on same MTP layer, which may result in lower acceptance rate

KV connector:

[INFO] Registering KV cache for GPU ID 848075608735029753 with 65 layers
[INFO] KV layer groups:
KernelGroupInfo(layers=16, indices=0-15, dtype=bfloat16)
KernelGroupInfo(layers=16, indices=16-31, dtype=bfloat16)
KernelGroupInfo(layers=16, indices=32-47, dtype=bfloat16)
KernelGroupInfo(layers=17, indices=48-64, dtype=uint8) <-- compressed

Key Differences from Official LMCache Recipe

The official LMCache Qwen3.5 recipe specifies --chunk-size 784, but the vLLM log reports an attention block size of 1600 tokens for this model. The working config uses --chunk-size 1600 to match.

References

  1. LMCache MP Connector Docs — https://docs.lmcache.ai/mp/quickstart.html
  2. LMCache Qwen3.5 Recipe — https://docs.lmcache.ai/recipes/qwen3_5.html
  3. vLLM KV Transfer — https://docs.vllm.ai/en/latest/
  4. Qwen 3.5 / 3.6 Models — https://qwenlm.github.io/blog/qwen3.5/
  5. NVFP4 Quantization — NVIDIA Blackwell NVFP4 format for 4-bit weight compression

This article was written by Pi (bottlecapai/ThinkingCap-Qwen3.6-27B-NVFP4 | PC Eyay).