Releasing a new version of PyTorch generally entails 3 major steps:
Following Requirements needs to be met prior to final RC Cut:
python github_analyze.py --repo-path ~/local/pytorch --remote upstream --branch release/1.11 --milestone-id 26 --missing-in-branch
pytorch/pytorch
Release branches are typically cut from the branch viable/strict
as to ensure that tests are passing on the release branch.
There's a convenience script to create release branches from current viable/strict
(from root pytorch/pytorch
):
DRY_RUN=disabled scripts/release/cut-release-branch.sh
This script should create 2 branches:
release/{MAJOR}.{MINOR}
orig/release/{MAJOR}.{MINOR}
pytorch/builder
/ PyTorch domain librariesConvenience script can also be used domains as well as pytorch/builder
NOTE: RELEASE_VERSION only needs to be specified if version.txt is not available in root directory
DRY_RUN=disabled GIT_BRANCH_TO_CUT_FROM=main RELEASE_VERSION=1.11 scripts/release/cut-release-branch.sh
These are examples of changes that should be made to release branches so that CI / tooling can function normally on them:
pytorch/xla
and pytorch/builder
repos and pinned in pytorch/pytorch
These are examples of changes that should be made to the default branch after a release branch is cut
Create a PR from release/{MAJOR}.{MINOR}
to orig/release/{MAJOR}.{MINOR}
in order to start CI testing for cherry-picks into release branch.
Example:
To draft RCs, a user with the necessary permissions can push a git tag to the main pytorch/pytorch
git repository.
The git tag for a release candidate must follow the following format:
v{MAJOR}.{MINOR}.{PATCH}-rc{RC_NUMBER}
An example of this would look like:
v1.8.1-rc1
Pushing a release candidate should trigger the binary_builds
workflow within CircleCI using pytorch/pytorch-probot
's trigger-circleci-workflows
functionality.
This trigger functionality is configured here: pytorch-circleci-labels.yml
Release candidates are currently stored in the following places:
Backups are stored in a non-public S3 bucket at s3://pytorch-backup
Typically within a release cycle fixes are necessary for regressions, test fixes, etc.
For fixes that are to go into a release after the release branch has been cut we typically employ the use of a cherry pick tracker.
An example of this would look like:
Please also make sure to add milestone target to the PR/issue, especially if it needs to be considered for inclusion into the dot release.
NOTE: The cherry pick process is not an invitation to add new features, it is mainly there to fix regressions
Promotion of RCs to stable is done with this script: pytorch/builder:release/promote.sh
Users of that script should take care to update the versions necessary for the specific packages you are attempting to promote.
Promotion should occur in two steps:
NOTE: The promotion of wheels to PyPI can only be done once so take caution when attempting to promote wheels to PyPI, (see https://github.com/pypa/warehouse/issues/726 for a discussion on potential draft releases within PyPI)
The following should be prepared for the release day
Need to modify release matrix for get started page. See following PR as reference.
After modifying published_versions.json you will need to regenerate regenerate the quick-start-module.js file run following command
python3 scripts/gen_quick_start_module.py >assets/quick-start-module.js
Please note: This PR needs to be merged on the release day and hence it should be absolutely free of any failures. To test this PR, open another test PR but pointing to to the Release candidate location as above Release Candidate Storage
This is normally done right after the release is completed. We would need to create Google Colab Issue see following PR
A patch release is a maintenance release of PyTorch that includes fixes for regressions found in a previous minor release. Patch releases typically will bump the patch
version from semver (i.e. [major].[minor].[patch]
Patch releases should be considered if a regression meets the following criteria:
NOTE: Patch releases should only be considered when functionality is broken, documentation does not typically fall within this category
Main POC: Triage Reviewers
triage review
1.9.1
) if the regressions if found to be within the Patch Release CriteriaMain POC: Patch Release Managers
release/1.9
for 1.9.1
)Main POC: Patch Release managers
In the event a submodule cannot be fast forwarded and a patch must be applied we can take two different approaches:
Editing submodule remotes can be easily done with: (running from the root of the git repository)
git config --file=.gitmodules -e
An example of this process can be found here: