`torch_tensorrt.dynamo.compile` silently drops settings it does not know, so a typo changes the result with no warning
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start in torch_tensorrt.dynamo.compile, which takes **kwargs and reads only a few known names, and in the torch_tensorrt.compile wrapper that forwards to it. Run the repro with the misspelled min_blok_size and confirm no _run_on_acc submodule appears. Done when an unknown keyword raises TypeError naming it, while the deprecated names that are still accepted keep their warnings.
索引モデルが issue の本文から書いたものです。
説明
What is wrong
torch_tensorrt.dynamo.compile and torch_tensorrt.compile accept any keyword. A setting name they do not know is dropped with no error and no warning. So a misspelled setting, a setting from a newer release, or a setting that only one code path reads, simply does nothing, and the user finds out much later, if at all.
What this blocks
No policy in pytorch/executorch#24353 is blocked by this today.
Earlier, lingbot_vla_v2 lost a setting this way: the export passed, and its program failed only later, when it was loaded without PyTorch.
A fix turns such mistakes into an error at compile time.
Repro
import torch
import torch_tensorrt
class Small(torch.nn.Module):
def forward(self, x):
return torch.relu(x * 2 + 1)
x = torch.randn(4, 8, device="cuda")
program = torch.export.export(Small().cuda(), (x,))
# "min_blok_size" is misspelled on purpose.
trt_gm = torch_tensorrt.dynamo.compile(program, arg_inputs=[x], min_blok_size=1)
print([name for name, _ in trt_gm.named_children()])
# No error and no warning. The default min_block_size (5) is used,
# so the 3-op graph stays in PyTorch: no _run_on_acc submodule.
Actual
No message mentions min_blok_size. The only related message is about the default min_block_size:
WARNING:torch_tensorrt.dynamo._compiler:3 supported operations detected in subgraph containing 3 computational nodes. Skipping this subgraph, since min_block_size was detected to be 5
['_guards_fn']
torch_tensorrt.compile(model, ir="dynamo", inputs=[x], min_blok_size=1) prints the same 2 lines.
Expected
An unknown setting raises TypeError (or at least warns), naming the setting. The few deprecated names that are still accepted on purpose can keep their deprecation warnings.
Versions
torch 2.15.0 (CUDA 13.2), torch_tensorrt 2.15.0, TensorRT 11.4.0.106, Linux x86_64, H100, driver 580.126.09.
What was tried
Reading compile(): it takes **kwargs and reads only debug, truncate_long_and_double, refit, make_refittable and enable_cross_compile_for_windows from it. Everything else is ignored. Related but different: #5030 (a known setting ignored) and #5031 (extra kwarg_inputs ignored).
- 主要言語
- Python
- スター
- 3k
- フォーク
- 421
- 平均マージ
- 4日 7時間
- マージ済み PR(30日)
- 62
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytorch/TensorRT のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 3 日以内に返信
-
🐛 [Bug] torch.fmod returns a tiny value with the wrong sign when the float quotient rounds up対応中かも @micwill755 が 4 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pytorch/TensorRT#4860 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
Removing ptq.hオープンStory: Build & Install & Packaging
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
メンテナーはふだん 3 日以内に返信
pytorch/TensorRT の issue をすべて見る
似ている issue
-
add entry to blockオープン
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"対応中かも @0z5a が今日担当しました。 オープンneeds-triage
難易度 2/5 半日 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
plot_graph crashes when a mesh node has no m2m edge対応中かも @tygvi が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mllam/neural-lam#883 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
future-agi/future-agi#4092 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld wholeオープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
WingedGuardian/GENesis-AGI#4641 ·
メンテナーはふだん 1 日以内に返信