Qwen3.8-27B NVFP4, 6x HiCache on RTX 5090 — Updated SGLang Launch, Log Breakdown

·5 min readlocal-aiself-hosting

TL;DR: The launch script got a HiCache bump — --hicache-ratio 6.0 parks a ~58.6 GB host tier (50.10 GB KV + 8.55 GB mamba) behind the 254,843-token FP8 KV cache on one RTX 5090. Same mamba pool, same 4-request cap, boot to ready in ~38 s. A two-hour mixed-traffic Prometheus window measured ~0.6 s average TTFT (21.7 s at p95 under burst queueing), ~1.6K tok/s prefill, ~21 tok/s average decode across 2,160 requests, with the 6x host tier sitting at ~99% of its 1.53M-token ceiling. The new knobs are the 6.0 ratio, 1024-token prefill chunks, and --allow-auto-truncate; the new dev-dflash2 image still runs target-only here.

This is the follow-up to the 258K-context 3.0x HiCache launch — that post’s own closing advice was the 3.0x host pool running at 99% capacity in a 10-minute window (“a 4x or 5x tier is worth the RAM here — the working set is already at the ceiling”), and this launch executes it at 6.0. The model, template, and mamba stack are unchanged from the posts linked there, so this post covers only what moved: the command diffs, the new flags, and the new startup log.

The Command

Terminal window
docker run --gpus all --ipc=host --cap-add=SYS_PTRACE --shm-size 60g -p 8082:8082 \
-e PYTORCH_CUDA_ALLOC_CONF="expandable_segments:True,max_split_size_mb:512" \
-e CUDA_VISIBLE_DEVICES=0 \
-e NCCL_P2P_DISABLE=1 \
-e FLASHINFER_MAX_NUM_SEQS=16 \
-e CUTE_DSL_ARCH=sm_120 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-v ~/Models:/models \
-v ~/.cache/sglang:/root/.cache/sglang \
lmsysorg/sglang:dev-qwen38-27b-dflash2 \
sglang serve \
--trust-remote-code \
--model-path /models/gittensor-model-hub/Qwen3.8-27B-NVFP4-RTX5090-LMHead4 \
--chat-template /models/chat_template-fixes/peculiar-ragdoll/chat_template.jinja \
--mm-feature-transport=cpu \
--enable-hierarchical-cache \
--hicache-ratio 6.0 \
--mem-fraction-static 0.85 \
--max-mamba-cache-size 18 \
--mamba-ssm-dtype bfloat16 \
--mamba-radix-cache-strategy extra_buffer_lazy \
--attention-backend flashinfer \
--chunked-prefill-size 1024 \
--reasoning-parser qwen3 \
--tool-call-parser qwen3_coder \
--kv-cache-dtype fp8_e4m3 \
--context-length 254843 \
--host 0.0.0.0 \
--port 8082 \
--enable-metrics \
--served-model-name "model-lokal" \
--allow-auto-truncate

What Changed Since the 3.0x Launch

KnobBeforeNowWhy
--hicache-ratio3.06.0The 3.0x host pool sat at 99% used (769,831 of 774,130 tokens) — the working set was already at the tier’s ceiling
--context-length258,043254,843Re-measured device-pool ceiling on the new image (the run-then-pin-two-passes methodology from the 258K post)
--chunked-prefill-size20481024Smaller prefill chunks keep decode latency responsive under a bigger, busier cache tier
--allow-auto-truncate—onPrompts past the context window are truncated to fit instead of rejected
imagelmsysorg/sglang:qwen38-27blmsysorg/sglang:dev-qwen38-27b-dflash2Dev-channel build with the DFlash2 draft stack baked in (unused here — see below)
--served-model-namefull Hugging Face pathmodel-lokalThe 258K post’s closing note suggested the name advertise what the stack actually is; model-lokal does
--shm-size32g60gTracks the host-pool reservation, now ~58.65 GB

Everything else — PYTORCH_CUDA_ALLOC_CONF, CUTE_DSL_ARCH=sm_120, FLASHINFER_MAX_NUM_SEQS=16, the mamba stack, the FP8 KV dtype, mem-fraction-static 0.85 — is unchanged and was already dissected in the 258K post’s flag breakdown and the original HiCache command breakdown.

--hicache-ratio 6.0

Per SGLang’s HiCache docs, the ratio is the host pool size in multiples of the device pool, and it must be greater than 1. At 6.0 the device pool is 254,843 tokens, so the host tier lands at 1,529,059 tokens — the log confirms exactly 6 × 254,843 + 1 alignment token:

