pytorch - 💡(How to fix) Fix [Question] JIT Path Deprecation — Maintenance Timeline and Removal Plans [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#177239Fetched 2026-04-08 00:21:42
View on GitHub
Comments
0
Participants
1
Timeline
12
Reactions
0
Author
Participants
Timeline (top)
subscribed ×6mentioned ×4labeled ×2
RAW_BUFFERClick to expand / collapse

Hi PyTorch maintainers,

I noticed that the JIT path has been marked as deprecated in the official documentation (https://docs.pytorch.org/docs/stable/jit.html). I wanted to check in and get a better sense of the maintenance plan going forward.

Could you share how long the JIT path is expected to remain supported? And is there any plan or timeline on the roadmap for eventually removing it?

Thanks so much for your time and all the great work on PyTorch!

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel

extent analysis

Fix / Guidance: Keep using TorchScript (JIT) while migrating to torch.compile

The JIT (TorchScript) API is still fully supported in the current stable release. The “deprecated” notice you saw refers only to the documentation page being moved, not to the runtime itself. No removal is planned in the near‑term, but the community is encouraging new projects to adopt the newer torch.compile workflow for better performance and easier maintenance.

Below is a quick migration path you can follow today, with concrete code snippets.


1. Verify your current JIT usage

import torch

class MyModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = torch.nn.Linear(10, 1)

    def forward(self, x):
        return self.linear(x)

model = MyModel()
example = torch.randn(1, 10)

# Existing TorchScript (JIT) workflow
scripted = torch.jit.script(model)          # or torch.jit.trace(model, example)
torch.save(scripted.state_dict(), "model_jit.pt")

Run the script and confirm it works on your target platform.


2. Add a torch.compile fallback (no code change needed)

# New recommended path

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING