#19623·TensorRT-LLM

[Bug]: ~6 s fixed per-request latency on sm120 (4x RTX 5060 Ti TP4) with Qwen3.5 hybrid-GDN NVFP4 27B — 1.3.0rc29

Author: sean640112Created Sep 24, 2026Updated Sep 24, 2026
LabelsInference runtimePytorch

~6 s fixed per-request latency floor on sm120 (4× RTX 5060 Ti, TP4) with a Qwen3.5 hybrid-GDN 27B NVFP4 checkpoint

Summary

On a 4× RTX 5060 Ti (sm120) box serving a dense hybrid GDN + full-attention 27B NVFP4 checkpoint with trtllm-serve (PyTorch backend, TP4), we measure a ~6 s per-request floor on time-to-first-token that is independent of prompt length. A 212-token request takes 6.06 s to first token (8.0 s total), and the floor persists at every length we tested (212 → 59,571 tokens). Requests are reproducible to ±5 ms across 12 measurements in 3 separate server starts.

The same hardware, same checkpoint, same prompt, same client, served by SGLang gives 0.26–0.30 s for the identical request. trtllm-serve therefore looks ~20× slower on short requests, while its marginal prefill throughput is only ~2.6× lower (~2,143 tok/s vs ~5,600 tok/s).

We have ruled out MTP/spec-decode, scheduler policy, max_seq_len, chunked prefill, the CUDA caching allocator, and thinking-mode as causes (details below). We would like to know whether this per-request floor is expected on sm120 for hybrid GDN models, or a bug — and which knob/diagnostic we should look at next. We are happy to run any instrumentation you suggest.

Environment

GPU 4× NVIDIA GeForce RTX 5060 Ti 16 GB, compute capability 12.0 (sm120), TP=4
Driver 610.57.04
CUDA toolkit 13.3 (nvcc 13.3, CUDA_HOME=/usr/local/cuda-13.3)
OS / Python Linux, Python 3.12.11 (venv)
TensorRT-LLM 1.3.0rc29.dev202609240000 (nightly from 2026-09-24; PyPI 1.2.1 does not contain modeling_qwen3_5.py, hence nightly)
torch 2.14.0+cu132
flashinfer-python 0.6.18
triton 3.8.0
nvidia-cutlass-dsl 4.8.0.dev0
tensorrt / tensorrt_cu13 10.14.1.48.post1
MPI OpenMPI 5.0.10 (mpi4py bootstrap path)
Model nvidia/Qwen3.8-27B-NVFP4 — architectures: ["Qwen3_5ForConditionalGeneration"], model_type: qwen3_5; 64 layers, hidden 5120, 24 Q heads, 4 KV heads
Quantization ModelOpt MIXED_PRECISION: FP8 per-tensor on 208 layers (block_size absent) + NVFP4 group_size: 16 on 193 layers, kv_cache_quant_algo: null

Note on the attention backend: your hardware support matrix lists sm120 as supporting NVFP4 / MXFP4 / FP8 (per-tensor) / FP8 KV cache, which covers this checkpoint's formats — so the quantization scheme itself should be fully supported on sm120.

How to reproduce