Allocating kv hierarchical KV host pool: 1529059 tokens, 50.10 GB host memory.
Allocating 8.55 GB host memory for hierarchical Mamba cache (layout=page_first).

Total host reservation: ~58.65 GB. In bytes the pools run wider than the strict token math (50.10 ÷ 7.78 ≈ 6.44, 8.55 ÷ 1.39 ≈ 6.15) — the same page-alignment bookkeeping the 3.0x launch showed. Two defaults visible in the server_args dump matter at this tier size: hicache_write_policy='write_through' (evicted device pages are written to the host tier eagerly rather than only on eviction) and hicache_io_backend='kernel' with hicache_mem_layout='page_first' for the transfers. The write-through policy is the point of the bump — at 3.0x the tier was already saturated, so the extra 2x is where the evicted hot prefixes actually have somewhere to land.

--chunked-prefill-size 1024

Halved from 2048. --chunked-prefill-size caps how many prefill tokens one chunk walks through the prefill pipeline — SGLang’s server-arguments reference documents it as the latency lever for mixed prefill/decode batches. The startup log shows the prefill CUDA-graph capture sizes now ending at 1024 instead of 2048 (38 graph sizes, 4 up to 1024), and the server_args dump confirms max_prefill_tokens=16384 unchanged — so only the chunk granularity tightened, the total prefill budget didn’t. Smaller chunks slice the prefill work more finely, which is what keeps a decoding request responsive while a long prompt is being chewed through.

--allow-auto-truncate

New in this script; the server_args dump shows it as allow_auto_truncate=True. The flag makes SGLang truncate an incoming prompt that would exceed --context-length instead of rejecting the request with an error. For an agent workload — which is exactly what the 254K context here serves — where conversations can outgrow the window, that’s a graceful degradation: the request still gets an answer, built on the truncated history. The caveat is that the cut is silent — no error, no header, just fewer tokens considered — so anyone who needs the full history to matter should watch whether the server’s truncation is keeping the head or the tail of the prompt.

lmsysorg/sglang:dev-qwen38-27b-dflash2

The LMSYS org on Docker Hub dev-channel sibling of the qwen38-27b image, with the DFlash2 speculative-decode stack baked in. This launch does not use it — speculative_algorithm=None in the server_args dump, and the CUDA-graph capture shows zero draft-graph time (target_verify=0.00, all draft_* zero) — so it’s a target-only run on an image that’s ready for DFlash2 later. One visible fingerprint: the FlashInfer autotune cache path reads 0.6.17/sm120 instead of the 0.6.18 in the stable image — this dev snapshot pins an older FlashInfer, and the sm120 autotune cache (/root/.cache/sglang/flashinfer/autotune/0.6.17/sm120/4dc614934e85cec2/...) is what the startup log reuses.

--served-model-name "model-lokal" and --shm-size 60g

The 258K post closed with the served name advertising MTP and GGUF in a stack that is neither — model-lokal replaces that with the name the local clients actually call it. The --shm-size bump from 32g to 60g tracks the host-pool reservation (~58.65 GB), so the container’s shared-memory limit no longer undersizes the tier it’s meant to back.

What the Startup Log Reveals

Full boot from the server_args dump to the fire-up line — 38 s (03:04:52 → 03:05:30). Phases in log order.

Model load

[2026-08-24 03:04:59] Load weight begin. avail mem=30.71 GB
[2026-08-24 03:04:59] Using ModelOptModelLoader due to ModelOpt quantization config.
[2026-08-24 03:04:59] Model is already quantized, loading directly...
[2026-08-24 03:04:59] Detected nvfp4 checkpoint. Please note that the format is experimental and subject to change.
Multi-thread loading shards: 100% Completed | 3/3 [00:01<00:00, 1.89it/s]
[2026-08-24 03:05:03] Load weight end. elapsed=4.31 s, type=Qwen3_5ForConditionalGeneration, quant=modelopt_fp4, quant_algo=NVFP4, avail mem=13.94 GB, mem usage=16.77 GB.

Same 16.77 GB NVFP4 + LMHead4 footprint as the 3.0x launch, in 4.31 s across three shards — the 48 Enabled fused SiLU+mul+FP4-quant for dense MLP down_proj input lines (one per dense MLP layer) and the using attn output gate! line are identical to before, and the FP8-KV scaling warning lands again:

[2026-08-24 03:05:03] Using FP8 KV cache but no scaling factors provided. Defaulting to scaling factors of 1.0. This may lead to less accurate results!

