refactor(python): migrate torch.jit.script to torch.compile#5759
Merged
jackye1995 merged 1 commit intolance-format:mainfrom Jan 21, 2026
Merged
refactor(python): migrate torch.jit.script to torch.compile#5759jackye1995 merged 1 commit intolance-format:mainfrom
jackye1995 merged 1 commit intolance-format:mainfrom
Conversation
Contributor
Code ReviewSummaryThis PR migrates from the deprecated P0/P1 IssuesP1: Behavioral differences between The migration from
This could cause:
Consider adding Minor Observations
VerdictThe change is reasonable for PyTorch 2.x compatibility, but please verify that the dynamic batching logic in |
38630c3 to
9a24d5a
Compare
9a24d5a to
9153571
Compare
jackye1995
approved these changes
Jan 21, 2026
torch.jit.script is deprecated in PyTorch 2.x. This replaces it with torch.compile which uses the inductor backend for optimization. Also adds torch>=2.0 version constraint and a filterwarning for a PyTorch bug where inductor uses deprecated load_module(). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
9153571 to
b2cad99
Compare
wojiaodoubao
added a commit
to wojiaodoubao/lance
that referenced
this pull request
Jan 22, 2026
…ance-format#5759)" This reverts commit 9a15693.
jackye1995
pushed a commit
to jackye1995/lance
that referenced
this pull request
Jan 23, 2026
…rmat#5759) Closes lance-format#5762 - Replace `@torch.jit.script` with `@torch.compile` in distance.py (6 functions) - Add `torch>=2.0` version constraint - Add filterwarning for PyTorch inductor's use of deprecated `load_module()` - [x] `pytest python/tests/torch_tests/test_distance.py` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
jackye1995
pushed a commit
that referenced
this pull request
Jan 23, 2026
Closes #5762 - Replace `@torch.jit.script` with `@torch.compile` in distance.py (6 functions) - Add `torch>=2.0` version constraint - Add filterwarning for PyTorch inductor's use of deprecated `load_module()` - [x] `pytest python/tests/torch_tests/test_distance.py` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
vivek-bharathan
pushed a commit
to vivek-bharathan/lance
that referenced
this pull request
Feb 2, 2026
…rmat#5759) Closes lance-format#5762 ## Summary - Replace `@torch.jit.script` with `@torch.compile` in distance.py (6 functions) - Add `torch>=2.0` version constraint - Add filterwarning for PyTorch inductor's use of deprecated `load_module()` ## Test plan - [x] `pytest python/tests/torch_tests/test_distance.py` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5762
Summary
@torch.jit.scriptwith@torch.compilein distance.py (6 functions)torch>=2.0version constraintload_module()Test plan
pytest python/tests/torch_tests/test_distance.pypasses🤖 Generated with Claude Code