`torch_tensorrt.dynamo.compile` silently drops settings it does not know, so a typo changes the result with no warning
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 65/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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).
- Dominant language
- Python
- Stars
- 3k
- Forks
- 421
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 62
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pytorch/TensorRT
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 3 days
-
🐛 [Bug] torch.fmod returns a tiny value with the wrong sign when the float quotient rounds upPossibly taken @micwill755 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pytorch/TensorRT#4860 · 1 assignee ·
Maintainers usually reply within 3 days
-
Removing ptq.hOpenStory: Build & Install & Packaging
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 18/100
Maintainers usually reply within 3 days
All issues in pytorch/TensorRT
Similar issues
-
plot_graph crashes when a mesh node has no m2m edgePossibly taken @tygvi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mllam/neural-lam#883 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement possible-duplicate
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/PictoPy#1715 · 2 comments ·
Maintainers usually reply within 6 days
-
SQLite connector omits generated columns from the catalog, and drops relationships sourced on themOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NVIDIA/auto-ontology#511 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ethereum/execution-specs#3996 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cpp-best-practices/project_validator#267 ·
Maintainers usually reply within 1 day