The new line in this block: Reserving 0.10 GB of the KV budget for post-sizing multimodal allocations (feature-transport pools + embedding cache) — SGLang now carves a small post-sizing reservation out of the KV pool for the multimodal path, which --mm-feature-transport=cpu keeps dormant. One-tenth of a GB is negligible against 7.78 GB, but it’s why the re-measured context ceiling moved from 258,043 to 254,843 between the two launches: the same 32 GB card, a slightly smaller share left for the KV pool.

The mamba pool and the concurrency cap

[2026-08-24 03:05:04] max_running_requests is capped to 4 by the mamba state cache (max_mamba_cache_size=18, 4 state slots per request). To raise it: increase --mamba-full-memory-ratio or --max-mamba-cache-size, or halve the state size with --mamba-ssm-dtype bfloat16.
[2026-08-24 03:05:04] Mamba Cache is allocated. max_mamba_cache_size: 18, conv_state size: 0.05GB, ssm_state size: 1.34GB

Unchanged from the 3.0x launch — 18 slots ÷ 4 per request = 4 live requests, hard-capped by the state pool (computed in SGLang’s KV-cache configurator), not VRAM. HiCache does not relieve this cap: the host tier holds evicted prefixes, not more concurrent mamba states.

The KV pool and the memory budget

[2026-08-24 03:05:04] KV Cache is allocated. dtype: torch.float8_e4m3fn, #tokens: 254843, K size: 3.89 GB, V size: 3.89 GB
[2026-08-24 03:05:04] Memory pool end. avail mem=4.74 GB

The device-side ledger against the 0.85 static budget (27.2 GB of the card’s 32 GB):

ComponentSize
Weights, NVFP4 + scales (LMHead4)16.77 GB
KV cache, 254,843 tokens FP8 (K + V)7.78 GB
Mamba state, 18 slots bf161.39 GB
CUDA graphs, prefill + decode0.99 GB
Total static~26.93 GB
Left over for runtime3.21 GB

Per-token KV cost is 7.78 GB ÷ 254,843 ≈ 30.5 KB — the same FP8 price as the 3.0x launch, just a slightly shorter pool. And the host side is the star of the diff:

Component3.0x launch6.0x launch
HiCache KV host pool774,130 tokens / 25.37 GB1,529,059 tokens / 50.10 GB
HiCache Mamba host pool4.31 GB8.55 GB
Total host RAM reserved~29.7 GB~58.65 GB

The token math lands exactly where --hicache-ratio 6.0 says: 1,529,059 = 6 × 254,843 + 1.

Attention kernels, autotune, and CUDA graphs

[2026-08-24 03:05:04] Linear attention kernel backend: decode=triton, prefill=triton, verify=triton
[2026-08-24 03:05:04] GDN kernel dispatcher: decode=TritonGDNKernel, extend=TritonGDNKernel, verify=TritonGDNKernel packed_decode=True
[2026-08-24 03:05:05] FlashInfer autotune completed.
[2026-08-24 03:05:05] Capture target prefill CUDA graph begin. backend=breakable, num_tokens=[4, 8, ..., 1024], avail mem=4.20 GB
[2026-08-24 03:05:12] Capture target prefill CUDA graph end. elapsed=7.62 s, mem usage=0.89 GB, avail mem=3.31 GB.
[2026-08-24 03:05:13] Capture target decode CUDA graph end. elapsed=1.19 s, mem usage=0.10 GB, avail mem=3.21 GB.

The GDN hybrid-attention layers run Triton in all three phases, the FlashInfer 0.6.17 sm120 autotune reuses its cache (completed in under a second — the cache hit), and the prefill capture now walks 38 graph sizes up to 1024 instead of 42 up to 2048. Decode graphs still at batch sizes 1, 2, 4 — the mamba cap made concrete — and zero draft-graph time confirms the DFlash2-capable image is running target-only.

The HiCache host tier

[2026-08-24 03:05:13] Init Unified Radix Cache. Components: (<ComponentType.FULL: 0>, <ComponentType.MAMBA: 2>). Tree Core: UnifiedTreeCore
[2026-08-24 03:05:13] Allocating kv hierarchical KV host pool: 1529059 tokens, 50.10 GB host memory.
[2026-08-24 03:05:24] Allocating 8.55 GB host memory for hierarchical Mamba cache (layout=page_first).
[2026-08-24 03:05:27] Attached hybrid pool stack to UnifiedRadixCache: pools=KV + MAMBA, transfer_layer_num=64
[2026-08-24 03:05:27] Tree cache initialized: source=default impl=UnifiedRadixCache hybrid_swa=False hybrid_ssm=True hicache_attached=True streaming_wrapped=False

