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
batch_size=128network_input_shape= [1, 1, 1, 32]
placeholder_batch=torch.rand((batch_size,) +tuple(network_input_shape))
placeholder_batch=placeholder_batch.to("cuda")
compiled_model=trt.compile(
conv_block,
inputs=[placeholder_batch],
enabled_precisions={torch.float32},
optimization_level=5, # max is 5, compilation takes longer but gives the best speedupdebug=True, # very verbose, only turn on if neededuse_fast_partitioner=True, # cant disable, results in error when exportingdynamic=False,
disable_tf32=True, # reduce precision errors at the expense of small slowdown
)
Build information about Torch-TensorRT can be found by turning on debug messages
Torch-TensorRT Version (e.g. 1.0.0): 2.4.0
PyTorch Version (e.g. 1.0): '2.4.1+cu121'
CPU Architecture: x86_64
OS (e.g., Linux): Linux, "Ubuntu 22.04.4 LTS"
How you installed PyTorch (conda, pip, libtorch, source): conda + pip
Build command you used (if compiling from source): N/A
Are you using local sources or building from archives: N/A
Python version: 3.10
CUDA version: 12.5
GPU models and configuration: 1 x H100
Any other relevant information: N/A
Additional context
update:
I have found a temporary hotfix by replacing BatchNorm3d with BatchNorm1d. This works for some of our use-cases but we still have many models which do need the full 3d BatchNorm, so a fix would still be greatly appreciated.
@orioninthesky98
I have tried the example in the current latest main and our upcoming 2.5.0 release, both are working as expected.
I think the batchnorm3d bug has been fixed.
Also in terms of the use_fast_partitioner=False, bug: #3157 PR is raised and will be merged into main and 2.5.0 release.
Bug Description
I can't compile this model and the error seems to be caused by
nn.BatchNorm3d
To Reproduce
Steps to reproduce the behavior:
Get the below error (here for full trace: https://gist.github.com/orioninthesky98/9e51a9e83232aa3cac64ce68fe0e512b)
Expected behavior
The model should compile successfully.
Environment
conda
,pip
,libtorch
, source): conda + pipAdditional context
update:
I have found a temporary hotfix by replacing
BatchNorm3d
withBatchNorm1d
. This works for some of our use-cases but we still have many models which do need the full 3d BatchNorm, so a fix would still be greatly appreciated.self.norm = ( nn.BatchNorm1d(in_channels) if self.is_full_preact else nn.BatchNorm1d(out_channels) )
https://gist.github.com/orioninthesky98/8a2012f555b7bd4ce50398ff2a1c9291#file-model-py-L74
log: https://gist.github.com/orioninthesky98/96612bfd59e35344182de44d9a303aa7
related bug:
if I try to set
use_fast_partitioner=False
, the model actually compiles fine, but I get this error at the very end and the script crashes, https://gist.github.com/orioninthesky98/a784c361ebbdfa9000564b3f8a1ac1c0) somebody already filed this bug: #3157The text was updated successfully, but these errors were encountered: