Rename default branch to main (#99210)

Mostly `s/@master/@main` in numerous `.yml` files.

Keep `master` in `weekly.yml` as it refers to `xla` repo and in `test_trymerge.py` as it refers to a branch PR originates from.
This commit is contained in:
Nikita Shulga
2023-04-16 18:48:14 -07:00
committed by GitHub
parent 31f311a816
commit 2418b94576
51 changed files with 114 additions and 122 deletions

View File

@ -106,7 +106,7 @@ All binaries are built in CircleCI workflows except Windows. There are checked-i
Some quick vocab:
* A \**workflow** is a CircleCI concept; it is a DAG of '**jobs**'. ctrl-f 'workflows' on https://github.com/pytorch/pytorch/blob/master/.circleci/config.yml to see the workflows.
* A \**workflow** is a CircleCI concept; it is a DAG of '**jobs**'. ctrl-f 'workflows' on https://github.com/pytorch/pytorch/blob/main/.circleci/config.yml to see the workflows.
* **jobs** are a sequence of '**steps**'
* **steps** are usually just a bash script or a builtin CircleCI command. *All steps run in new environments, environment variables declared in one script DO NOT persist to following steps*
* CircleCI has a **workspace**, which is essentially a cache between steps of the *same job* in which you can store artifacts between steps.
@ -117,8 +117,8 @@ The nightly binaries have 3 workflows. We have one job (actually 3 jobs: build,
1. binary_builds
1. every day midnight EST
2. linux: https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/linux-binary-build-defaults.yml
3. macos: https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/macos-binary-build-defaults.yml
2. linux: https://github.com/pytorch/pytorch/blob/main/.circleci/verbatim-sources/linux-binary-build-defaults.yml
3. macos: https://github.com/pytorch/pytorch/blob/main/.circleci/verbatim-sources/macos-binary-build-defaults.yml
4. For each binary configuration, e.g. linux_conda_3.7_cpu there is a
1. binary_linux_conda_3.7_cpu_build
1. Builds the build. On linux jobs this uses the 'docker executor'.
@ -133,12 +133,12 @@ The nightly binaries have 3 workflows. We have one job (actually 3 jobs: build,
2. Uploads the package
2. update_s3_htmls
1. every day 5am EST
2. https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/binary_update_htmls.yml
2. https://github.com/pytorch/pytorch/blob/main/.circleci/verbatim-sources/binary_update_htmls.yml
3. See below for what these are for and why they're needed
4. Three jobs that each examine the current contents of aws and the conda repo and update some html files in s3
3. binarysmoketests
1. every day
2. https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/nightly-build-smoke-tests-defaults.yml
2. https://github.com/pytorch/pytorch/blob/main/.circleci/verbatim-sources/nightly-build-smoke-tests-defaults.yml
3. For each binary configuration, e.g. linux_conda_3.7_cpu there is a
1. smoke_linux_conda_3.7_cpu
1. Downloads the package from the cloud, e.g. using the official pip or conda instructions
@ -146,26 +146,26 @@ The nightly binaries have 3 workflows. We have one job (actually 3 jobs: build,
## How are the jobs structured?
The jobs are in https://github.com/pytorch/pytorch/tree/master/.circleci/verbatim-sources. Jobs are made of multiple steps. There are some shared steps used by all the binaries/smokes. Steps of these jobs are all delegated to scripts in https://github.com/pytorch/pytorch/tree/master/.circleci/scripts .
The jobs are in https://github.com/pytorch/pytorch/tree/main/.circleci/verbatim-sources. Jobs are made of multiple steps. There are some shared steps used by all the binaries/smokes. Steps of these jobs are all delegated to scripts in https://github.com/pytorch/pytorch/tree/main/.circleci/scripts .
* Linux jobs: https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/linux-binary-build-defaults.yml
* Linux jobs: https://github.com/pytorch/pytorch/blob/main/.circleci/verbatim-sources/linux-binary-build-defaults.yml
* binary_linux_build.sh
* binary_linux_test.sh
* binary_linux_upload.sh
* MacOS jobs: https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/macos-binary-build-defaults.yml
* MacOS jobs: https://github.com/pytorch/pytorch/blob/main/.circleci/verbatim-sources/macos-binary-build-defaults.yml
* binary_macos_build.sh
* binary_macos_test.sh
* binary_macos_upload.sh
* Update html jobs: https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/binary_update_htmls.yml
* Update html jobs: https://github.com/pytorch/pytorch/blob/main/.circleci/verbatim-sources/binary_update_htmls.yml
* These delegate from the pytorch/builder repo
* https://github.com/pytorch/builder/blob/master/cron/update_s3_htmls.sh
* https://github.com/pytorch/builder/blob/master/cron/upload_binary_sizes.sh
* Smoke jobs (both linux and macos): https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/nightly-build-smoke-tests-defaults.yml
* https://github.com/pytorch/builder/blob/main/cron/update_s3_htmls.sh
* https://github.com/pytorch/builder/blob/main/cron/upload_binary_sizes.sh
* Smoke jobs (both linux and macos): https://github.com/pytorch/pytorch/blob/main/.circleci/verbatim-sources/nightly-build-smoke-tests-defaults.yml
* These delegate from the pytorch/builder repo
* https://github.com/pytorch/builder/blob/master/run_tests.sh
* https://github.com/pytorch/builder/blob/master/smoke_test.sh
* https://github.com/pytorch/builder/blob/master/check_binary.sh
* Common shared code (shared across linux and macos): https://github.com/pytorch/pytorch/blob/master/.circleci/verbatim-sources/nightly-binary-build-defaults.yml
* https://github.com/pytorch/builder/blob/main/run_tests.sh
* https://github.com/pytorch/builder/blob/main/smoke_test.sh
* https://github.com/pytorch/builder/blob/main/check_binary.sh
* Common shared code (shared across linux and macos): https://github.com/pytorch/pytorch/blob/main/.circleci/verbatim-sources/nightly-binary-build-defaults.yml
* binary_checkout.sh - checks out pytorch/builder repo. Right now this also checks out pytorch/pytorch, but it shouldn't. pytorch/pytorch should just be shared through the workspace. This can handle being run before binary_populate_env.sh
* binary_populate_env.sh - parses BUILD_ENVIRONMENT into the separate env variables that make up a binary configuration. Also sets lots of default values, the date, the version strings, the location of folders in s3, all sorts of things. This generally has to be run before other steps.
* binary_install_miniconda.sh - Installs miniconda, cross platform. Also hacks this for the update_binary_sizes job that doesn't have the right env variables
@ -308,7 +308,7 @@ Note that the Windows Python wheels are still built in conda environments. Some
* These should all be consolidated
* These must run on all OS types: MacOS, Linux, and Windows
* These all run smoke tests at the moment. They inspect the packages some, maybe run a few import statements. They DO NOT run the python tests nor the cpp tests. The idea is that python tests on master and PR merges will catch all breakages. All these tests have to do is make sure the special binary machinery didnt mess anything up.
* These all run smoke tests at the moment. They inspect the packages some, maybe run a few import statements. They DO NOT run the python tests nor the cpp tests. The idea is that python tests on main and PR merges will catch all breakages. All these tests have to do is make sure the special binary machinery didnt mess anything up.
* There are separate run_tests.sh and smoke_test.sh because one used to be called by the smoke jobs and one used to be called by the binary test jobs (see circleci structure section above). This is still true actually, but these could be united into a single script that runs these checks, given an installed pytorch package.
### Note on libtorch
@ -340,7 +340,7 @@ The Dockerfiles are available in pytorch/builder, but there is no circleci job o
tl;dr make a PR that looks like https://github.com/pytorch/pytorch/pull/21159
Sometimes we want to push a change to master and then rebuild all of today's binaries after that change. As of May 30, 2019 there isn't a way to manually run a workflow in the UI. You can manually re-run a workflow, but it will use the exact same git commits as the first run and will not include any changes. So we have to make a PR and then force circleci to run the binary workflow instead of the normal tests. The above PR is an example of how to do this; essentially you copy-paste the binarybuilds workflow steps into the default workflow steps. If you need to point the builder repo to a different commit then you'd need to change https://github.com/pytorch/pytorch/blob/master/.circleci/scripts/binary_checkout.sh#L42-L45 to checkout what you want.
Sometimes we want to push a change to mainand then rebuild all of today's binaries after that change. As of May 30, 2019 there isn't a way to manually run a workflow in the UI. You can manually re-run a workflow, but it will use the exact same git commits as the first run and will not include any changes. So we have to make a PR and then force circleci to run the binary workflow instead of the normal tests. The above PR is an example of how to do this; essentially you copy-paste the binarybuilds workflow steps into the default workflow steps. If you need to point the builder repo to a different commit then you'd need to change https://github.com/pytorch/pytorch/blob/main/.circleci/scripts/binary_checkout.sh#L42-L45 to checkout what you want.
## How to test changes to the binaries via .circleci

View File

@ -48,7 +48,7 @@ if [[ -n "${CIRCLE_PR_NUMBER:-}" ]]; then
git checkout -q -B "$CIRCLE_BRANCH"
git reset --hard "$CIRCLE_SHA1"
elif [[ -n "${CIRCLE_SHA1:-}" ]]; then
# Scheduled workflows & "smoke" binary build on master on PR merges
# Scheduled workflows & "smoke" binary build on trunk on PR merges
DEFAULT_BRANCH="$(git remote show $CIRCLE_REPOSITORY_URL | awk '/HEAD branch/ {print $NF}')"
git reset --hard "$CIRCLE_SHA1"
git checkout -q -B $DEFAULT_BRANCH
@ -61,7 +61,7 @@ echo "Using Pytorch from "
git --no-pager log --max-count 1
popd
# Clone the Builder master repo
# Clone the Builder main repo
retry git clone -q https://github.com/pytorch/builder.git "$BUILDER_ROOT"
pushd "$BUILDER_ROOT"
echo "Using builder from "

View File

@ -15,12 +15,12 @@ Error messages and stack traces are also helpful.
## System Info
Please copy and paste the output from our
[environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py)
[environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py)
(or fill out the checklist below manually).
You can get the script and run it with:
```
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
```

View File

@ -7,9 +7,9 @@ This directory contains workflows and scripts to support our CI infrastructure t
## Workflows
- Pull CI (`pull.yml`) is run on PRs and on master.
- Pull CI (`pull.yml`) is run on PRs and on main.
- Trunk CI (`trunk.yml`) is run on trunk to validate incoming commits. Trunk jobs are usually more expensive to run so we do not run them on PRs unless specified.
- Scheduled CI (`periodic.yml`) is a subset of trunk CI that is run every few hours on master.
- Scheduled CI (`periodic.yml`) is a subset of trunk CI that is run every few hours on main.
- Binary CI is run to package binaries for distribution for all platforms.
## Templates

View File

@ -35,7 +35,7 @@ def get_latest_commits() -> List[str]:
"git",
"rev-list",
f"{latest_viable_commit}^..HEAD",
"--remotes=*origin/master",
"--remotes=*origin/main",
],
encoding="ascii",
).splitlines()

View File

@ -148,7 +148,7 @@ LINUX_BINARY_SMOKE_WORKFLOWS = [
build_configs=generate_binary_build_matrix.generate_wheels_matrix(
OperatingSystem.LINUX, arches=["11.8"], python_versions=["3.8"]
),
branches="master",
branches="main",
),
BinaryBuildWorkflow(
os=OperatingSystem.LINUX,
@ -156,7 +156,7 @@ LINUX_BINARY_SMOKE_WORKFLOWS = [
build_configs=generate_binary_build_matrix.generate_wheels_matrix(
OperatingSystem.LINUX, arches=["11.7"], python_versions=["3.8"]
),
branches="master",
branches="main",
),
BinaryBuildWorkflow(
os=OperatingSystem.LINUX,
@ -168,7 +168,7 @@ LINUX_BINARY_SMOKE_WORKFLOWS = [
arches=["cpu"],
libtorch_variants=["shared-with-deps"],
),
branches="master",
branches="main",
),
BinaryBuildWorkflow(
os=OperatingSystem.LINUX,
@ -180,7 +180,7 @@ LINUX_BINARY_SMOKE_WORKFLOWS = [
arches=["cpu"],
libtorch_variants=["shared-with-deps"],
),
branches="master",
branches="main",
),
]
@ -243,7 +243,7 @@ WINDOWS_BINARY_SMOKE_WORKFLOWS = [
arches=["cpu"],
libtorch_variants=["shared-with-deps"],
),
branches="master",
branches="main",
),
BinaryBuildWorkflow(
os=OperatingSystem.WINDOWS,
@ -255,7 +255,7 @@ WINDOWS_BINARY_SMOKE_WORKFLOWS = [
arches=["cpu"],
libtorch_variants=["shared-with-deps"],
),
branches="master",
branches="main",
),
]