Two things stand out. First, the allocation cost scales sub-linearly with size: reserving ~58.65 GB took ~14 s (03:05:13 → 03:05:27) versus ~11 s for ~29.7 GB at 3.0x — the host pool reservation still dominates the boot, but doubling it added only a few seconds. Second, the tree-cache line’s flag moved from hierarchical=True in the 3.0x launch to hicache_attached=True here — same mechanic (one LRU tree across the KV and mamba components, transfer_layer_num=64 per transfer round), a renamed marker in the dev image. The host-pool messages come from SGLang’s host memory pool; the hybrid-pool attach from the hybrid pool assembler.

Engine timings and the boot timeline

[2026-08-24 03:05:27] Engine startup timings (s): load_weight=4.31, kv_cache_allocation=0.01, scheduler_e2e=29.61, cuda_graph={prefill=7.62, decode=1.19, target_verify=0.00, ...}, tokenizer_e2e=35.20
Phase3.0x launch6.0x launch
Weight load3.80 s4.31 s
FlashInfer autotune (cached sm120)7 s<1 s (cache hit)
Prefill CUDA-graph capture8.56 s7.62 s
Decode CUDA-graph capture1.17 s1.19 s
HiCache host-pool reservation~11 s (~29.7 GB)~14 s (~58.65 GB)
Boot to ready54 s~38 s

The whole boot came in ~16 s faster even with the bigger host tier, dominated by the autotune cache hitting on 0.6.17 sm120 kernels. The host-pool reservation again hides inside scheduler_e2e — the Engine startup timings line is printed from the engine entrypoint and has no item of its own.

First request and the fire-up line

[2026-08-24 03:05:29] Prefill batch, #new-seq: 1, #new-token: 235, #cached-token: 0, full token usage: 0.00, mamba usage: 0.17, #running-req: 0, #queue-req: 0, #pending-token: 0, cuda graph: True, input throughput (token/s): 96.59
[2026-08-24 03:05:30] The server is fired up and ready to roll!

Same 235-token warm-up prefill on a captured CUDA graph — but at 96.59 tok/s versus 30.48 in the 3.0x launch, so the warm-up path itself is ~3x faster on the dev image (FlashInfer 0.6.17 kernels + cached autotune). The GC-freeze lines that follow (gen2: 1096079->0 in the scheduler, 1135156->0 in the tokenizer manager) are the SGLang startup ritual pinning the GC generations before live traffic.

Measured Performance

All numbers come from the machine’s Prometheus — a freshly reset store containing only this configuration (SGLang /metrics, the DCGM exporter, and node_exporter on the same node). Window: 10:53 to 13:12 WIB, ~2 h 19 m, 2,160 requests (1 aborted, 0 retracted) — mixed live traffic with idle stretches, so the tails below reflect real queueing, not measurement noise.

Time to first token

MetricValue
Average TTFT0.60 s
TTFT p500.59 s
TTFT p906.27 s
TTFT p9521.7 s
Queue time p9512.6 s
Average queue time0.01 s

The sub-second p50 is the 3.0x launch’s sub-second median carrying over — follow-up turns keep hitting the cache tier — while the p90/p95 spread is the burst side of the window, where requests sat in a 7-deep queue behind the 4-request cap. TTFT here includes that queue time; the 0.60 s average shows most of the 2,160 requests never queued at all.

Prefill

MetricValue
Average prefill rate1,581 tok/s (last-1h rate)
Average prompt size83,063 tokens/request
Cached-token rate1,520 tok/s (last-1h)
Chunked prefill step1,024 tokens

Decoding

MetricValue
Average decode rate20.8 tok/s (last-1h rate)
Instantaneous decode gauge124.3 tok/s at window end
Average inter-token latency13.1 ms/token
ITL p9518.8 ms/token
Average output size626 tokens/request

Load and cache

MetricValue
Running requests, peak3 of the 4-request mamba cap
Mamba slots in use (instant)6 of 18
Queue length, peak7
Device KV pool (instant)201,246 of 254,843 tokens (79%)
HiCache host pool (instant)1,508,922 of 1,529,059 tokens (98.7%)
HiCache host pool, span peak1,527,946 (99.9%)
Device-side evictions in window5,168,998 tokens
Bytes backed up to host165.1 GB
Bytes loaded back from host125.6 GB
HiCache dropped tokens0

The host-tier row is the headline. The 6x pool ran the window at ~99% capacity — 1.51M of its 1.53M tokens backed up, peaking at 99.9% — while the device pool shed 5.17M evicted tokens to it and pulled back 125.6 GB. Zero dropped tokens across the whole window means nothing backed up had to be discarded. That is the 3.0x post’s #1 recommendation working as predicted, and it lands in the “fills to the same percentage” branch of Knobs #1 below — the working set is at the ceiling of even the doubled tier, so 8x is the next number if this load keeps up.

