TensorRT
TensorRT copied to clipboard
Refactor `truncate_long_and_double` in Dynamo
- Explicit considerations of truncation of inputs versus truncation of constants
Sourced from https://github.com/pytorch/TensorRT/pull/2457#issuecomment-1889824984:
- Avoid running PyTorch graphs with invalid casts
- Refactor
repair_long_and_doubleto consume output of type inference - Reorder truncation to come as late as possible in the compilation process
Fix the following validator, which uses torch input types pre-truncation:
https://github.com/pytorch/TensorRT/blob/4b608f0a83460e0e68514f09257c1d0bb9d485ce/py/torch_tensorrt/dynamo/conversion/aten_ops_converters.py#L400-L401