Skip to content

Replace deprecated torch.jit.trace with torch.compile#3151

Open
mgarrard wants to merge 1 commit intometa-pytorch:mainfrom
mgarrard:export-D91187729
Open

Replace deprecated torch.jit.trace with torch.compile#3151
mgarrard wants to merge 1 commit intometa-pytorch:mainfrom
mgarrard:export-D91187729

Conversation

@mgarrard
Copy link

Summary:
PyTorch is deprecating torch.jit.trace in favor of torch.compile for model optimization. Update the test in test_gpytorch.py to use the recommended torch.compile API instead.

This change aligns with PyTorch's direction toward TorchDynamo-based compilation and ensures the test remains compatible with future PyTorch versions.

Differential Revision: D91187729

Summary:
PyTorch is deprecating `torch.jit.trace` in favor of `torch.compile` for model optimization. Update the test in `test_gpytorch.py` to use the recommended `torch.compile` API instead.

This change aligns with PyTorch's direction toward TorchDynamo-based compilation and ensures the test remains compatible with future PyTorch versions.

Differential Revision: D91187729
@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 22, 2026
@meta-codesync
Copy link

meta-codesync bot commented Jan 22, 2026

@mgarrard has exported this pull request. If you are a Meta employee, you can view the originating Diff in D91187729.

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.97%. Comparing base (6fa901b) to head (b4b2236).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3151      +/-   ##
==========================================
- Coverage   99.97%   99.97%   -0.01%     
==========================================
  Files         219      219              
  Lines       21221    21221              
==========================================
- Hits        21216    21215       -1     
- Misses          5        6       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant