TRTorch PTQ in Python #346
narendasan
started this conversation in
RFCs
Replies: 1 comment
-
cc: @peri044 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TRTorch PTQ in Python
Goal: Implement support for using PyTorch DataLoaders inside TensorRT Int8Calibrators from Python
Explicit Requirements:
Proposed Supported Use-cases
1. Using PyTorch DataLoader in Calibrator
Primarily we want to support the use case where developers have existing data loaders perhaps from training and repurposing that infrastructure to quickly do calibration. All that should be required is providing a data loader to a constructor which will wrap it for use by the calibration APIs in TRT.
Potential Implementation
We want to make sure there is no explicit dependency on the TensorRT Python API so we should reexport the bare minimum of the Int8Calibrator APIs and implement a class in python using the data loader
2. Using standard TensorRT Calibrator
We want to make sure we maintain compatibility with existing TRT infrastructure, so if users have existing calibrator implementations in python they can reuse it with TRTorch without code changes.
3. Using cache file directly
Finally if users already have a cache file they can simply point to it and do calibration.
Potential Approach to Implementation
Beta Was this translation helpful? Give feedback.
All reactions