Bug: TensorRT 11.4 SmolLM3 native-KV prefill plan builds but cannot create an execution context (fused scatter kernel missing)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with the check_smollm3_contexts.py reproducer in the issue and compare execution-context creation on TensorRT 11.4 with -kgen:fuse_scatter_nd on and off. The issue says the existing workaround from #1902 unblocks SmolLM3, while the remaining failure needs a TensorRT fix; this is done when the affected plan can create a context or the builder fails instead of serializing a plan that cannot.
索引モデルが issue の本文から書いたものです。
説明
This was generated by AI during triage.
Affected area
Runtime loading or dispatch
TensorRT-Model-Connect version
39565ca554122730cd57b7adbdbb4614ffa06d5e (main, which already contains the workaround from #1902)
Installation method
Development container
Model and revision
HuggingFaceTB/SmolLM3-3B at a07cc9a04f16550a088caea529712d1d335b0ac1, case smollm3-3b-l0 (BF16, native KV cache, max_sequence_length 65536)
Environment
- OS: Ubuntu 24.04.5 (development container built from the repository
Dockerfile) - GPU: NVIDIA GB300
- Driver: 595.58.03
- CUDA: 13.4.3
- TensorRT: 11.4.0.106 fails. 11.1.0.106 works. Both come from the
tensorrt-cu13wheels.
Summary
On TensorRT 11.4, SmolLM3's native-KV prefill plan builds and deserializes, but ICudaEngine::createExecutionContext fails: Myelin cannot find the fused reshape/transpose/scatter kernel it generated for the K/V cache updates (CUDA error 500, function not found in module). Setting the build route -kgen:fuse_scatter_nd=off avoids it, which is the workaround merged in #1902. TensorRT 11.1 creates the context with the fused route enabled.
Minimal reproducer
Run from the repository root in the development container, after downloading the checkpoint. The script builds the smollm3-3b-l0 bundle through the public build API, forces the given build route on every plan, and creates an execution context for each plan right after it is built.
huggingface-cli download HuggingFaceTB/SmolLM3-3B --revision a07cc9a04f16550a088caea529712d1d335b0ac1
MODEL=$(python3 -c "from huggingface_hub import snapshot_download; print(snapshot_download('HuggingFaceTB/SmolLM3-3B', revision='a07cc9a04f16550a088caea529712d1d335b0ac1'))")
PYTHONPATH=core/builder:. python3 check_smollm3_contexts.py "$MODEL" -kgen:fuse_scatter_nd=on # TensorRT 11.4: prefill context fails
PYTHONPATH=core/builder:. python3 check_smollm3_contexts.py "$MODEL" -kgen:fuse_scatter_nd=off # TensorRT 11.4: both contexts created
check_smollm3_contexts.py:
"""Build the smollm3-3b-l0 bundle with a forced build route and create an execution context per plan."""
import sys
from pathlib import Path
import tensorrt as trt
from tensorrt_model_connect import BuildRequest, build
model_dir, build_route = Path(sys.argv[1]), sys.argv[2]
original = trt.Builder.build_serialized_network
def build_and_check(self, network, config):
config.build_route = build_route
plan = original(self, network, config)
engine = trt.Runtime(trt.Logger(trt.Logger.ERROR)).deserialize_cuda_engine(plan)
context = engine.create_execution_context()
print(f"tensorrt={trt.__version__} layers={network.num_layers} route={build_route} "
f"context_created={context is not None}", flush=True)
return plan
trt.Builder.build_serialized_network = build_and_check
build(
BuildRequest(
model_dir=model_dir,
output_path=Path("smollm3-3b-l0.bundle"),
family="smollm3",
task="text_generation",
precision="bf16",
max_sequence_length=65536,
tensor_parallel_size=1,
)
)
Observed behavior
| TensorRT | -kgen:fuse_scatter_nd |
Prefill plan context | Decode plan context |
|---|---|---|---|
| 11.4.0.106 | on (11.4 default before #1902) |
fails | created |
| 11.4.0.106 | off (#1902 workaround) |
created | created |
| 11.1.0.106 | on |
created | created |
Each plan has 3,805 layers and contains 72 IKVCacheUpdateLayer updates (36 layers, K and V). The missing function name shows that Myelin fused each layer's K and V update chains (reshape, transpose, reshape, scatter) into one kernel. A standalone network with only the two reshape/transpose chains and IKVCacheUpdateLayers (BF16, cache [1, 4, 65536, 128], dynamic sequence up to 64) builds and creates a context on 11.4, so the failing fusion needs the surrounding decoder layer.
Expected behavior
A plan that buildSerializedNetwork returns should create an execution context, as on TensorRT 11.1. If the fused scatter kernel cannot be emitted, the builder should fall back or fail the build instead of serializing a plan that references a missing function.
Relevant logs
[TRT] [E] ICudaEngine::createExecutionContext: Error Code 1: Myelin ([cudamod.cpp:61: fqn] CUDA error 500 when loading function '__myl_ReshTranReshScatReshTranReshScat_0x1f1068d04883572264fe9bb736e9cdbf_vec'.; [launch.cpp:55: linfo] Function '__myl_ReshTranReshScatReshTranReshScat_0x1f1068d04883572264fe9bb736e9cdbf_vec' not found in module. In MyelinGraphContext at graphContext.cpp:79)
Error: [trtmc] Failed to create TRT execution context
Impact and next steps
- #1902 already sets
-kgen:fuse_scatter_nd=offfor SmolLM3's native-KV builds, somainis unblocked. Other families that build native-KV prefill plans with the same update pattern can hit the same failure on TensorRT 11.4. - This needs a TensorRT fix; the reproducer above is ready to route to the Myelin team. A checkpoint-free network that triggers the fusion has not been found yet.
Submission checks
- I searched open and closed issues and found no duplicate.
- This is not a security vulnerability.
- I removed secrets, credentials, private URLs, and restricted artifacts.
- 主要言語
- Python
- スター
- 283
- フォーク
- 75
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 227
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/TensorRT-Model-Connect のほかの issue
-
Docs: ITrtModule::forward() output-buffer lifetime and dtype contract are undocumented再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NVIDIA/TensorRT-Model-Connect#1126 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
NVIDIA/TensorRT-Model-Connect#1929 ·
メンテナーはふだん 1 日以内に返信
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
NVIDIA/TensorRT-Model-Connect#1928 ·
メンテナーはふだん 1 日以内に返信
-
AI bug
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
NVIDIA/TensorRT-Model-Connect#1920 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 6/100
NVIDIA/TensorRT-Model-Connect#1700 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
NVIDIA/TensorRT-Model-Connect の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
namespace operations
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
EclipseFdn/open-vsx.org#15057 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
FinanceFlash/unvibecode#349 ·
-
Mission statement: why this is free, in the README, Why This Exists and the wiki Home対応中かも @ChiefGyk3D が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ChiefGyk3D/Clouds-Against-Humanity#348 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vllm-project/vime#508 ·
メンテナーはふだん 4 日以内に返信