Server (the mpirun -n 1 wrapper and OMPI_MCA_* are needed on this host because import tensorrt_llm otherwise blocks in the mpi4py MPI.COMM_WORLD initialization, and this host's own hostname resolves to loopback only):

bash
export CUDA_HOME=/usr/local/cuda-13.3
export OMPI_MCA_btl_tcp_if_include=lo OMPI_MCA_oob_tcp_if_include=lo
mpirun -n 1 --oversubscribe trtllm-serve serve /path/to/Qwen3.8-27B-NVFP4 \
  --host 127.0.0.1 --port 1234 --tp_size 4 \
  --max_seq_len 140000 --max_batch_size 8 \
  --served_model_name qwen3.8-27b \
  --free_gpu_memory_fraction 0.80 \
  --extra_llm_api_options opts.yaml

opts.yaml:

yaml
enable_chunked_prefill: true
max_num_tokens: 8192
speculative_config:
  decoding_type: MTP
  max_draft_len: 3
  speculative_model: /path/to/Qwen3.8-27B-NVFP4

Client — a minimal stdlib-only streaming client (this is the "probe" used for every number below; it measures the first chunk that carries choices[0].text/delta.content):

python
import json, time, urllib.request
prompt = open("/path/to/corpus.txt").read()[:600]          # → 212 tokens
body = {"model": "qwen3.8-27b", "prompt": prompt, "max_tokens": 1, "temperature": 0, "stream": True}
req = urllib.request.Request("http://127.0.0.1:1234/v1/completions",
        data=json.dumps(body).encode(), headers={"Content-Type": "application/json"})
t0 = time.time(); ttft = None
with urllib.request.urlopen(req, timeout=900) as r:
    for raw in r:
        s = raw.decode().strip()
        if not s.startswith("data: "): continue
        if s[6:] == "[DONE]": break
        d = json.loads(s[6:])
        ch = d.get("choices") or []
        if ch and ch[0].get("text"):
            ttft = time.time() - t0; break
print("TTFT", ttft)

Measured results (same probe, same prompts, same box)

prompt tokens path TRT-LLM stream TTFT TRT-LLM non-stream total SGLang stream TTFT SGLang non-stream total
212 completions 6.053–6.062 s (n=5) 7.995–8.035 s 0.262 s 0.304 s
222 chat (medium template) 12.11 – 22.21 s (unstable across restarts) 14.06 – 26.19 s 0.268 s —
7,172 completions 10.10 s 12.02 s 0.243 s cached 1.84 s cached
12,131 completions 12.12 s 14.06 s — —
28,008 completions — 20.13 s — 6.15 s cached
59,571 completions — 36.26 s — —
65,032 chat 56.52 s 56.45 s — —

("cached" = the SGLang side hit its radix prefix cache on the shared corpus prefix, so those cells are not a like-for-like prefill comparison.)

Least-squares fit of the completions path (total = C + N/R, 5 points spanning 212 → 59,571 tokens): C = 8.10 s, R = 2,143 tok/s, R² = 0.9966 — i.e. a very large constant plus a modest rate term. (The streaming TTFT is ≈ 1.9 s lower at every point, i.e. TTFT ≈ 6.1 s + N/2143.)

For reference, an independent client (vLLM's bench serve against the same server) measured prefill throughput of 453 / 1,014 / 1,302 tok/s at 8K / 32K / 64K with meanTTFT 16.15 / 29.28 / 46.44 s, i.e. the same shape: mostly a constant, with the rate part improving with length.

The SGLang side on this box (same checkpoint, TP4, DFlash2, fp8 KV, same client) measures ~5,600 tok/s marginal prefill and a per-request overhead of ≲0.3 s. So the fixed component, not the rate, is what dominates short requests for us.

What we ruled out (each was an actual A/B on a server restart)

Variant tiny-request TTFT 8K-prefill
baseline (MTP on, chunked prefill on, max_seq_len 140000) 6.06 s (one earlier start gave 0.139 s — unreproducible) 453 tok/s
speculative_config removed (MTP off) 6.057 s 453 tok/s (identical)
scheduler_config.capacity_scheduler_policy: MAX_UTILIZATION 6.059 s 453 tok/s (identical)
max_seq_len 140000 → 32768 6.056 s 453 tok/s (identical)
enable_chunked_prefill off 6.056 / 6.061 / 6.055 s —
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True (i.e. exactly what the log recommends) 6.054 / 6.058 / 6.062 / 6.058 s —
chat_template_kwargs: {"enable_thinking": false} 12.121 s vs 12.120 s with thinking on — no change —

Prompt length is irrelevant to the constant: 212 tokens → 6.06 s and 59,571 tokens → 36.26 s both sit on the same line.

Log evidence

Selected lines from the server log (PyTorch backend, verbose):

[W] [thop][RANK 0..3] Attention workspace size is not enough, increase the size from 0 bytes to 75558912 bytes
[W] [_torch][RANK 0] It is recommended to incl. 'garbage_collection_threshold:0.???' or 'backend:cudaMallocAsync' or 'expandable_segm…'
[W] [_torch][RANK 0] Partial reuse is not supported for mamba hybrid models, disabling partial reuse
[W] [_torch][RANK 0] [AutoTuner] trtllm::nvfp4_gemm::gemm using the fallback tactic, due to cache miss on input shapes=(torch.Size([4, 2560]), …
[I] [_torch][RANK 0] lm_head quant entry (NVFP4) dropped: unsupported configuration for quantized LMHead (requires SM100/103/SM120, untied embedding…
[I] [_torch][RANK 0] Run generation-only CUDA graph capture (advanced sampling) for batch size=3, draft_len=3, max_seq_len=140000
[W] [serve] Resource governor is disabled: the executor backend does not provide a resource_governor_queue …
[I] [_startup][RANK 0] [startup][pid=…] executor_creation: done, total=147.844s, unattributed=0.123s | configuration_and_distributed_init=0.347s,
    model=87.365s, sampler=0.000s, profiling_kv_cache_allocation=0.012s, spec_resource_manager=0.000s, drafter=0.000s,
    profiling_executor_creation=34.979s, memory_profiling_and_capacity=9.189s, profiling_resource_teardown=0.471s,
    final_kv_cache_allocation=0.018s, final_executor_creation=15.338s, executor_start_worker=0.001s
[I] [batchmgr][RANK 0] Max KV cache blocks per sequence: 4376 [window size=140008], tokens per block=32, primary blocks=5272, max sequence length=140008
[I] [warmup][pid=571366][rank=0][purpose=final_executor][pass=2] cuda_graph_capture: done in 7.1s

(The CUDA graph captures happen once during startup, not per request — we checked.)

Questions

  1. Is a ~6 s per-request floor expected on sm120 for hybrid (GDN / mamba-style) models with the PyTorch backend, or is this a bug?
  2. Is there a configuration we are missing that governs per-request fixed cost for hybrid models — e.g. something around the GDN/mamba state cache, the attention workspace growth warning above, or a sm120-specific attention backend selection (attn_backend currently resolves to TRTLLM)?
  3. Does this relate to any of the existing sm120 / GDN threads, e.g. #15634 (Qwen3-Next Gated-DeltaNet on consumer Blackwell), #19376 (flashinfer GDN prefill on sm120/121), #15853 (B12x NVFP4 JIT on SM120/SM121), or #18813 ("Resolve the runtime JIT issue")? If a duplicate exists, please close this and point us at the right thread — we will happily add our data there.
  4. Which instrumentation would you like in order to localize the constant? We can enable enable_iter_perf_stats/return_perf_metrics, print_iter_log, NVTX, or run any branch you point us to — the box is available for A/B testing.

Extra context

  • This is a 4-card 16 GB consumer Blackwell box used both for this evaluation and for production inference, so we can A/B TRT-LLM vs SGLang on the same hardware within minutes.
  • Everything above was measured with mon-gpu-sampler-type monitoring stopped and no other load on the GPUs; each server start took ~145–170 s to become ready.
  • If useful we can provide the full raw logs, the exact client scripts, and a matching SGLang run for comparison.