[Performance]: trtllm-serve's default of 8 HTTP frontends is ~20% slower than 4 at 128–512 concurrent streams (Qwen3-8B, GB200)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
Start by reading the frontend-count change in #19379 and the worker batching path in tensorrt_llm/executor/base_worker.py, especially handle_for_ipc_batched. Reproduce the throughput sweep with Qwen3-8B on a GB200, varying --num_serve_frontends from 1 to 8 at 128–512 concurrent streams. Done means identifying whether the default causes the reported slowdown and providing measured results that support a default or implementation change.
索引モデルが issue の本文から書いたものです。
説明
Report of performance regression
Since #19379, trtllm-serve serve starts 8 HTTP frontend processes by default. On one GB200 with Qwen3-8B BF16 and 256 concurrent streaming /v1/completions requests, 8 frontends delivered about 19% fewer tokens per second than 4. The server command is the same in every run except --num_serve_frontends; each load wave uses its own random prompts.
| CPUs available to the server | 8 frontends (default), tok/s | 4 frontends, tok/s |
|---|---|---|
| 12 | 17,351 / 16,170 / 15,863 · 17,519 / 16,152 / 16,399 | 20,989 / 21,002 / 21,858 · 20,302 / 18,995 / 20,257 |
| 24 | 20,192 / 18,712 / 19,129 · 19,755 / 17,337 / 19,942 | 23,533 / 24,188 / 23,467 · 22,964 / 23,965 / 23,239 |
Each cell is two server launches (separated by ·) with three load waves each, run in the order 8, 4, 8, 4 (12 CPUs) and 4, 8, 4, 8 (24 CPUs). In both settings every 4-frontend wave was faster than every 8-frontend wave of the same launch pair, by at least 8% (12 CPUs) and 15% (24 CPUs). In a separate run on 12 CPUs, 2 frontends averaged 20,260 tok/s and 1 frontend 17,387 tok/s; with 1 frontend, in two of three waves the GPU went idle about 5 s before the last token reached the client. In two other runs of the 8-frontend server without streaming, the same load reached 23,344 and 25,479–25,624 tok/s.
A concurrency sweep on 12 CPUs (CUDA graphs extended to batch 512 so that 512-stream decode is not eager; two launches per frontend count in the order 8, 4, 4, 8; two waves per concurrency per launch) gave:
| concurrent streams | 8 frontends, mean tok/s | 4 frontends, mean tok/s | 4 / 8 |
|---|---|---|---|
| 64 | 9,234 | 10,246 | 1.11 |
| 128 | 12,485 | 15,197 | 1.22 |
| 256 | 15,440 | 19,566 | 1.27 |
| 512 | 18,530 | 22,807 | 1.23 |
At 128, 256 and 512 streams every 4-frontend wave was faster than every 8-frontend wave of the same launch pair, by at least 8%; at 64 the second launch pair overlapped.
A py-spy sample (100 Hz, 6 s inside one streaming wave per configuration, 12 CPUs) is consistent with an overhead that grows with the number of frontend processes. The numbers below are sampled time divided by an estimated step count (wave time / 1,024), so they are approximate, and py-spy on this platform does not separate GIL waits from running:
| py-spy time per estimated decode step | 8 frontends | 4 frontends |
|---|---|---|
| worker executor loop thread | 12.7 ms | 9.8 ms |
worker await_response_thread (per-lane pickle, HMAC, send) |
3.9 ms | 2.8 ms |
| all frontend processes together | 21.2 ms | 15.1 ms |
Total server CPU in top was 2.7–2.8 of the 12 allocated cores in both runs. One possible explanation is the per-lane work in the worker, which groups each batch of responses by frontend and sends one IPC message per non-empty group (handle_for_ipc_batched); this was not isolated.
Is 8 the intended default at these concurrencies? The description of #19379 motivates the change with c ≥ 512 on a DSv4 disaggregated generation worker. In these runs 4 frontends gave higher throughput than 8 from 128 to 512 streams, and 2 frontends did as well at 256.
Your current environment (if you think it is necessary)
- 1× NVIDIA GB200 (Grace, aarch64), Slurm job with 12 or 24 CPUs (half on each Grace socket); the server uses one GPU
nvcr.io/nvidia/tensorrt-llm/release:1.4.0rc3.dev202611050315(arm64), PyTorch backend- Qwen3-8B BF16, TP 1
Server (8 frontends is the default; the 4-frontend runs add --num_serve_frontends 4; the concurrency sweep used cuda_graph_config.max_batch_size: 512):
cat > cfg.yaml <<'EOF'
cuda_graph_config:
enable_padding: true
max_batch_size: 256
kv_cache_config:
host_cache_size: 8589934592
EOF
trtllm-serve serve Qwen/Qwen3-8B --served_model_name m --host 127.0.0.1 --port 8000 --config cfg.yaml
The CUDA graph settings follow the server's own startup warning for decode batches above 32; host_cache_size keeps the KV host tier inside the job's memory limit.
Load (simplified from the harness used): after wave 9 16 128 as a warm-up, send 256 requests at once (64 to 512 in the sweep), each with 256 random prompt token ids, max_tokens 1024, ignore_eos and streaming with usage; a wave counts only if every request returns HTTP 200 with curl exit code 0, [DONE] and 1,024 completion tokens. Throughput = requests × 1024 / wall time from the first request to the last response; three waves per server launch (two per concurrency in the sweep).
wave() { # wave <seed> [n] [max_tokens]
rm -rf bodies out && mkdir -p bodies out
n=${2:-256}; m=${3:-1024}
python3 - "$1" "$n" "$m" <<'EOF'
import json, random, sys
rng = random.Random(int(sys.argv[1]))
for i in range(int(sys.argv[2])):
body = {"model": "m", "prompt": [rng.randrange(1000, 100000) for _ in range(256)], "max_tokens": int(sys.argv[3]),
"ignore_eos": True, "stream": True, "stream_options": {"include_usage": True}}
json.dump(body, open(f"bodies/r{i:03d}.json", "w"))
EOF
t0=$(date +%s.%N)
ls bodies/*.json | xargs -P "$n" -I{} sh -c 'curl -s -N -o out/$(basename {}).resp -w "%{http_code} %{exitcode}\n" -H "Content-Type: application/json" --data-binary @{} http://127.0.0.1:8000/v1/completions' > codes.txt
t1=$(date +%s.%N)
python3 - "$t0" "$t1" "$n" "$m" <<'EOF'
import glob, json, sys
n, m = int(sys.argv[3]), int(sys.argv[4])
codes = [ln.split() for ln in open("codes.txt") if ln.strip()]
ok = 0
for f in glob.glob("out/*.resp"):
parts = [p.strip() for p in open(f).read().split("data: ")]
usage = [json.loads(p)["usage"] for p in parts if p.startswith("{") and '"usage"' in p and json.loads(p).get("usage")]
ok += "[DONE]" in parts and bool(usage) and usage[-1]["completion_tokens"] == m
good = sum(c == ["200", "0"] for c in codes)
assert len(codes) == n and good == n and ok == n, (len(codes), good, ok)
print(round(n * m / (float(sys.argv[2]) - float(sys.argv[1]))), "tok/s")
EOF
}
wave 9 16 128; wave 1; wave 2; wave 3
For the concurrency sweep, cfg.yaml sets max_batch_size: 512 under cuda_graph_config, and each launch runs wave SEED N twice for each n in 64, 128, 256, 512.
Not run: concurrency above 512, other models, x86 hosts, or a full GB200 node (all runs used 12 or 24 CPUs and one GPU).
Before submitting a new issue...
- Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.
- 主要言語
- Python
- スター
- 15.2k
- フォーク
- 3k
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 477
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/TensorRT-LLM のほかの issue
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.x対応中かも @NimaVaziri が今日担当しました。 オープンPytorch
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/TensorRT-LLM#23406 ·
メンテナーはふだん 1 日以内に返信
-
Inference runtime Windows
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
NVIDIA/TensorRT-LLM#23394 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: MMLU subsampling changes when evaluators are interleaved対応中かも @LeNeLeNeWo が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NVIDIA/TensorRT-LLM#23273 ·
メンテナーはふだん 1 日以内に返信
-
Trace-replay Pareto window includes the drain when sessions finish out of admission order対応中かも @sbeierle が 3 日前に担当しました。 オープンTesting
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
NVIDIA/TensorRT-LLM#23077 ·
メンテナーはふだん 1 日以内に返信
-
LongBench V2 blog command breaks on inline comments after continuations対応中かも @ddlw が 25 日前に担当しました。 オープンDoc
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
NVIDIA/TensorRT-LLM#21879 ·
メンテナーはふだん 1 日以内に返信
NVIDIA/TensorRT-LLM の issue をすべて見る
似ている issue
-
[Resource]: Spaicelyオープンresource-submission validation-passed
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
hesreallyhim/awesome-claude-code#3875 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
bvis/aegis-hass#725 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
#1643 unrecoverable split: 1 digest with a 403 — two earlier captures of the same URL are real 200sオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
Robin-IA/Congressional-Letters-Dev#1684 ·
メンテナーはふだん 1 日以内に返信