Script or Trace save() to target prior release versions

Hi, as the title says, is it possible to target a prior release.

In our current scenario, we have a tool that supports Torch 1.6 but we have 3rd party models that were created using Torch 1.9 and Torch 1.11

It’s not clear that the models utilize the later features. One option we’ve considered is setting up multiple environments, but checking if this is a supported feature.

2nd question, is there a documentation that discusses torchscript/jit feature additions and breaking changes from Torch 1.6 to Torch 1.13 anywhere online. My initial searching has not yielded much.

No, PyTorch is not forward compatible. Storing a model in the current release might not allow older releases to properly execute it.
Backwards compatibility should work, i.e. storing a model in older releases would allow you to still load and execute it.

I’m not aware of a doc explicitly discussing this, but note that deprecated features are usually raising warning for at least 2 minor releases before breaking changes are introduced.
If you did not see any warnings, you might want to take a look at the release notes and search for some changes which might be related to the issues you are seeing.

I don’t have the full error in front of me, but one was due to not finding .sub_()

Got it, I’ll check the release notes.

That’s a bit weird, as Tensor.sub_ was already available for a long time and also supported on 1.9.0 as seen in the docs. Let me know once you have the warning and get stuck upgrading the code.