TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

Refactor `truncate_long_and_double` in Dynamo

Open gs-olive opened this issue 2 years ago • 1 comments

  • 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_double to consume output of type inference
  • Reorder truncation to come as late as possible in the compilation process

gs-olive avatar Jan 12 '24 20:01 gs-olive

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

gs-olive avatar Jan 19 '24 21:01 gs-olive