Reduce per-step TorchSampler RNG staging work
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
Start by reading TorchSampler._stage_fast_sampling_seeds and the internal seed manager; trace how persistent seed and offset buffers are filled during stage_in_graph_sampling and how eager sampling uses the allocating API. Compare the seeded and unseeded paths while preserving request-local streams, slot ownership, and padding semantics. Done means the live buffer prefix is prepared directly, host-only counters stay as Python integers, and the existing sampler and in-graph request-seed tests pass.
索引モデルが issue の本文から書いたものです。
説明
Motivation
On main at 1df5c23d, the PyTorch backend's TorchSampler._stage_fast_sampling_seeds creates temporary device seed/offset tensors and then copies them to the graph sampler's persistent input buffers on each decode step.
A warmed CUDA trace of three calls to stage_in_graph_sampling followed by sample_in_graph replay shows:
- Unseeded: six initialization kernels and six device-to-device copies for RNG metadata.
- Seeded: six host-to-device copies followed by six device-to-device copies; host seed/offset preparation also reads and updates CPU tensor scalars for each row.
The persistent destination buffers already exist. Their live prefix can be filled directly without changing request-local streams, slot ownership, or padding semantics.
Proposed change
Let the internal seed manager optionally receive the destination seed/offset tensors. Fuse unseeded initialization into one kernel; copy seeded/mixed host values directly into the destination through named device_copy sites. Keep host-only counters as Python integers. Preserve the existing allocating API for eager sampling.
This follows the fixed-capacity sampling-input preparation used by DeepInfer, adapted to TensorRT-LLM's existing RNG and copy contracts. It complements #19719, #18437 and #21974; it does not change the penalty/embedding-bias paths in #21864 or #22638.
Validation
The implementation has been tested on one NVIDIA H20 using current-main sampler sources over the official 1.4.0rc5 runtime: 44 in-graph/request-seed tests, plus 271 sampler/greedy tests (131 architecture/feature skips), and actual HTTP streaming service comparisons with Qwen3.5-0.8B and Qwen3-4B. Seeded outputs match the baseline. The measured benefit is workload-dependent: sampler staging improves, smaller-model seeded concurrent serving benefits, and Qwen3-4B TPOT remains approximately unchanged. The linked implementation PR will include the configurations and results.
- 主要言語
- 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 日以内に返信