pytorch / pytorch/TensorRT

✨[Feature] Support for 'extra_files' in torch_tensorrt.save/load

Open
#3,979 1 comment 0 reactions 1 assignee View on GitHub

@cehongwang is already working on this.

Since Jan 13, 2026.

feature request Story: Runtime & Memory & Serialization
Dominant language
Python
Stars
3k
Forks
410
Avg merge
3d 18h
Merged PRs (30d)
78

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.