View File

@ -26,10 +26,10 @@ class TestRebase(TestCase):
"Tests rebase successfully"
pr = GitHubPR("pytorch", "pytorch", 31093)
repo = GitRepo(get_git_repo_dir(), get_git_remote_name())
rebase_onto(pr, repo, "master")
rebase_onto(pr, repo, "main")
calls = [
mock.call("fetch", "origin", "pull/31093/head:pull/31093/head"),
mock.call("rebase", "refs/remotes/origin/master", "pull/31093/head"),
mock.call("rebase", "refs/remotes/origin/main", "pull/31093/head"),
mock.call(
"push",
"-f",
@ -39,7 +39,7 @@ class TestRebase(TestCase):
]
mocked_run_git.assert_has_calls(calls)
self.assertTrue(
"Successfully rebased `master` onto `refs/remotes/origin/master`"
"Successfully rebased `master` onto `refs/remotes/origin/main`"
in mocked_post_comment.call_args[0][3]
)
@ -88,10 +88,10 @@ class TestRebase(TestCase):
"Tests branch already up to date"
pr = GitHubPR("pytorch", "pytorch", 31093)
repo = GitRepo(get_git_repo_dir(), get_git_remote_name())
rebase_onto(pr, repo, "master")
rebase_onto(pr, repo, "main")
calls = [
mock.call("fetch", "origin", "pull/31093/head:pull/31093/head"),
mock.call("rebase", "refs/remotes/origin/master", "pull/31093/head"),
mock.call("rebase", "refs/remotes/origin/main", "pull/31093/head"),
mock.call(
"push",
"-f",
@ -120,9 +120,9 @@ class TestRebase(TestCase):
pr = GitHubPR("pytorch", "pytorch", 31093)
repo = GitRepo(get_git_repo_dir(), get_git_remote_name())
with self.assertRaisesRegex(Exception, "same sha as the target branch"):
rebase_onto(pr, repo, "master")
rebase_onto(pr, repo, "main")
with self.assertRaisesRegex(Exception, "same sha as the target branch"):
rebase_ghstack_onto(pr, repo, "master")
rebase_ghstack_onto(pr, repo, "main")
if __name__ == "__main__":

View File

@ -436,7 +436,7 @@ CIFLOW_TRUNK_LABEL = re.compile(r"^ciflow/trunk")
MERGE_RULE_PATH = Path(".github") / "merge_rules.yaml"
ROCKSET_MERGES_COLLECTION = "merges"
ROCKSET_MERGES_WORKSPACE = "commons"
REMOTE_MAIN_BRANCH = "origin/master"
REMOTE_MAIN_BRANCH = "origin/main"
def gh_graphql(query: str, **kwargs: Any) -> Dict[str, Any]:
@ -636,7 +636,7 @@ def get_ghstack_prs(repo: GitRepo, pr: "GitHubPR") -> List[Tuple["GitHubPR", str
if not are_ghstack_branches_in_sync(repo, stacked_pr.head_ref()):
raise RuntimeError(
f"PR {stacked_pr.pr_num} is out of sync with the corresponding revision {rev} on "
+ f"branch {orig_ref} that would be merged into master. "
+ f"branch {orig_ref} that would be merged into main. "
+ "This usually happens because there is a non ghstack change in the PR. "
+ f"Please sync them and try again (ex. make the changes on {orig_ref} and run ghstack)."
)

View File

@ -50,8 +50,8 @@ def make_pr(repo_name: str, branch_name: str) -> Any:
params = {
"title": f"[{repo_name} hash update] update the pinned {repo_name} hash",
"head": branch_name,
"base": "master",
"body": "This PR is auto-generated nightly by [this action](https://github.com/pytorch/pytorch/blob/master/"
"base": "main",
"body": "This PR is auto-generated nightly by [this action](https://github.com/pytorch/pytorch/blob/main/"
+ f".github/workflows/_update-commit-hash.yml).\nUpdate the pinned {repo_name} hash.",
}
response = git_api(f"/repos/{OWNER}/{REPO}/pulls", params, type="post")

View File

@ -36,7 +36,7 @@ jobs:
keep-going: ${{ steps.filter.outputs.keep-going }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false
@ -64,7 +64,7 @@ jobs:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup Linux
uses: ./.github/actions/setup-linux

View File

@ -36,7 +36,7 @@ jobs:
keep-going: ${{ steps.filter.outputs.keep-going }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false
@ -64,7 +64,7 @@ jobs:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup Linux
uses: ./.github/actions/setup-linux

View File

@ -40,7 +40,7 @@ jobs:
keep-going: ${{ steps.filter.outputs.keep-going }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false
@ -68,7 +68,7 @@ jobs:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup Linux
uses: ./.github/actions/setup-linux
@ -163,7 +163,7 @@ jobs:
# detached container should get cleaned up by teardown_ec2_linux
export SHARD_NUMBER=0
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-master}")
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-main}")
# sanitize the input commit message and PR body here:
#

View File

@ -131,7 +131,7 @@ jobs:
with:
github-secret: ${{ secrets.github-token }}
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup Linux
uses: ./.github/actions/setup-linux
- name: Chown workspace

View File

@ -128,7 +128,7 @@ jobs:
github-secret: ${{ secrets.github-token }}
# Setup the environment
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup Linux
uses: ./.github/actions/setup-linux
- name: Chown workspace

View File

@ -10,7 +10,7 @@ on:
use_s3:
type: boolean
default: true
description: If true, will download artifacts from s3. Otherwise will use the default github artifact download action
description: If true, will download artifacts from s3. Otherwise will use the default GitHub artifact download action
PYTORCH_ROOT:
required: false
type: string
@ -26,7 +26,7 @@ on:
DESIRED_CUDA:
required: true
type: string
description: Desired Cuda version
description: Desired CUDA version
GPU_ARCH_VERSION:
required: false
type: string
@ -96,7 +96,7 @@ jobs:
SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
no-sudo: true

View File

@ -22,7 +22,7 @@ jobs:
keep-going: ${{ steps.filter.outputs.keep-going }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false
@ -43,7 +43,7 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Set up JDK 8
uses: actions/setup-java@v3

View File

@ -22,7 +22,7 @@ jobs:
docker-image: ${{ steps.calculate-docker-image.outputs.docker-image }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
submodules: false

View File

@ -76,7 +76,7 @@ jobs:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup Linux
uses: ./.github/actions/setup-linux
@ -121,7 +121,7 @@ jobs:
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+)\.* ]]; then
target="${BASH_REMATCH[1]}"
else
target="master"
target="main"
fi
# detached container should get cleaned up by teardown_ec2_linux
container_name=$(docker run \

View File

@ -43,7 +43,7 @@ jobs:
keep-going: ${{ steps.filter.outputs.keep-going }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false
@ -67,7 +67,7 @@ jobs:
steps:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Populate CI build options
run: |

View File

@ -76,7 +76,7 @@ jobs:
# checkout because when we run this action we don't *have* a local
# checkout. In other cases you should prefer a local checkout.
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup Linux
uses: ./.github/actions/setup-linux

View File

@ -57,7 +57,7 @@ jobs:
docker exec -it $(docker container ps --format '{{.ID}}') bash
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup Linux
uses: ./.github/actions/setup-linux
@ -150,7 +150,7 @@ jobs:
TEST_COMMAND=.ci/pytorch/test.sh
fi
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-master}")
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-main}")
# sanitize the input commit message and PR body here:
#

View File

@ -75,7 +75,7 @@ jobs:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Set xcode version
env:

View File

@ -40,7 +40,7 @@ jobs:
keep-going: ${{ steps.filter.outputs.keep-going }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false

View File

@ -73,7 +73,7 @@ jobs:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Download build artifacts
uses: ./.github/actions/download-build-artifacts
@ -134,7 +134,7 @@ jobs:
# shellcheck disable=SC1090
set -ex
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-master}")
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-main}")
# sanitize the input commit message and PR body here:
#

View File

@ -56,7 +56,7 @@ jobs:
steps:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
no-sudo: true
@ -135,7 +135,7 @@ jobs:
TEST_COMMAND=.ci/pytorch/test.sh
fi
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-master}")
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-main}")
# sanitize the input commit message and PR body here:
#

View File

@ -22,7 +22,7 @@ jobs:
keep-going: ${{ steps.filter.outputs.keep-going }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false
@ -45,7 +45,7 @@ jobs:
steps:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup miniconda
uses: pytorch/test-infra/.github/actions/setup-miniconda@main

View File

@ -70,7 +70,7 @@ jobs:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
no-sudo: true

View File

@ -97,7 +97,7 @@ jobs:
# [see note: pytorch repo ref]
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
no-sudo: true
@ -165,7 +165,7 @@ jobs:
PYTORCH_TEST_CUDA_MEM_LEAK_CHECK: ${{ matrix.mem_leak_check && '1' || '0' }}
PYTORCH_TEST_RERUN_DISABLED_TESTS: ${{ matrix.rerun_disabled_tests && '1' || '0' }}
run: |
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-master}")
COMMIT_MESSAGES=$(git cherry -v "origin/${GIT_DEFAULT_BRANCH:-main}")
# sanitize the input commit message and PR body here:
#

View File

@ -4,7 +4,6 @@ on:
push:
branches:
- main
- master
paths:
- .github/workflows/build-triton-wheel.yml
- .github/scripts/build_triton_wheel.py
@ -40,7 +39,7 @@ jobs:
github-secret: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
submodules: false
@ -129,7 +128,7 @@ jobs:
name: "pytorch-triton-wheel-3.11"
path: "${{ runner.temp }}/artifacts/"
- name: Upload binaries
if: ${{ github.event_name == 'push' && (github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/main') }}
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
env:
PKG_DIR: "${{ runner.temp }}/artifacts"
# When running these on pull_request events these should be blank
@ -162,7 +161,7 @@ jobs:
github-secret: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
submodules: false
@ -192,7 +191,7 @@ jobs:
docker exec -t "${container_name}" python /pytorch/.github/scripts/build_triton_wheel.py --build-conda --py-version="${PY_VERS}"
- name: Upload artifacts to Anaconda
if: ${{ github.event_name == 'push' && (github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/main') }}
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
run: |
container_name=$(docker container ps --format '{{.ID}}')
docker exec -t "${container_name}" sh -c "anaconda upload /artifacts/torch*.tar.bz2 -u pytorch-nightly --label main --no-progress --force"

View File

@ -15,7 +15,7 @@ jobs:
runs-on: linux.20_04.4x
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
submodules: false
fetch-depth: 1

View File

@ -4,7 +4,6 @@ on:
push:
tags: ['v*']
branches:
- master
- main
- nightly
release:

View File

@ -8,7 +8,6 @@ on:
- .github/workflows/docker-builds.yml
push:
branches:
- master
- main
- release/*
- landchecks/*
@ -60,7 +59,7 @@ jobs:
# [see note: pytorch repo ref]
# deep clone (fetch-depth 0) required for git merge-base
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- name: Setup Linux
uses: ./.github/actions/setup-linux

View File

@ -7,7 +7,7 @@ name: linux-binary-libtorch-cxx11-abi
on:
push:
branches:
- master
- main
tags:
- 'ciflow/trunk/*'
workflow_dispatch:

View File

@ -7,7 +7,7 @@ name: linux-binary-libtorch-pre-cxx11
on:
push:
branches:
- master
- main
tags:
- 'ciflow/trunk/*'
workflow_dispatch:

View File

@ -7,7 +7,7 @@ name: linux-binary-manywheel
on:
push:
branches:
- master
- main
tags:
- 'ciflow/trunk/*'
workflow_dispatch:

View File

@ -7,7 +7,7 @@ name: windows-binary-libtorch-debug
on:
push:
branches:
- master
- main
tags:
- 'ciflow/trunk/*'
workflow_dispatch:

View File

@ -7,7 +7,7 @@ name: windows-binary-libtorch-release
on:
push:
branches:
- master
- main
tags:
- 'ciflow/trunk/*'
workflow_dispatch:

View File

@ -3,7 +3,6 @@ name: inductor
on:
push:
branches:
- master
- main
tags:
- ciflow/inductor/*

View File

@ -4,7 +4,6 @@ on:
pull_request:
push:
branches:
- master
- main
- release/*
- landchecks/*
@ -108,7 +107,7 @@ jobs:
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip-pr-sanity-checks')
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
submodules: false
fetch-depth: -1
@ -146,7 +145,7 @@ jobs:
echo ' .github/scripts/generate_ci_workflows.py'
echo
echo 'If running that command does nothing, you may need to rebase'
echo 'onto a more recent commit from the PyTorch master branch.'
echo 'onto a more recent commit from the PyTorch main branch.'
RC=1
fi
@ -221,7 +220,7 @@ jobs:
# [see note: pytorch repo ref]
# deep clone (fetch-depth 0) required, to allow us to use git log
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
submodules: false
fetch-depth: 1

View File

@ -15,7 +15,7 @@ jobs:
runs-on: [self-hosted, linux.2xlarge]
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false

View File

@ -4,7 +4,6 @@ on:
pull_request:
push:
branches:
- master
- main
- release/*
- landchecks/*
@ -355,7 +354,7 @@ jobs:
]}
linux-focal-rocm5_4_2-py3_8-build:
# don't run build twice on master
# don't run build twice on main
if: github.event_name == 'pull_request'
name: linux-focal-rocm5.4.2-py3.8
uses: ./.github/workflows/_linux-build.yml

View File

@ -6,7 +6,7 @@ on:
schedule:
- cron: '32 16 * * 3'
push:
branches: [ "master" ]
branches: [ "main" ]
# Declare default permissions as read only.
permissions: read-all

View File

@ -3,7 +3,6 @@ name: trunk
on:
push:
branches:
- master
- main
- release/*
- landchecks/*

View File

@ -44,7 +44,7 @@ jobs:
set -ex
if [ -n "${REBASE}" ]; then
python3 .github/scripts/tryrebase.py "${PR_NUM}" --branch "${REBASE}"
git checkout master
git checkout main
git fetch -p
# give github some time between the push and start workflows so that Github's messages
# on the PR appear in chronological order (timing issues can shuffle them around)

View File

@ -3,7 +3,6 @@ name: unstable
on:
push:
branches:
- master
- main
tags:
- ciflow/unstable/*

View File

@ -14,7 +14,7 @@ jobs:
if: ${{ github.repository == 'pytorch/pytorch' }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
fetch-depth: 1
submodules: false

View File

@ -37,7 +37,7 @@ jobs:
run: echo "${TRIGGERING_WORKFLOW}"
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
- run: |
pip3 install requests==2.26

View File

@ -28,7 +28,7 @@ jobs:
name: Upload dynamo performance stats for ${{ github.event.workflow_run.id }}, attempt ${{ github.event.workflow_run.run_attempt }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
submodules: false
fetch-depth: 1

View File

@ -1060,7 +1060,7 @@ Note: There's a [compilation issue](https://github.com/oneapi-src/oneDNN/issues/
linter and static analysis tool based on the clang compiler. We run clang-tidy
in our CI to make sure that new C++ code is safe, sane and efficient. See the
[`clang-tidy` job in our GitHub Workflow's
lint.yml file](https://github.com/pytorch/pytorch/blob/master/.github/workflows/lint.yml)
lint.yml file](https://github.com/pytorch/pytorch/blob/main/.github/workflows/lint.yml)
for the simple commands we use for this.
To run clang-tidy locally, follow these steps:
@ -1100,7 +1100,7 @@ If you have already committed files and
CI reports `flake8` errors, you can run the check locally in your PR branch with:
```bash
flake8 $(git diff --name-only $(git merge-base --fork-point master))
flake8 $(git diff --name-only $(git merge-base --fork-point main))
```
You'll need to install an appropriately configured flake8; see
@ -1241,11 +1241,11 @@ our [CI wiki](https://github.com/pytorch/pytorch/wiki/Debugging-using-with-ssh-f
### Which commit is used in CI?
For CI run on `master`, this repository is checked out for a given `master`
For CI run on `main`, this repository is checked out for a given `main`
commit, and CI is run on that commit (there isn't really any other choice).
For PRs, however, it's a bit more complicated. Consider this commit graph, where
`master` is at commit `A`, and the branch for PR #42 (just a placeholder) is at
`main` is at commit `A`, and the branch for PR #42 (just a placeholder) is at
commit `B`:
```
@ -1253,7 +1253,7 @@ commit `B`:
/ \
/ C (refs/pull/42/merge)
/ /
---o---o---o---A (merge-destination) - usually master
---o---o---o---A (merge-destination) - usually main
```
There are two possible choices for which commit to use:
@ -1261,7 +1261,7 @@ There are two possible choices for which commit to use:
1. Checkout commit `B`, the head of the PR (manually committed by the PR
author).
2. Checkout commit `C`, the hypothetical result of what would happen if the PR
were merged into it's destination (usually `master`).
were merged into it's destination (usually `main`).
For all practical purposes, most people can think of the commit being used as
commit `B` (choice **1**).
@ -1269,7 +1269,7 @@ commit `B` (choice **1**).
However, if workflow files (which govern CI behavior) were modified (either by your PR or since dev branch were created ) there's
a nuance to know about:
The workflow files themselves get taken from checkpoint `C`, the merger of your
PR and the `master` branch. But only the workflow files get taken from that merged
PR and the `main` branch. But only the workflow files get taken from that merged
checkpoint. Everything else (tests, code, etc) all get taken directly from your
PR's commit (commit `B`). Please note, this scenario would never affect PRs authored by `ghstack` as they would not automatically ingest the updates from default branch.

View File

@ -1,4 +1,4 @@
![PyTorch Logo](https://github.com/pytorch/pytorch/blob/master/docs/source/_static/img/pytorch-logo-dark.png)
![PyTorch Logo](https://github.com/pytorch/pytorch/blob/main/docs/source/_static/img/pytorch-logo-dark.png)
--------------------------------------------------------------------------------
@ -8,7 +8,7 @@ PyTorch is a Python package that provides two high-level features:
You can reuse your favorite Python packages such as NumPy, SciPy, and Cython to extend PyTorch when needed.
Our trunk health (Continuous Integration signals) can be found at [hud.pytorch.org](https://hud.pytorch.org/ci/pytorch/pytorch/master).
Our trunk health (Continuous Integration signals) can be found at [hud.pytorch.org](https://hud.pytorch.org/ci/pytorch/pytorch/main).
<!-- toc -->
@ -93,7 +93,7 @@ from several research papers on this topic, as well as current and past work suc
While this technique is not unique to PyTorch, it's one of the fastest implementations of it to date.
You get the best of speed and flexibility for your crazy research.
![Dynamic graph](https://github.com/pytorch/pytorch/blob/master/docs/source/_static/img/dynamic_graph.gif)
![Dynamic graph](https://github.com/pytorch/pytorch/blob/main/docs/source/_static/img/dynamic_graph.gif)
### Python First
@ -264,7 +264,7 @@ Professional, or Community Editions. You can also install the build tools from
https://visualstudio.microsoft.com/visual-cpp-build-tools/. The build tools *do not*
come with Visual Studio Code by default.
If you want to build legacy python code, please refer to [Building on legacy code and CUDA](https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md#building-on-legacy-code-and-cuda)
If you want to build legacy python code, please refer to [Building on legacy code and CUDA](https://github.com/pytorch/pytorch/blob/main/CONTRIBUTING.md#building-on-legacy-code-and-cuda)
**CPU-only builds**
@ -275,7 +275,7 @@ conda activate
python setup.py develop
```
Note on OpenMP: The desired OpenMP implementation is Intel OpenMP (iomp). In order to link against iomp, you'll need to manually download the library and set up the building environment by tweaking `CMAKE_INCLUDE_PATH` and `LIB`. The instruction [here](https://github.com/pytorch/pytorch/blob/master/docs/source/notes/windows.rst#building-from-source) is an example for setting up both MKL and Intel OpenMP. Without these configurations for CMake, Microsoft Visual C OpenMP runtime (vcomp) will be used.
Note on OpenMP: The desired OpenMP implementation is Intel OpenMP (iomp). In order to link against iomp, you'll need to manually download the library and set up the building environment by tweaking `CMAKE_INCLUDE_PATH` and `LIB`. The instruction [here](https://github.com/pytorch/pytorch/blob/main/docs/source/notes/windows.rst#building-from-source) is an example for setting up both MKL and Intel OpenMP. Without these configurations for CMake, Microsoft Visual C OpenMP runtime (vcomp) will be used.
**CUDA based build**
@ -289,9 +289,9 @@ Currently, VS 2017 / 2019, and Ninja are supported as the generator of CMake. If
<br/> If Ninja is selected as the generator, the latest MSVC will get selected as the underlying toolchain.
Additional libraries such as
[Magma](https://developer.nvidia.com/magma), [oneDNN, a.k.a MKLDNN or DNNL](https://github.com/oneapi-src/oneDNN), and [Sccache](https://github.com/mozilla/sccache) are often needed. Please refer to the [installation-helper](https://github.com/pytorch/pytorch/tree/master/.ci/pytorch/win-test-helpers/installation-helpers) to install them.
[Magma](https://developer.nvidia.com/magma), [oneDNN, a.k.a MKLDNN or DNNL](https://github.com/oneapi-src/oneDNN), and [Sccache](https://github.com/mozilla/sccache) are often needed. Please refer to the [installation-helper](https://github.com/pytorch/pytorch/tree/main/.ci/pytorch/win-test-helpers/installation-helpers) to install them.
You can refer to the [build_pytorch.bat](https://github.com/pytorch/pytorch/blob/master/.ci/pytorch/win-test-helpers/build_pytorch.bat) script for some other environment variables configurations
You can refer to the [build_pytorch.bat](https://github.com/pytorch/pytorch/blob/main/.ci/pytorch/win-test-helpers/build_pytorch.bat) script for some other environment variables configurations
```cmd
@ -397,7 +397,7 @@ Three-pointers to get you started:
- [Tutorials: get you started with understanding and using PyTorch](https://pytorch.org/tutorials/)
- [Examples: easy to understand PyTorch code across all domains](https://github.com/pytorch/examples)
- [The API Reference](https://pytorch.org/docs/)
- [Glossary](https://github.com/pytorch/pytorch/blob/master/GLOSSARY.md)
- [Glossary](https://github.com/pytorch/pytorch/blob/main/GLOSSARY.md)
## Resources

View File

@ -150,7 +150,7 @@ git push origin v1.12.0-rc2
Pushing a release candidate should trigger the `binary_builds` workflow within CircleCI using [`pytorch/pytorch-probot`](https://github.com/pytorch/pytorch-probot)'s [`trigger-circleci-workflows`](trigger-circleci-workflows) functionality.
This trigger functionality is configured here: [`pytorch-circleci-labels.yml`](https://github.com/pytorch/pytorch/blob/master/.github/pytorch-circleci-labels.yml)
This trigger functionality is configured here: [`pytorch-circleci-labels.yml`](https://github.com/pytorch/pytorch/blob/main/.github/pytorch-circleci-labels.yml)
To view the state of the release build, please navigate to [HUD](https://hud.pytorch.org/hud/pytorch/pytorch/release%2F1.12). and make sure all binary builds are successful.
### Release Candidate Storage
@ -190,7 +190,7 @@ Please also make sure to add milestone target to the PR/issue, especially if it
## Promoting RCs to Stable
Promotion of RCs to stable is done with this script:
[`pytorch/builder:release/promote.sh`](https://github.com/pytorch/builder/blob/master/release/promote.sh)
[`pytorch/builder:release/promote.sh`](https://github.com/pytorch/builder/blob/main/release/promote.sh)
Users of that script should take care to update the versions necessary for the specific packages you are attempting to promote.