You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 [Bug] enabled_precisions={torch.float16} is silently ignored in 2.15, and the engine stays FP32 #5030
In 2.15, enabled_precisions={torch.float16} is accepted and then ignored. The engine is built in FP32, with no warning and no error.
torch_tensorrt.dynamo.compile no longer has an enabled_precisions parameter, so the argument falls into **kwargs and nothing reads it.
torch_tensorrt.compile(..., ir="dynamo") still takes enabled_precisions, but its dynamo branch drops it.
This is the FP16 switch that most tutorials and existing user code use. A user asks for FP16, gets an FP32 engine twice the size, and has no way to notice.
torch_tensorrt.compile(model, ir="dynamo", inputs=[x], min_block_size=1, enabled_precisions={torch.float16}) gives the same FP32 engine.
Expected behavior
A clear error or a warning that enabled_precisions is no longer used, naming the replacement (enable_autocast=True, autocast_low_precision_type=torch.float16, or casting the model to half precision).
dynamo.compile already does this for other removed options: truncate_long_and_double, refit and make_refittable are still recognized in kwargs and raise a DeprecationWarning or a ValueError. Handling enabled_precisions the same way, in both dynamo.compile and the dynamo branch of torch_tensorrt.compile, would fix this.
Environment
Torch-TensorRT: 2.15.0 (PyPI)
PyTorch: 2.15.0+cu132
TensorRT: 11.4.0.106
Python: 3.12
Seen on Jetson AGX Thor (aarch64) and on x86_64 with an H100. The same code is on main.
Thanks, autocast works for us. In the repro above, enable_autocast=True, autocast_low_precision_type=torch.float16 gives the half-size engine.
I could not find a warning, though. On 2.15.0 from PyPI, both torch_tensorrt.dynamo.compile(..., enabled_precisions={torch.float16}) and torch_tensorrt.compile(..., ir="dynamo", enabled_precisions={torch.float16}) finish with no warning about precision. On main, nothing under py/torch_tensorrt/dynamo mentions enabled_precisions, and the dynamo branch of torch_tensorrt.compile drops it, so there is no warning that could fire.
Many tutorials and existing scripts still pass it, so a DeprecationWarning that points to autocast, like the one for truncate_long_and_double, would save people from shipping FP32 engines by accident.
@shoumikhin Thanks for pointing this out. I traced back to #4195 which directly removed the deprecated APIs without raising any warning/error. I also found that PR silently removed use_explicit_typing. I'll open a PR to fix both.
Activity
narendasan commentedon Nov 13, 2026
@zewenli98 didnt we add a warning that with TRT 11.x enabled precisions does not do anything?
narendasan commentedon Nov 13, 2026
@shoumikhin the correct replacement is to use autocast
shoumikhin commentedon Nov 13, 2026
Thanks, autocast works for us. In the repro above,
enable_autocast=True, autocast_low_precision_type=torch.float16gives the half-size engine.I could not find a warning, though. On 2.15.0 from PyPI, both
torch_tensorrt.dynamo.compile(..., enabled_precisions={torch.float16})andtorch_tensorrt.compile(..., ir="dynamo", enabled_precisions={torch.float16})finish with no warning about precision. Onmain, nothing underpy/torch_tensorrt/dynamomentionsenabled_precisions, and the dynamo branch oftorch_tensorrt.compiledrops it, so there is no warning that could fire.Many tutorials and existing scripts still pass it, so a
DeprecationWarningthat points to autocast, like the one fortruncate_long_and_double, would save people from shipping FP32 engines by accident.zewenli98 commentedon Nov 13, 2026
@shoumikhin Thanks for pointing this out. I traced back to #4195 which directly removed the deprecated APIs without raising any warning/error. I also found that PR silently removed
use_explicit_typing. I'll open a PR to fix both.