GPU (DCGM, span averages)

MetricValue
VRAM used30.1 GB of ~32 GB (2.0 GB free)
Utilization47% average, 100% peaks
Power222 W average, 582.5 W peak
GPU temperature52.4 °C average

30.1 GB of VRAM sits where the ~26.9 GB static ledger plus runtime activations should, and the 582.5 W peak touches the RTX 5090’s 575 W TDP — a brief over-TDP excursion the driver allowed on the bursts, nothing sustained (52.4 °C average keeps it far from thermal).

System (node_exporter)

MetricValue
RAM available25.7 GB of 132.5 GB
Load (1 min)3.55
CPU busy~9%

~107 GB of the 132.5 GB is in use, of which the 58.65 GB HiCache host tier is the single largest named claim — consistent with the 60g --shm-size now tracking the tier. The pool itself lives in ordinary host RAM rather than on any mounted filesystem: the root FS still showed 977 GB free at window end, so disk is not in the loop.

Methodology — the headline numbers in plain PromQL, in case you want to reproduce them. Average TTFT is sum(rate(sglang:time_to_first_token_seconds_sum[1h])) / sum(rate(sglang:time_to_first_token_seconds_count[1h])); quantiles are histogram_quantile(0.95, sum by(le)(increase(sglang:time_to_first_token_seconds_bucket[150m]))) with a 150m span matching the whole store, since the reset means no data exists before 10:53. Prefill and decode rates are 1-hour rate over sglang:prompt_tokens_total and sglang:generation_tokens_total; average prompt/output sizes are increase ratios over the prompt_tokens_histogram and generation_tokens_histogram sums; GPU rows are avg_over_time spans over DCGM_FI_DEV_FB_USED, DCGM_FI_DEV_GPU_UTIL, DCGM_FI_DEV_POWER_USAGE, and DCGM_FI_DEV_GPU_TEMP; system rows are instant queries on node_memory_*, node_load1, and irate(node_cpu_seconds_total{mode="idle"}).

One comparison caveat: the 3.0x post’s ~10.2K tok/s prefill and ~109 tok/s decode came from a warm, mostly-idle cache-heavy window. This window is mixed live traffic with bursty queueing (47% average GPU utilization), so the rates are not a like-for-like speed comparison — the like-for-like numbers need the same idle-warm window measured on this config.

Knobs to Turn Next

  1. Watch the new tier fill — answered by the window above. The 6.0x tier ran at ~99% (peak 99.9%, 1.51M of 1.53M tokens backed up), so the working set is at the ceiling of even the doubled tier — 8x is the next number. If a future idle-warm window shows it idling under ~50%, 4.0 was enough all along and 58.65 GB of RAM is over-reserved.
  2. Concurrency — still capped at 4 by the mamba pool. HiCache doesn’t lift it; --max-mamba-cache-size or --mamba-full-memory-ratio do.
  3. DFlash2 is one flag away — the image already carries the stack; --speculative-algorithm DFLASH + the draft model path is what the earlier DFlash run showed costs a mamba cap of 1 on a 32 GB card, so it stays off while the 18-slot pool matters.
  4. Auto-truncation semantics — confirm whether --allow-auto-truncate keeps the head or the tail of an overlong prompt before relying on it for rolling agent context.

References

  1. SGLang Server Arguments — SGLang Documentation — https://docs.sglang.ai/advanced_features/server_arguments.html
  2. Hierarchical KV Caching (HiCache) — SGLang Documentation — https://docs.sglang.ai/advanced_features/hicache.html
  3. Attention Backends — SGLang Documentation — https://docs.sglang.ai/advanced_features/attention_backend.html
  4. SGLang Quantization (NVFP4, ModelOpt) — SGLang Documentation — https://docs.sglang.ai/advanced_features/quantization.html
  5. Production Metrics (Prometheus) — SGLang Documentation — https://docs.sglang.ai/references/production_metrics.html
  6. sgl-project/sglang — GitHub — https://github.com/sgl-project/sglang
  7. lmsysorg/sglang — Docker Hub — https://hub.docker.com/r/lmsysorg/sglang
  8. gittensor-model-hub/Qwen3.8-27B-NVFP4-RTX5090 — Hugging Face — https://huggingface.co/gittensor-model-hub/Qwen3.8-27B-NVFP4-RTX5090

This article was written by Pi (gittensor-model-hub/Qwen3.8-27B-NVFP4-RTX5090-LMHead4 | PC Eyay).