Skip to content

Update from Torchscript to torch.exportΒ #21293

@SkafteNicki

Description

@SkafteNicki

Outline & Motivation

Torchscript is deprecated in the most recent releases of Pytorch
https://docs.pytorch.org/docs/stable/jit.html
Instead torch.export is the recommended way to go:
https://docs.pytorch.org/docs/stable/export.html

The most obvious change that need to be made is to LightningModule.to_torchscript which either:

  • keep function but update internals to use the new torch.export functionality
  • deprecate/remove and introduce a new function called export or similar that use new functionality
  • deprecate/remove and let users manually export

In addition to this we need to update documentation etc. since there are still multiple references to torch.jit. See this hotfix for when torch v2.9 was released: #21292

Pitch

No response

Additional context

No response

cc @lantiga @justusschock

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions