-
Notifications
You must be signed in to change notification settings - Fork 376
Description
Is your feature request related to a problem? Please describe.
Currently, torch_tensorrt.save and torch_tensorrt.load do not expose the extra_files parameter. It is impossible to bundle metadata or configuration directly within the model artifact because these functions do not allow passing this argument to the underlying save/load mechanisms. (see as an example https://github.com/pytorch/TensorRT/blob/2e1fba66d8024ac719e15484d28d3f32fb8552bb/py/torch_tensorrt/_compile.py#L685C17-L685C22)
Describe the solution you'd like
I would like torch_tensorrt.save and torch_tensorrt.load to include the extra_files variable in their signature and pass it internally to the torch.jit.save/load and torch.export.save/load functions, which already support this functionality.
Describe alternatives you've considered
Manually wrapping the torch_tensorrt output into a ZIP archive, adding unnecessary boilerplate.
Additional context
The core PyTorch functions already implement this:
- torch.jit.save/load (via _extra_files)
- torch.export.save/load (via extra_files)
The request is simply to expose this existing capability through the torch_tensorrt API to allow for self-contained model packages.