Repository navigation
[dynamo] Remove Python 3.10 support code - #199417
guilhermeleobas wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/199417
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 5b485ab with merge base 090a616 ( 🟡 GREEN LIGHT - PR was reverted - re-landing requires human review:
Green Light will not review this PR again, on this or any later commit; re-landing it needs a human approval. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
5402769 to
d3d80fa
Compare
|
@pytorchbot rebase |
d3d80fa to
3790f96
Compare
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
3790f96 to
bb77a11
Compare
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 2 jobs have failed, first few of them are: trunk / win-vs2022-cuda13.2-py3 / build, trunk / win-vs2022-cpu-py3 / build Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
This reverts commit 86c735f. Reverted #199417 on behalf of https://github.com/pytorch-auto-revert due to Reverted automatically by pytorch's autorevert, to avoid this behaviour add the tag autorevert: disable ([comment](#199417 (comment)))
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
bb77a11 to
6658171
Compare
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
> PyTorch 2.15 raises the minimum Python to 3.11, and CI no longer runs 3.10 > (pytorch#198271, pytorch#198501, pytorch#198531). This removes the 3.10-only code from > torch/_dynamo and torch/csrc/dynamo: the IS_PYTHON_3_11_PLUS branches, the > handlers and builders for opcodes that don't exist on 3.11+ (including the > pre-3.9 SETUP_LOOP/SETUP_EXCEPT and BUILD_*_UNPACK handlers), the 3.10 > block-stack exception handling, the lnotab writer, and remove_pointless_jumps, > which only matched JUMP_ABSOLUTE and so was a no-op on 3.11+. Behavior on > 3.11+ doesn't change. The `sys.version_info` guards against 3.11 in > test/dynamo are unwrapped as well, keeping the 3.11+ branch. > > get_framelocals_idx keeps its last-match lookup: its comment attributed > duplicate localsplus names to <= 3.10, but Dynamo's resume functions still > produce them on 3.11 (test_no_recompile_inner_function fails without it). > > This depends on requires-python being raised to >=3.11; don't merge it > before that lands. > > Test Plan: CPU-only build on Python 3.11. lintrunner is clean, and the > dynamo test files touching this code pass except for failures caused by the > local environment (no LAPACK): > > ``` > uv pip install -e . -v --no-build-isolation > python -m pytest test/dynamo/test_<name>.py -q # 43 files, run in parallel > ``` > > Authored with Claude Code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Successfully rebased |
6658171 to
5b485ab
Compare
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
## Summary Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds. - `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier. - `README.md`: the source-build prerequisite says "Python 3.11 or later". ## Why The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry: ``` Requires-Python: >=3.10 Classifier: Programming Language :: Python :: 3.10 ``` That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (#198233, #199398) only changed build and CI config and did not touch `pyproject.toml`. ## Not changed - `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment. - The Python 3.10 code paths in dynamo; #199417 handles those. ## Testing `pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR. Pull Request resolved: #202271 Approved by: https://github.com/huydhn, https://github.com/albanD
) ## Summary Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds. - `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier. - `README.md`: the source-build prerequisite says "Python 3.11 or later". - `[tool.ruff] target-version = "py310"`: pinned so lint does not change (see below). ## Why The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry: ``` Requires-Python: >=3.10 Classifier: Programming Language :: Python :: 3.10 ``` That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (pytorch#198233, pytorch#199398) only changed build and CI config and did not touch `pyproject.toml`. ## Lint Ruff derives its target version from `requires-python`, so raising it to 3.11 enabled the pyupgrade rules for 3.11 and failed the Lint job: 257 findings in 162 files (UP036 obsolete `sys.version_info` checks 104, UP035 `typing_extensions` imports 101, UP044 `Unpack` 30, UP017 `datetime.UTC` 20, UP041 2). I reproduced the same counts locally with `ruff==0.14.4` and the repo config. 134 of the fixes need `--unsafe-fixes`, and they touch `torch/_dynamo` files that the Python 3.10 cleanup PRs (pytorch#199417) are editing, so they do not belong in a metadata change. This PR pins `target-version = "py310"` in `[tool.ruff]`, which restores the previous lint behavior: on the 162 files `ruff check` passes, and `ruff format --check` reports the same single file (`torch/utils/checkpoint.py`) as on the base commit. The pin should be removed together with the Python 3.10 code cleanup. ## Not changed - `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment. - The Python 3.10 code paths in dynamo; pytorch#199417 handles those. ## Testing `pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. With the pin, `ruff check` (ruff 0.14.4, repo config) passes on all 162 files the Lint job had flagged. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR. Pull Request resolved: pytorch#202271 Approved by: https://github.com/huydhn, https://github.com/albanD
Summary: > PyTorch 2.15 raises the minimum Python to 3.11, and CI no longer runs 3.10 > (#198271, #198501, #198531). This removes the 3.10-only code from > torch/_dynamo and torch/csrc/dynamo: the IS_PYTHON_3_11_PLUS branches, the > handlers and builders for opcodes that don't exist on 3.11+ (including the > pre-3.9 SETUP_LOOP/SETUP_EXCEPT and BUILD_*_UNPACK handlers), the 3.10 > block-stack exception handling, the lnotab writer, and remove_pointless_jumps, > which only matched JUMP_ABSOLUTE and so was a no-op on 3.11+. Behavior on > 3.11+ doesn't change. > > get_framelocals_idx keeps its last-match lookup: its comment attributed > duplicate localsplus names to <= 3.10, but Dynamo's resume functions still > produce them on 3.11 (test_no_recompile_inner_function fails without it). > > This depends on requires-python being raised to >=3.11; don't merge it > before that lands. > > Test Plan: CPU-only build on Python 3.11. lintrunner is clean, and the > dynamo test files touching this code pass except for failures caused by the > local environment (no LAPACK): > > ``` > uv pip install -e . -v --no-build-isolation > python -m pytest test/dynamo/test_<name>.py -q # 43 files, run in parallel > ``` > > Authored with Claude Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) X-link: pytorch/pytorch#199417 Approved by: https://github.com/rtimpe Reviewed By: jeanschmidt Differential Revision: D127909109 fbshipit-source-id: 06b003c62e1c1e04e4e37d8f6d685af659f53464 Co-authored-by: Claude Opus 5.5 <[email protected]>
> PyTorch 2.15 raises the minimum Python to 3.11, and CI no longer runs 3.10 > (pytorch#198271, pytorch#198501, pytorch#198531). This removes the 3.10-only code from > torch/_dynamo and torch/csrc/dynamo: the IS_PYTHON_3_11_PLUS branches, the > handlers and builders for opcodes that don't exist on 3.11+ (including the > pre-3.9 SETUP_LOOP/SETUP_EXCEPT and BUILD_*_UNPACK handlers), the 3.10 > block-stack exception handling, the lnotab writer, and remove_pointless_jumps, > which only matched JUMP_ABSOLUTE and so was a no-op on 3.11+. Behavior on > 3.11+ doesn't change. > > get_framelocals_idx keeps its last-match lookup: its comment attributed > duplicate localsplus names to <= 3.10, but Dynamo's resume functions still > produce them on 3.11 (test_no_recompile_inner_function fails without it). > > This depends on requires-python being raised to >=3.11; don't merge it > before that lands. > > Test Plan: CPU-only build on Python 3.11. lintrunner is clean, and the > dynamo test files touching this code pass except for failures caused by the > local environment (no LAPACK): > > ``` > uv pip install -e . -v --no-build-isolation > python -m pytest test/dynamo/test_<name>.py -q # 43 files, run in parallel > ``` > > Authored with Claude Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Pull Request resolved: pytorch#199417 Approved by: https://github.com/rtimpe Co-authored-by: Claude Opus 5.5 <[email protected]>
) ## Summary Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds. - `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier. - `README.md`: the source-build prerequisite says "Python 3.11 or later". ## Why The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry: ``` Requires-Python: >=3.10 Classifier: Programming Language :: Python :: 3.10 ``` That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (pytorch#198233, pytorch#199398) only changed build and CI config and did not touch `pyproject.toml`. ## Not changed - `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment. - The Python 3.10 code paths in dynamo; pytorch#199417 handles those. ## Testing `pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR. Pull Request resolved: pytorch#202271 Approved by: https://github.com/huydhn, https://github.com/albanD
) ## Summary Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds. - `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier. - `README.md`: the source-build prerequisite says "Python 3.11 or later". - `[tool.ruff] target-version = "py310"`: pinned so lint does not change (see below). ## Why The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry: ``` Requires-Python: >=3.10 Classifier: Programming Language :: Python :: 3.10 ``` That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (pytorch#198233, pytorch#199398) only changed build and CI config and did not touch `pyproject.toml`. ## Lint Ruff derives its target version from `requires-python`, so raising it to 3.11 enabled the pyupgrade rules for 3.11 and failed the Lint job: 257 findings in 162 files (UP036 obsolete `sys.version_info` checks 104, UP035 `typing_extensions` imports 101, UP044 `Unpack` 30, UP017 `datetime.UTC` 20, UP041 2). I reproduced the same counts locally with `ruff==0.14.4` and the repo config. 134 of the fixes need `--unsafe-fixes`, and they touch `torch/_dynamo` files that the Python 3.10 cleanup PRs (pytorch#199417) are editing, so they do not belong in a metadata change. This PR pins `target-version = "py310"` in `[tool.ruff]`, which restores the previous lint behavior: on the 162 files `ruff check` passes, and `ruff format --check` reports the same single file (`torch/utils/checkpoint.py`) as on the base commit. The pin should be removed together with the Python 3.10 code cleanup. ## Not changed - `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment. - The Python 3.10 code paths in dynamo; pytorch#199417 handles those. ## Testing `pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. With the pin, `ruff check` (ruff 0.14.4, repo config) passes on all 162 files the Lint job had flagged. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR. Pull Request resolved: pytorch#202271 Approved by: https://github.com/huydhn, https://github.com/albanD
) ## Summary Raise the minimum Python in the package metadata from 3.10 to 3.11, to match what 2.15 builds. - `pyproject.toml`: `requires-python = ">=3.11"`, and remove the `Programming Language :: Python :: 3.10` classifier. - `README.md`: the source-build prerequisite says "Python 3.11 or later". - `[tool.ruff] target-version = "py310"`: pinned so lint does not change (see below). ## Why The binary build matrix no longer includes Python 3.10: `FULL_PYTHON_VERSIONS` in `.github/scripts/generate_binary_build_matrix.py` starts at `3.11`, and the 2.15.0 wheels on the test channel are `cp311` to `cp315` (plus `cp314t` and `cp315t`), with no `cp310`. `pyproject.toml` was not updated, so the 2.15.0 wheels carry: ``` Requires-Python: >=3.10 Classifier: Programming Language :: Python :: 3.10 ``` That tells PyPI and `pip show` that 3.10 is supported, and makes `uv` and Poetry try to resolve 2.15 for Python 3.10 and fail on a missing wheel instead of reporting that 3.11 is required. The PRs that dropped 3.10 from the builds (pytorch#198233, pytorch#199398) only changed build and CI config and did not touch `pyproject.toml`. ## Lint Ruff derives its target version from `requires-python`, so raising it to 3.11 enabled the pyupgrade rules for 3.11 and failed the Lint job: 257 findings in 162 files (UP036 obsolete `sys.version_info` checks 104, UP035 `typing_extensions` imports 101, UP044 `Unpack` 30, UP017 `datetime.UTC` 20, UP041 2). I reproduced the same counts locally with `ruff==0.14.4` and the repo config. 134 of the fixes need `--unsafe-fixes`, and they touch `torch/_dynamo` files that the Python 3.10 cleanup PRs (pytorch#199417) are editing, so they do not belong in a metadata change. This PR pins `target-version = "py310"` in `[tool.ruff]`, which restores the previous lint behavior: on the 162 files `ruff check` passes, and `ruff format --check` reports the same single file (`torch/utils/checkpoint.py`) as on the base commit. The pin should be removed together with the Python 3.10 code cleanup. ## Not changed - `[tool.ruff]` settings and the `# TODO: Remove Python-3.10 specific suppressions` comment. - The Python 3.10 code paths in dynamo; pytorch#199417 handles those. ## Testing `pyproject.toml` parses (`tomllib`), and `project.requires-python` is `>=3.11` with the classifiers `3 :: Only`, `3.11` to `3.15`. With the pin, `ruff check` (ruff 0.14.4, repo config) passes on all 162 files the Lint job had flagged. I did not build a wheel or an sdist from this change. Cherry-pick to `release/2.15` is a separate PR. Pull Request resolved: pytorch#202271 Approved by: https://github.com/huydhn, https://github.com/albanD
🤖 Generated with Claude Code
cc @albanD @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @jataylo @azahed98