Skip to content

Add Python 3.10 Support for PyTorch Builds#2782

Merged
subodh-dubey-amd merged 2 commits intomainfrom
users/subodh-dubey-amd/pytorch-310-workflow-changes
Feb 16, 2026
Merged

Add Python 3.10 Support for PyTorch Builds#2782
subodh-dubey-amd merged 2 commits intomainfrom
users/subodh-dubey-amd/pytorch-310-workflow-changes

Conversation

@subodh-dubey-amd
Copy link
Copy Markdown
Contributor

@subodh-dubey-amd subodh-dubey-amd commented Jan 6, 2026

Summary

Adds Python 3.10 to the PyTorch build matrix and updates documentation.

Base: This PR is based on PR #2779 (compatibility fixes) and will be merged after it.

Changes

  • Updated GitHub Actions workflows to include Python 3.10 in the build matrix:
    • .github/workflows/release_portable_linux_pytorch_wheels.yml
    • .github/workflows/release_windows_pytorch_wheels.yml
  • Updated RELEASES.md to reflect Python 3.10 support
  • Updated external-builds/pytorch/README.md minimum Python version to 3.10+

Motivation

Python 3.10 is still widely used and many users have requested support for it.

Test Plan

  • Build PyTorch wheels for Python 3.10 on Linux
  • Build PyTorch wheels for Python 3.10 on Windows
  • Run PyTorch smoke tests with Python 3.10

Merge Order

  1. First merge PR Fix Python 3.10 Compatibility Issues #2779 (compatibility fixes)
  2. Then merge this PR Add Python 3.10 Support for PyTorch Builds #2782 (workflow changes)

Results:

Copy link
Copy Markdown
Contributor

@HereThereBeDragons HereThereBeDragons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i approve this now, but as you already stated, this can only be merged after the infrastructure is there to actually build/run with python 3.10

@subodh-dubey-amd subodh-dubey-amd marked this pull request as ready for review January 6, 2026 16:34
Copy link
Copy Markdown
Member

@marbre marbre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the failing Linux build for gfx1153?

@subodh-dubey-amd subodh-dubey-amd force-pushed the users/subodh-dubey-amd/python-310-compatibility-fixes branch 2 times, most recently from e67cd5a to 4cd42ee Compare January 8, 2026 08:24
@subodh-dubey-amd subodh-dubey-amd changed the base branch from users/subodh-dubey-amd/python-310-compatibility-fixes to main January 8, 2026 09:28
@subodh-dubey-amd subodh-dubey-amd force-pushed the users/subodh-dubey-amd/pytorch-310-workflow-changes branch from e04301e to b4372c4 Compare January 8, 2026 09:32
@HereThereBeDragons HereThereBeDragons self-requested a review January 8, 2026 09:33
@HereThereBeDragons
Copy link
Copy Markdown
Contributor

i removed my approval as there are plenty of new additions to this pr.

@subodh-dubey-amd subodh-dubey-amd force-pushed the users/subodh-dubey-amd/pytorch-310-workflow-changes branch 4 times, most recently from 9c27a63 to af63e4b Compare January 13, 2026 11:46
@subodh-dubey-amd subodh-dubey-amd requested review from a team and ScottTodd as code owners January 13, 2026 12:08
@marbre
Copy link
Copy Markdown
Member

marbre commented Jan 13, 2026

We had an issue with a history rewrite which confused the GH UI and the commits it is showing on your PR. Please make sure to update your branch e.g. in the GH UI via

image

Afterwards you need update your local branch via git pull.

- Updated the supported Python versions in RELEASES.md and external-builds/pytorch/README.md to include Python 3.10.
- Modified GitHub workflows for portable Linux and Windows PyTorch wheels to reflect the updated Python version matrix.

This change ensures compatibility with Python 3.10 across relevant documentation and CI configurations.
@subodh-dubey-amd subodh-dubey-amd force-pushed the users/subodh-dubey-amd/pytorch-310-workflow-changes branch from af63e4b to 3a8ce09 Compare January 14, 2026 07:24
@subodh-dubey-amd subodh-dubey-amd marked this pull request as draft January 14, 2026 17:33
Copy link
Copy Markdown
Member

@ScottTodd ScottTodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this as "reviewed" until the dependent changes are merged first.

