v.1.1 Update (Aug 20): Memory settings bumped —
--context-lengthto 165,201 and--mem-fraction-staticto 0.9. The larger static budget grows the FP8 KV pool beyond its 135,360-token size, and the context pin follows the pool’s new exact size, so the whole pool is usable instead of leaving slack on the table. Tested under load and running well; the command in this post is the v.1.1 config. The prefill graph gate stays standing down — the extra fraction spends the headroom the gate was already short of. Re-read the closing summary line after a boot on any other machine (max_total_num_tokens=...) and re-pin--context-lengthto the pool if it lands elsewhere.
TL;DR: The
lmsysorg/sglangDocker image runs the NVFP4 target + DSpark drafter stack with a 135,360-token FP8 KV pool pinned to the pool’s exact size, 4,096-token prefill chunks, and an 8-slot mamba radix cache on one 32 GB RTX 5090 — warm draft load takes 1.23 s, total boot is ~31 s, and the prefill CUDA graph is auto-disabled because 3.71 GiB of headroom falls short of the 4.00 GiB capture gate.
This is the Dockerized sibling of the host-venv DSpark launch — same 5090, same lmsysorg-flavored engine, same drafter — with the engine pinned to a released image and the model and cache volumes mounted in. The startup log is where the interesting parts live, so this post walks the command, then the log.
The Command
docker run --gpus all --ipc=host --shm-size 32g -p 8082:8082 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ -v ~/Models:/models \ -v ~/.cache/sglang:/root/.cache/sglang \ lmsysorg/sglang:qwen38-27b \ sglang serve \ --model-path /models/gittensor-model-hub/Qwen3.8-27B-NVFP4-RTX5090 \ --speculative-algorithm DSPARK \ --speculative-draft-model-path gittensor-model-hub/Qwen3.8-27B-DSpark-NVFP4 \ --speculative-draft-model-quantization modelopt_fp4 \ --speculative-dspark-block-size 7 \ --trust-remote-code --tp-size 1 \ --context-length 165201 --kv-cache-dtype fp8_e4m3 \ --attention-backend flashinfer --chunked-prefill-size 4096 \ --mamba-radix-cache-strategy extra_buffer_lazy \ --mamba-ssm-dtype bfloat16 \ --max-mamba-cache-size 8 \ --mm-feature-transport cpu \ --cuda-graph-max-bs-decode 1 \ --mem-fraction-static 0.9 --max-running-requests 2 \ --reasoning-parser qwen3 --tool-call-parser qwen3_coder \ --host 0.0.0.0 --port 8082 --enable-metrics \ --served-model-name "Qwopus3.6-27B-v2-MTP-NVFP4-GGUF.gguf"One asymmetry before the flag tour: the target path is the absolute mount path (/models/...), while the draft path is the bare hub identifier (gittensor-model-hub/Qwen3.8-27B-DSpark-NVFP4). The first container boot paid the hub fetch for that identifier; the shared HF cache volume persists the result, so this boot reads the drafter back from disk in just over a second.
The Docker Wrapper
| Flag | Purpose |
|---|---|
--gpus all | Exposes every NVIDIA GPU to the container; with --tp-size 1 the engine still binds to one. |
--ipc=host | Shares the host IPC namespace. Lets the engine use host shared memory for inter-process buffers without an in-container IPC cap. |
--shm-size 32g | Raises the in-container /dev/shm from its 64 MiB default. Matters for the multimodal workers (“Multimodal data loading enabled with 16 worker threads”) and any shm-backed dataloader. |
-v ~/.cache/huggingface:/root/.cache/huggingface | Shares the host HF cache so the 27B target and the hub-fetched drafter load from disk, not over the wire. |
-v ~/Models:/models | The model mount — the target path resolves against it. The draft path does not. |
-v ~/.cache/sglang:/root/.cache/sglang | SGLANG_CACHE_DIR out of the container — FlashInfer autotune results and compiled-kernel caches survive image rebuilds and rebuilds of the in-container cache. |
-p 8082:8082 | Publishes the OpenAI-compatible API and the Prometheus endpoint on the host. |
lmsysorg/sglang:qwen38-27b | A Qwen-tuned engine image — CUDA 13.0.3 per the banner, FlashInfer 0.6.18 per the autotune cache path. |
Flag Breakdown
--speculative-algorithm DSPARK with block size 7
The same DSpark drafter family as the previous post: a Qwen3DSparkModel with a lightweight Markov transition head proposes a 7-token block that the target verifies in one fused pass. The runner initialization stamps it:
[2026-08-20 02:25:31] Initialized DSpark draft runner. attention_backend=flashinfer, model=Qwen3DSparkModel, gamma=7, verify_num_draft_tokens=8, mask_token_id=248077, markov_head=VanillaMarkovgamma=7 is the transition depth, and verify_num_draft_tokens=8 is the 7-token proposal plus one — the engine verifies one token more than the draft proposes. --speculative-dspark-block-size 7 is the explicit spelling of gamma; --speculative-draft-model-quantization modelopt_fp4 tells the loader to run the draft through the ModelOpt path (the log confirms: quant=modelopt_fp4, quant_algo=NVFP4 on the draft).
--context-length 135360 with --kv-cache-dtype fp8_e4m3
The dump confirms the pin: context_length=135360. The closing summary shows how it interacts with the pool:
[2026-08-20 02:25:46] max_total_num_tokens=135360, chunked_prefill_size=4096, max_prefill_tokens=16384, max_running_requests=2, context_len=135360, available_gpu_mem=3.49 GBThe pin now matches the pool exactly: context_len equals max_total_num_tokens, so the config caps usable context at the pool’s full size instead of leaving slack on the table. Requests longer than 135,360 tokens are rejected at admission instead of queueing against a memory ceiling the scheduler would have hit anyway. Note the pool size is still an output of --mem-fraction-static 0.86 — the flag allocates no memory — so on a machine with a different free-memory layout the pool can land anywhere, and requests that exceed it simply queue.
--mamba-radix-cache-strategy extra_buffer_lazy with 8 slots
Qwen3.8-27B is a hybrid GDN model, so the radix cache carries a MAMBA component alongside the full-attention tree:
[2026-08-20 02:25:31] Mamba Cache is allocated. max_mamba_cache_size: 8, conv_state size: 0.02GB, ssm_state size: 0.63GB intermediate_ssm_state_cache size: 1.69GB intermediate_conv_window_cache size: 0.03GB[2026-08-20 02:25:46] Init Unified Radix Cache. Components: (<ComponentType.FULL: 0>, <ComponentType.MAMBA: 2>). Tree Core: UnifiedTreeCore[2026-08-20 02:25:46] Tree cache initialized: source=default impl=UnifiedRadixCache hybrid_swa=False hybrid_ssm=True hierarchical=False streaming_wrapped=Falseextra_buffer_lazy is the strategy from the HiCache launch — mamba state is checkpointed lazily with an extra intermediate buffer instead of eagerly at every track interval. --mamba-ssm-dtype bfloat16 halves the SSM state vs the default, and --max-mamba-cache-size 8 is one slot up from the 7 the engine auto-granted in the previous post. The tail’s mamba usage printout reads 0.50 — 4 of 8 slots — for the long-context request below, so 8 slots covers the two concurrent requests --max-running-requests 2 allows with room to spare.
--chunked-prefill-size 4096 and --mm-feature-transport cpu
Prefill is chunked at 4,096 tokens (the previous launch used the 2,048 default) — bigger chunks mean fewer scheduler passes over a long prompt, and the bump shows up as a faster prefill in the local Prometheus scrape. The log’s own prefill trace for a ~101,371-token request does 25 chunks in ~19 s, throughput decaying from 11.7k to ~3k token/s as the KV pool fills — the speed gain comes from the chunk shape, not from any gate change. --mm-feature-transport cpu routes extracted multimodal features over CPU instead of device IPC — a small transfer-speed cost in exchange for not reserving a GPU-side transfer pool on a card that is already at its ceiling.
--cuda-graph-max-bs-decode 1 with --max-running-requests 2 and --mem-fraction-static 0.86
Decode graphs capture at batch size 1 only (bs=[1] in the dump, backend='full'). With two requests allowed, single-stream decode is the only batch with a graph tier; a multi-stream batch would run eager, which is the mechanical cost of keeping the capture pool small. 0.86 of static memory fraction is what yields the 3.49 GB of final headroom shown in the ledger below; the same class of setting from the vLLM twin.
--enable-metrics
The dump confirms enable_metrics=True, so the Prometheus endpoint is live on 8082 alongside the chat API — the 100.89.98.50 probe in the tail can scrape it, and the /model_info warmup request returns 200.
--reasoning-parser qwen3 and --tool-call-parser qwen3_coder
Both were auto-detected, so the flags are belt-and-braces:
[2026-08-20 02:25:22] Auto-detected template features: reasoning_config=ReasoningToggleConfig(toggle_param='enable_thinking', default_enabled=True, special_case=None, effort_kwarg=None), reasoning_parser=qwen3, tool_call_parser=qwen3_coderThinking is on by default (enable_thinking toggles it off). Default sampling landed at temperature 1.0, top_k 20, top_p 0.95 from the model’s generation config.
--served-model-name "Qwopus3.6-27B-v2-MTP-NVFP4-GGUF.gguf"
The client-facing string — the same handle the vLLM twin served under, carried over verbatim. It is cosmetic but confusing: a .gguf name on an NVFP4 SGLang serving a 27B target. Anything that keys off the model name will see the GGUF string regardless of the actual precision or format.
What the Startup Log Reveals
Two checkpoints, two very different load times
| Checkpoint | Shards | Elapsed | VRAM used |
|---|---|---|---|
| Qwen3.8-27B-NVFP4 (target, mounted) | 3 | 3.92 s | 17.10 GB |
| Qwen3.8-27B-DSpark-NVFP4 (draft, warm hub cache) | 1 | 1.23 s | 1.44 GB |
The draft’s shard bar:
[2026-08-20 02:25:30] Load weight begin. avail mem=13.58 GBUsing model weights format ['*.safetensors']Multi-thread loading shards: 100% Completed | 1/1 [00:00<00:00, 1235.44it/s][2026-08-20 02:25:31] Load weight end. elapsed=1.23 s, type=Qwen3DSparkModel, quant=modelopt_fp4, quant_algo=NVFP4, avail mem=12.14 GB, mem usage=1.44 GB.The bare hub identifier in the draft path is unchanged since the first container boot, and that boot’s ~58 s hub fetch persisted through the shared HF cache volume, so this run reads the drafter back from disk — the same order of magnitude as the 0.51 s local-checkout load of the host-venv launch. The fetch was a one-time cost, not a per-boot one.
The prefill graph safety gate
[2026-08-20 02:25:38] Disabling auto-selected prefill CUDA graph: only 3.71 GiB is free after model/KV/eager-buffer allocation; at least 4.00 GiB is required for capture. Set an explicit prefill CUDA graph backend to override this safety gate.The engine measured 3.71 GiB of headroom after model, KV, and eager buffers — 290 MiB short of its own 4.00 GiB prefill-graph requirement — and stood down on its own. The full prefill graph tier is off; the dump keeps the breakable prefill tier (bs=[4, 8, ... 1024]). This is a measured safety gate, not an error, and it is the direct consequence of the pool sizes above plus --mem-fraction-static 0.86 — pinning the context to the pool’s exact size leaves the 290 MiB shortfall untouched, since the flag allocates no memory.
Boot timeline
| Phase | Duration |
|---|---|
| Config, tokenizer, multimodal init | ~7 s |
| Target weights (3 shards, mounted) | 3.92 s |
| Draft weights (1 shard, warm cache) | 1.23 s |
| Mamba + KV pool allocation | ~0.2 s |
| FlashInfer autotune (warm cache, fp4_gemm passes) | ~7 s |
| Target verify graph | 0.90 s |
| Draft verify graph (with a second autotune pass inside) | 6.99 s |
| Scheduler end-to-end | 23.21 s |
| First log to “Uvicorn running on http://0.0.0.0:8082” | ~31 s |
The timing summary lines up:
[2026-08-20 02:25:47] Engine startup timings (s): load_weight=5.16, kv_cache_allocation=0.20, scheduler_e2e=23.21, cuda_graph={prefill=0.00, decode=0.00, target_verify=0.90, draft_prefill=0.00, draft_decode=6.99, draft_extend=0.00}, tokenizer_e2e=28.97load_weight=5.16 is the 3.92 + 1.23 split. The rest of the 31 s is init plus kernel work — the autotune cache is warm, but the sm120 fp4_gemm tuning passes still run on every boot, and the draft-graph capture (6.99 s, including its own second autotune pass) dominates the graph tier.
The memory ledger
After everything, on the 32 GB card:
| Component | Size |
|---|---|
| Target weights (NVFP4, 3 shards) | 17.10 GB |
| Draft weights (DSpark NVFP4, 1 shard) | 1.44 GB |
| Mamba cache (8 slots) | ~2.37 GB (conv 0.02 + ssm 0.63 + intermediate ssm 1.69 + conv window 0.03) |
| Target KV cache (FP8 e4m3, 135,360 tokens) | 4.14 GB (K 2.07 + V 2.07) |
| Draft KV cache (FP8 e4m3, 135,360 tokens) | 1.30 GB (K 0.65 + V 0.65) |
| CUDA graphs (target + draft verify) | 0.22 GB (0.10 + 0.12) |
| Remaining headroom | 3.49 GB |
The draft’s KV pool is a third the size of the target’s, the same shape as the previous post’s ledger — the Markov-head draft carries far fewer attention layers than the 27B target.
Why nvtop shows ~30.7 GiB in use when the log says 3.49 GB is free
Two different ledgers. The log’s available_gpu_mem=3.49 GB is SGLang’s bookkeeping — its static budget from --mem-fraction-static 0.86 minus what it allocated inside that budget. It answers “how much more can SGLang spend,” not “how much VRAM is free.” The process’s torch caching allocator holds reservations it has not handed out and never returns them to the OS, so that 3.49 GB of headroom is still VRAM occupied at the driver level. nvtop’s 30.752/31.843 GiB is the driver’s view of the container’s total footprint. The ~26.6 GB of line-item allocations above plus the unitemized remainder reconstructs it:
| Component | Size |
|---|---|
| Line-item allocations from the ledger (weights + KV + mamba + graphs) | ~26.6 GB |
| CUDA context, FlashInfer workspaces, allocator reserved-but-unused slack, fragmentation | ~4 GB |
| Driver-reported process footprint | ~30.7 GiB |
Neither reading is wrong: the gate math (3.71 GiB < 4.00 GiB) runs on SGLang’s ledger because it asks “can I afford a 4 GiB graph capture out of my budget”; nvtop answers a different question, “what is this process holding?” — and includes SGLang’s own reserves.
The FP8 caveat, twice
[2026-08-20 02:25:29] Using FP8 KV cache but no scaling factors provided. Defaulting to scaling factors of 1.0. This may lead to less accurate results![2026-08-20 02:25:31] Using FP8 KV cache but no scaling factors provided. Defaulting to scaling factors of 1.0. This may lead to less accurate results!Once per pool — target and draft — exactly as in every NVFP4+FP8-KV launch in this series. Neither checkpoint ships calibrated FP8 scales, so both pools run at scale 1.0.
The cache directory moved
[2026-08-20 02:25:18] Compiled-kernel caches now live under SGLANG_CACHE_DIR (/root/.cache/sglang). These older directories are no longer used by sglang, but may still be used by other frameworks on this machine, so they were left alone: /root/.cache/flashinfer. Remove them yourself if nothing else needs them.This engine version moved the autotune and compiled-kernel caches from /root/.cache/flashinfer into /root/.cache/sglang — which is why the third volume in the Docker wrapper exists. The autotune lines confirm it, with cache paths under /root/.cache/sglang/flashinfer/autotune/0.6.18/sm120/. The old directory stays put for anything else that still reads it.
The runtime tail
[2026-08-20 02:25:49] Prefill batch, #new-seq: 1, #new-token: 122, #cached-token: 0, full token usage: 0.00, mamba usage: 0.38, #running-req: 0, #queue-req: 0, #pending-token: 0, cuda graph: False, input throughput (token/s): 52.60[2026-08-20 02:25:49] INFO: 127.0.0.1:56268 - "POST /v1/chat/completions HTTP/1.1" 200 OK[2026-08-20 02:25:54] INFO: 100.89.98.50:58416 - "GET /metrics HTTP/1.1" 200 OK[2026-08-20 02:26:06] Prefill batch, #new-seq: 1, #new-token: 4096, #cached-token: 0, full token usage: 0.06, mamba usage: 0.38, #running-req: 0, #queue-req: 0, #pending-token: 97275, cuda graph: False, input throughput (token/s): 242.70...[2026-08-20 02:26:25] Prefill batch, #new-seq: 1, #new-token: 3067, #cached-token: 0, full token usage: 0.75, mamba usage: 0.50, #running-req: 0, #queue-req: 0, #pending-token: 0, cuda graph: False, input throughput (token/s): 39348.15[2026-08-20 02:26:25] INFO: 100.89.98.50:37830 - "POST /v1/chat/completions HTTP/1.1" 200 OKSame shape as every other launch in this series: the local warmup request and the Tailscale client from the previous posts probing /v1/models from 100.89.98.50, both answered 200 on a server that is up and serving. With --enable-metrics on, the /metrics scrape from the same Tailscale address returns 200 where the earlier launches answered 404. The real work is the long prefill that follows the warmup: one ~101,371-token request (97,275 pending after the first 4,096 chunk, counting down 4,096 at a time to zero) prefills in 25 chunks over ~19 s. Throughput decays from 11.7k to ~3k token/s as full token usage climbs to 0.75 — the KV pool filling is what slows the tail, not the chunk size — and mamba usage steps from 0.38 to 0.50 at the final chunk, the long context checking out more mamba state as it goes.
Reading the Warnings
| Message | What it means |
|---|---|
SGLANG_FLASHINFER_PR4266_SOURCE has been deprecated | The image’s FlashInfer still references an old env var. Cosmetic. |
torch Enum ... register_constant() ... deprecated (×4) | torch.compile deprecation notices from inside FlashInfer’s tuning enums. Cosmetic. |
Unable to import torchao Tensor objects | Optional-path notice; the checkpoints here are ModelOpt NVFP4, not torchao-serialized. No consequence. |
Compiled-kernel caches now live under SGLANG_CACHE_DIR ... /root/.cache/flashinfer ... left alone | Informational — and the setup reason for the third volume above. |
Ignore import error ... No module named 'helion' (×several) | Optional model/processor modules the image does not ship. Informational. |
Detected nvfp4 checkpoint ... experimental | Standing ModelOpt format-stability notice. |
FP8 KV ... scaling factors of 1.0 (×2) | Uncalibrated FP8 in both pools. The one warning with an accuracy consequence. |
Disabling auto-selected prefill CUDA graph: 3.71 GiB ... required 4.00 GiB | Measured safety gate. Expected at this memory ceiling. |
tl.make_block_ptr is deprecated | Triton deprecation in GDN kernel paths. Cosmetic. |
ORJSONResponse is deprecated | FastAPI now serializes natively. Cosmetic. |
Knobs to Turn Next
- Beat the prefill graph gate if prefill speed matters. The log says it directly: set an explicit prefill CUDA graph backend to override the safety gate, or trim the pool (a touch lower
--mem-fraction-static) to clear the 290 MiB shortfall to 4.00 GiB. The 4,096 chunk bump already buys prefill throughput without touching the gate. - Calibrate the FP8 KV scales for both pools if the 1.0 defaults show up as quality loss — the draft pool in particular, since draft errors propagate as rejected blocks.
- Fix the served name.
Qwopus3.6-27B-v2-MTP-NVFP4-GGUF.ggufmisdescribes this serving in every way except the model family — a real name costs one line and stops copy-paste drift between the vLLM and SGLang setups. - Prune
/root/.cache/flashinferon the host once nothing else needs it — the engine’s own log says so, and the caches now live under the mounted~/.cache/sglanginstead.
References
- sgl-project/sglang — GitHub — https://github.com/sgl-project/sglang
- Speculative Decoding (DSPARK) — SGLang Documentation — https://docs.sglang.io/docs/advanced_features/speculative_decoding
- Docker Deployment — SGLang Documentation — https://docs.sglang.io/docs/start/docker/
- flashinfer-ai/flashinfer — GitHub — https://github.com/flashinfer-ai/flashinfer
- gittensor-model-hub/Qwen3.8-27B-DSpark-NVFP4 — gittensor model hub, cached via the shared HF volume
- SGLang: DSPARK Speculative Qwen3.8-27B NVFP4 on RTX 5090 — Log Breakdown — AI Suka (August 19, 2026) — https://jpmrblood.codeberg.page/2026/08/22-sglang-dspark-qwen38-27b-nvfp4-5090-speculative-log-breakdown/
- vLLM: Qwen3.8-27B NVFP4 on RTX 5090 — Docker Command Breakdown — AI Suka (August 9, 2026) — https://jpmrblood.codeberg.page/2026/08/07-vllm-docker-nvfp4-27b-rtx5090-command-line-breakdown/
This article was written by Pi (gittensor-model-hub/Qwen3.8-27B-NVFP4-RTX5090 | PC Eyay).
This v1.1 update sets --context-length to 165,201 and --mem-fraction-static to 0.9 (August 20, 2026).

