3
3
PyTorch and PyTorch/XLA use CI to lint, build, and test each PR that is
4
4
submitted. All CI tests should succeed before the PR is merged into master.
5
5
PyTorch CI pins PyTorch/XLA to a specific commit. On the other hand, PyTorch/XLA
6
- CI pulls PyTorch from master unless a pin is manually provided. This README will
7
- go through the reasons of these pins, how to pin a PyTorch/XLA PR to an upstream
8
- PyTorch PR, and how to coordinate a merge for breaking PyTorch changes.
6
+ CI pulls PyTorch from ` .torch_commit ` unless a pin is manually provided. This
7
+ README will go through the reasons of these pins, how to pin a PyTorch/XLA PR
8
+ to an upstream PyTorch PR, and how to coordinate a merge for breaking PyTorch
9
+ changes.
9
10
10
11
## Usage
11
12
12
- ### Pinning PyTorch PR in PyTorch/XLA PR
13
+ ### Temporarily Pinning PyTorch PR in PyTorch/XLA PR
13
14
14
15
Sometimes a PyTorch/XLA PR needs to be pinned to a specific PyTorch PR to test
15
- new features, fix breaking changes, etc. Since PyTorch/XLA CI pulls from PyTorch
16
- master by default, we need to manually provide a PyTorch pin. In a PyTorch/XLA
17
- PR, PyTorch can be manually pinned by creating a ` .torch_pin ` file at the root
18
- of the repository. The ` .torch_pin ` should have the corresponding PyTorch PR
19
- number prefixed by "#". Take a look at [ example
20
- here] ( https://github.com/pytorch/xla/pull/7313 ) . Before the PyTorch/XLA PR gets
21
- merged, the ` .torch_pin ` must be deleted.
16
+ new features, fix breaking changes, etc. In a PyTorch/XLA PR, PyTorch can be
17
+ manually pinned by creating a ` .torch_pin ` file at the root of the repository.
18
+ The ` .torch_pin ` should have the corresponding PyTorch PR number prefixed by
19
+ "#". Take a look at [ example here] ( https://github.com/pytorch/xla/pull/7313 ) .
20
+ Before the PyTorch/XLA PR gets merged, the ` .torch_pin ` must be deleted and
21
+ ` .torch_commit ` updated.
22
22
23
23
### Coordinating merges for breaking PyTorch PRs
24
24
@@ -35,10 +35,11 @@ fail. Steps for fixing and merging such breaking PyTorch change is as following:
35
35
PyTorch PR to pin the PyTorch/XLA to the commit hash created in step 1 by
36
36
updating ` pytorch/.github/ci_commit_pins/xla.txt ` .
37
37
1 . Once CI tests are green on both ends, merge PyTorch PR.
38
- 1 . Remove the ` .torch_pin ` in PyTorch/XLA PR and merge. To be noted, `git commit
39
- --amend` should be avoided in this step as PyTorch CI will keep using the
40
- commit hash created in step 1 until other PRs update that manually or the
41
- nightly buildbot updates that automatically.
38
+ 1 . Remove the ` .torch_pin ` in PyTorch/XLA PR and update the ` .torch_commit ` to
39
+ the hash of the merged PyTorch PR. To be noted, ` git commit --amend ` should
40
+ be avoided in this step as PyTorch CI will keep using the commit hash
41
+ created in step 1 until other PRs update that manually or the nightly
42
+ buildbot updates that automatically.
42
43
1 . Finally, don't delete your branch until 2 days later. See step 4 for
43
44
explanations.
44
45
@@ -47,6 +48,18 @@ fail. Steps for fixing and merging such breaking PyTorch change is as following:
47
48
The ` build_and_test.yml ` workflow runs tests on the TPU in addition to CPU.
48
49
The set of tests run on the TPU is defined in ` test/tpu/run_tests.sh ` .
49
50
51
+ ## Update the PyTorch Commit Pin
52
+
53
+ In order to reduce development burden of PyTorch/XLA, starting from #9654 , we
54
+ started pinning PyTorch using the ` .torch_commit ` file. This should reduce the
55
+ number of times a PyTorch PR breaks our most recent commits. However, this also
56
+ requires maintenance, i.e. someone has to keep updating the PyTorch commit so
57
+ as to make sure it's always supporting (almost) the latest PyTorch versions.
58
+
59
+ Updating the PyTorch commit pin is, theoretically, simple. You just have to run
60
+ ` scripts/update_deps.py --pytorch ` file, and open a PR. In practice, you may
61
+ encounter a few compilation errors, or even segmentation faults.
62
+
50
63
## CI Environment
51
64
52
65
Before the CI in this repository runs, we build a base dev image. These are the
@@ -152,13 +165,6 @@ good" commit to prevent accidental changes from PyTorch/XLA to break PyTorch CI
152
165
without warning. PyTorch has hundreds of commits each week, and this pin ensures
153
166
that PyTorch/XLA as a downstream package does not cause failures in PyTorch CI.
154
167
155
- #### Why does PyTorch/XLA CI pull from PyTorch master?
156
-
157
- [ PyTorch/XLA CI pulls PyTorch from master] [ pull-pytorch-master ] unless a PyTorch
158
- pin is manually provided. PyTorch/XLA is a downstream package to PyTorch, and
159
- pulling from master ensures that PyTorch/XLA will stay up-to-date and works with
160
- the latest PyTorch changes.
161
-
162
168
#### TPU CI is broken
163
169
164
170
If the TPU CI won't run, try to debug using the following steps:
0 commit comments