We should also keep an eye on CI/CD resource usage as the expand the matrix like this. We should have paths through our testing workflows/instructions (https://github.com/ROCm/TheRock/blob/main/docs/development/github_actions_debugging.md#testing-release-workflows and other docs) that limit themselves to a smaller subset of versions so we aren't constantly paying the high costs.

@subodh-dubey-amd subodh-dubey-amd marked this pull request as ready for review January 19, 2026 05:26
subodh-dubey-amd added a commit that referenced this pull request Feb 16, 2026
## Summary
This PR fixes Python 3.10 compatibility issues in the ROCm SDK test
suite and S3 dependency management. **This PR should be merged before
#2782.**

## Changes

### 1. Test Suite: -P Flag Fix
The Python -P flag is only available in 3.11+. Removed the -P flag
entirely from all the files below for all the python version to keep the
code simpler.
  
Files: `test/utils.py`, `test/base_test.py`, `test/core_test.py`,
`test/devel_test.py`, `test/libraries_test.py`
  
  **Why it's ok to skip on Python 3.10 & Other Python version**
  
  - The flag simply doesn't exist for 3.10, so we can't use it.
- Tests still function correctly—they just lack this additional
isolation layer
  - to keep the code simpler and having consistency

### 2. S3 networkx Version Management
- **Upload multiple versions**: networkx 3.4.2 (for Python 3.10) and
latest (for Python 3.11+)
- **Improved version marking**: Only 3.4.2 gets `>=3.10`, all other
networkx versions get `>=3.11`
- Future-proof: handles networkx 4.x and beyond
- Enables correct pip resolution based on Python version

### 3. Code Improvements
- Removed `cp310` skip to enable Python 3.10 wheels
- Refactored `PACKAGES_PER_PROJECT` to use consistent list types

### 4. Fix : ExitCode.OK: numeric argument required
  File: `external-builds/pytorch/run_pytorch_tests.py`
  Exit code from file: ExitCode.OK
B:\runner\_work\_temp\4b851658-eb53-4550-8a2a-18d9c21ad67a.sh: line 4:
exit: ExitCode.OK: numeric argument required
  https://github.com/ROCm/TheRock/actions/runs/21066243924

## Related
- pytorch/pytorch#152191 (networkx compatibility)
- Depends on: #2782 (Python 3.10 PyTorch builds)'


Tests:

Tests are run on the branch
`users/subodh-dubey-amd/pytorch-310-testing`, to check if the
compatibility fixes work with python 3.10 adition.
The branch  `users/subodh-dubey-amd/pytorch-310-testing` is merge of
- `users/subodh-dubey-amd/python-310-compatibility-fixes`
- `users/subodh-dubey-amd/pytorch-310-workflow-changes`

Results:
- Release portable Linux PyTorch Wheels: 
   - https://github.com/ROCm/TheRock/actions/runs/21107222465
   - https://github.com/ROCm/TheRock/actions/runs/21100966209
- Release Windows PyTorch Wheels: 
   - https://github.com/ROCm/TheRock/actions/runs/21094631015
   - https://github.com/ROCm/TheRock/actions/runs/21077437501

---------

Co-authored-by: Marius Brehler <marius.brehler@amd.com>
@subodh-dubey-amd subodh-dubey-amd merged commit c565942 into main Feb 16, 2026
9 checks passed
@subodh-dubey-amd subodh-dubey-amd deleted the users/subodh-dubey-amd/pytorch-310-workflow-changes branch February 16, 2026 10:11
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Feb 16, 2026
@marbre
Copy link
Copy Markdown
Member

marbre commented Feb 16, 2026

@subodh-dubey-amd why was this merged? I don't see an approval by any of the reviewers.

@ScottTodd
Copy link
Copy Markdown
Member

@subodh-dubey-amd why was this merged? I don't see an approval by any of the reviewers.

Seems like the original approval still satisfied the branch protection ruleset:

image

@marbre
Copy link
Copy Markdown
Member

marbre commented Feb 16, 2026

@subodh-dubey-amd why was this merged? I don't see an approval by any of the reviewers.

Seems like the original approval still satisfied the branch protection ruleset:
image

I assume it was not dismissed and @HereThereBeDragons rather re-requested a review from herself. Well, next time :)

@HereThereBeDragons
Copy link
Copy Markdown
Contributor

i tried to overwrite it - but apparently i tried it the wrong way :( if you look at the top you see i am set to "commented" and not "approved"

@marbre
Copy link
Copy Markdown
Member

marbre commented Feb 16, 2026

i tried to overwrite it - but apparently i tried it the wrong way :( if you look at the top you see i am set to "commented" and not "approved"

Re-requesting a review does not revoke an approval it will still be approved. You rather need to dismiss the review next time if the contributor does not take your feedback serious enough. See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/dismissing-a-pull-request-review.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants