Skip to content

Commit 87f4656

Browse files
authored
Merge pull request #65 from pytorch/rfc-38
Proposal for change of CPython supported versions
2 parents d18e107 + 2f1e625 commit 87f4656

File tree

3 files changed

+107
-1
lines changed

3 files changed

+107
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RFCs are located in their own repository.
2222

2323
To create one:
2424

25-
1. For the https://github.com/pytorch/rfcs repository
25+
1. Fork the https://github.com/pytorch/rfcs repository
2626
2. Copy the template file `RFC-0000-template.md` to `RFC-00xx-your-feature.md` and fill it out with your proposal. The template is a guideline, feel free to add sections as appropriate
2727
3. You may also have the template simply link to another editor, like a Google Docs file, but please ensure that the document is publicly visible. This can make the template easier to add edit, but commenting doesn’t scale very well, so please use this option with caution.
2828

RFC-0038-assets/cpython_support.png

904 KB
Loading

RFC-0038-cpython-support.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
2+
# [CPython version support]
3+
4+
**Authors:**
5+
* @albanD
6+
7+
## **Motivation**
8+
9+
CPython follows annual release cycle. Given that the amount of work to enable and sunset versions yearly is fixed, we should be proactive in how we handle these tasks.
10+
This RFC suggests an updated policy we want for CPython version support, CI/CD requirements and the proposed yearly timeline for enablement/sunsetting.
11+
12+
The key requirements driving this proposal are:
13+
- Enable new versions as soon as possible
14+
- Sunset old versions in a timely manner
15+
- Set clear long-term expectations for our users
16+
- Mitigate the risk of a CPython change that would render PyTorch non-functional making it to the CPython final release
17+
- Minimize any work that would not have been needed if the enablement was done post-final release
18+
19+
20+
## **Proposed Implementation**
21+
22+
### Proposed timeline
23+
24+
![Summary timeline](./RFC-0038-assets/cpython_support.png)
25+
26+
### Which CPython version are supported
27+
28+
PyTorch supports all CPython versions that are fully released and have not reached end of life: https://devguide.python.org/versions/
29+
30+
Note: This is an update from the current policy at https://github.com/pytorch/pytorch/blob/main/RELEASE.md#python which is following NumPy’s approach. In practice, we are not following the rules stated in that .md and following the rule stated just above here. We are updating the rule (instead of enforcing the NEP above) as the cost of supporting more versions is minimal.
31+
Also split build to have a single (large) c++ package shared by all CPython version is way underway (https://github.com/pytorch/pytorch/pull/129011) and will reduce the binary size use on PyPi even though we support a large number of versions.
32+
33+
### What is tested in CI/CD
34+
35+
The goal here is for us to ensure coverage of testing while reducing the cost on CI.
36+
37+
At any given time, we should run:
38+
- General CI on PR and trunk should run on the oldest supported version.
39+
- Maintainers can ask for specific CI shard to run on specific versions:
40+
- Long term for testing features tightly bound to CPython versions (for example Dynamo).
41+
- Temporarily for enablement work (for example while a new CPython version is being enabled).
42+
- CD for docker and binaries should run for all supported versions.
43+
- Wheel/release smoke test should run on all supported versions.
44+
45+
46+
### Detailed CPython new version enablement
47+
48+
- Enable new version basic compilation
49+
- When: Once the first beta version is released (Usually in May)
50+
- Planned for 3.13: 5/07
51+
- ETA: 1-2 weeks. Before beta 2
52+
- Goal: Fix compilation issues allowing to compile PyTorch locally. Report any needed patch in CPython before beta 2.
53+
- Who: Core Maintainers for pytorch/pytorch + relevant maintainers for managed domains
54+
- Note: If a patch is needed in CPython, it will be made available easily until next beta release happens
55+
- Enable new version CI/CD Infrastructure
56+
- When: As soon as basic compilation is done
57+
- ETA: 2-3 weeks.
58+
- Goal: Generate nightly wheels and scaffolding for new version testing
59+
- Who: Core Infra
60+
- High risk enablement work for the new version for submodules
61+
- When: as soon as the CI/CD infrastructure is done
62+
- ETA: before CPython first RC
63+
- Planned for 3.13: 07/30
64+
- Goal: Verify high risk systems and report any needed patch in CPython such that they can be fixed before RC1
65+
- Who: High risk systems owners. As of today this is Dynamo C++ code and python binding subsystems.
66+
- Low risk enablement work for the new version for submodules
67+
- When: as soon as the CI/CD infrastructure is done
68+
- ETA: before CPython final RC
69+
- Planned for 3.13: 09/03
70+
- Goal: Enable all testing for the new CPython version
71+
- Who: Core Maintainers handle the long tail of issues. Specific submodule owner handle larger migration efforts (dynamo, TorchScript, etc)
72+
- Full new version wheel release
73+
- When: When the new cpython verion is officially released (Usually in October)
74+
- Planned for 3.13: 10/01
75+
- ETA: 2 week
76+
- Goal: Update nightlies to track the final release and advertise it as fully working
77+
- Who: Infra + Comms
78+
- Full new version conda release
79+
- When: When the new cpython version and our runtime dependencies are supported onconda
80+
- ETA: 2 week
81+
- Goal: Push binaries that are officially supported
82+
- Who: Infra + Comms
83+
84+
85+
### Detailed CPython old version Sunset
86+
87+
- Deprecate old version
88+
- When: During the release process of the last PyTorch release before the oldest version of python goes EOL
89+
- Planned for 3.8: October
90+
- Goal: announce deprecation of the oldest cpython version on dev-discuss + release
91+
- Who: Comms
92+
- Stop releasing nightly binaries for oldest version
93+
- When: Once the last supported release happened
94+
- ETA: 2 weeks
95+
- Goal: remove all wheel and conda binaries for the EOL version
96+
- Who: Infra
97+
- Upgrade oldest version CI
98+
- When: After nightlies are not published anymore
99+
- ETA: 2 weeks
100+
- Goal: migrate all the CI jobs running on the oldest version to the soon-to-be oldest version
101+
- Who: Infra
102+
- Remove un-used code and use new features
103+
- When: After the version is fully dropped
104+
- ETA: N/A
105+
- Goal: clean up tech debt related to older cpython versions and simplify code using new features.
106+
- Who: All

0 commit comments

Comments
 (0)