|
39 | 39 | - [Why no leak detection?](#why-no-leak-detection)
|
40 | 40 | - [Caffe2 notes](#caffe2-notes)
|
41 | 41 | - [CI failure tips](#ci-failure-tips)
|
| 42 | + - [Which commit is used in CI?](#which-commit-is-used-in-ci) |
42 | 43 |
|
43 | 44 | ## Contributing to PyTorch
|
44 | 45 |
|
@@ -1137,8 +1138,9 @@ Once you submit a PR or push a new commit to a branch that is in
|
1137 | 1138 | an active PR, CI jobs will be run automatically. Some of these may
|
1138 | 1139 | fail and you will need to find out why, by looking at the logs.
|
1139 | 1140 |
|
1140 |
| -Fairly often, a CI failure might be unrelated to your changes. In this |
1141 |
| -case, you can usually ignore the failure. |
| 1141 | +Fairly often, a CI failure might be unrelated to your changes. In this case, you |
| 1142 | +can usually ignore the failure. See [the following |
| 1143 | +subsection](#which-commit-is-used-in-ci) for more details. |
1142 | 1144 |
|
1143 | 1145 | Some failures might be related to specific hardware or environment
|
1144 | 1146 | configurations. In this case, if the job is run by CircleCI, you can
|
@@ -1169,3 +1171,56 @@ following steps:
|
1169 | 1171 | For certain Windows failures, it may be useful to have a full [Remote
|
1170 | 1172 | Desktop](https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-clients) connection. See detailed instructions [here](https://github.com/pytorch/pytorch/wiki/Debugging-Windows-with-Remote-Desktop-or-CDB-(CLI-windbg)-on-CircleCI)
|
1171 | 1173 | for how to set that up after rerunning the job.
|
| 1174 | + |
| 1175 | +### Which commit is used in CI? |
| 1176 | + |
| 1177 | +For CI run on `master`, this repository is checked out for a given `master` |
| 1178 | +commit, and CI is run on that commit (there isn't really any other choice). For |
| 1179 | +PRs, however, it's a bit more complicated. Consider this commit graph, where |
| 1180 | +`master` is at commit `A`, and the branch for PR #42 (just a placeholder) is at |
| 1181 | +commit `B`: |
| 1182 | + |
| 1183 | +``` |
| 1184 | + o---o---B (refs/pull/42/head) |
| 1185 | + / \ |
| 1186 | + / C (refs/pull/42/merge) |
| 1187 | + / / |
| 1188 | +---o---o---o---A (refs/heads/master) |
| 1189 | +``` |
| 1190 | + |
| 1191 | +There are two possible choices for which commit to use: |
| 1192 | + |
| 1193 | +1. Checkout commit `B`, the head of the PR (manually committed by the PR |
| 1194 | + author). |
| 1195 | +2. Checkout commit `C`, the hypothetical result of what would happen if the PR |
| 1196 | + were merged into `master` (automatically generated by GitHub). |
| 1197 | + |
| 1198 | +This choice depends on several factors; here is the decision tree as of |
| 1199 | +2021-03-30: |
| 1200 | + |
| 1201 | +- For CI jobs on CircleCI: |
| 1202 | + - If the name of the job (or one of its ancestors in the workflow DAG) |
| 1203 | + contains "xla" or "gcc5", choice **2** is used. This includes the following |
| 1204 | + jobs: |
| 1205 | + - pytorch_linux_xenial_py3_6_gcc5_4_build |
| 1206 | + - pytorch_cpp_doc_build |
| 1207 | + - pytorch_doc_test |
| 1208 | + - pytorch_linux_backward_compatibility_check_test |
| 1209 | + - pytorch_linux_xenial_py3_6_gcc5_4_jit_legacy_test |
| 1210 | + - pytorch_linux_xenial_py3_6_gcc5_4_test |
| 1211 | + - pytorch_python_doc_build |
| 1212 | + - pytorch_xla_linux_bionic_py3_6_clang9_build |
| 1213 | + - pytorch_xla_linux_bionic_py3_6_clang9_test |
| 1214 | + - Otherwise, choice **1** is used. |
| 1215 | +- For CI jobs on GitHub Actions: |
| 1216 | + - If the PR was created using [`ghstack`](https://github.com/ezyang/ghstack), |
| 1217 | + choice **1** is used. |
| 1218 | + - Otherwise, choice **2** is used. |
| 1219 | + |
| 1220 | +This is important to be aware of, because if you see a CI failure on your PR and |
| 1221 | +choice **2** is being used for that CI job, it is possible that the failure is |
| 1222 | +nondeterministically caused by a commit that does not exist in the ancestry of |
| 1223 | +your PR branch. If you happen to have write access to this repo, you can choose |
| 1224 | +to use `ghstack` to eliminate this nondeterminism for GitHub Actions jobs on |
| 1225 | +your PRs, but it will still be present for the select CircleCI jobs listed |
| 1226 | +above. |
0 commit comments