pytorch/.github/scripts
Svetlana Karslioglu 4a0d96e496 Add a GH action to autolabel docathon PRs (#127569)
To ease oncall burden for the docathon PR reviewers and ensure all PRs are correctly labeled, adding this GH action that will look for the issue number in the PR and if that issue has a docathon-h1-2024 label, then it would propagate the labels from the issues into the PR. It should not conflict with the existing labelers because we use ``pull_request.add_to_labels`` - credit @kit1980.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127569
Approved by: https://github.com/kit1980
2024-05-31 17:57:07 +00:00
..
amd [ROCm] Parameterize the triton build dir (#125420) 2024-05-08 04:46:52 +00:00
s390x-ci
build_triton_wheel.py [ROCm] Parameterize the triton build dir (#125420) 2024-05-08 04:46:52 +00:00
check_labels.py
cherry_pick.py Fix global flake8 issues (#124771) 2024-04-26 15:35:53 +00:00
close_nonexistent_disable_issues.py
collect_ciflow_labels.py
comment_on_pr.py [EZ][GHF] Rephrase cancelled message (#124947) 2024-04-25 22:24:08 +00:00
convert_lintrunner_annotations_to_github.py
delete_old_branches.py [BE]: TRY002 - Ban raising vanilla exceptions (#124570) 2024-04-21 22:26:40 +00:00
docathon-label-sync.py Add a GH action to autolabel docathon PRs (#127569) 2024-05-31 17:57:07 +00:00
drci_mocks.json.gz Update trymerge to honor the list of unstable failures from Dr.CI (#124965) 2024-04-26 05:10:50 +00:00
ensure_actions_will_cancel.py
export_pytorch_labels.py
file_io_utils.py
filter_test_configs.py Enable test config selection when doing workflow dispatch (#124795) 2024-04-24 03:13:38 +00:00
generate_binary_build_matrix.py CUDA 12.4 ARM wheel integration to CD - nightly build (#126174) 2024-05-27 05:50:36 +00:00
generate_ci_workflows.py [1/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort stdlib (#127122) 2024-05-25 08:25:50 +00:00
generate_docker_release_matrix.py Separate arm64 and amd64 docker builds (#125617) 2024-05-07 11:50:54 +00:00
generate_pytorch_version.py
get_aws_session_tokens.py
get_workflow_job_id.py [BE]: Apply ruff FURB 118. (#124743) 2024-04-26 14:34:52 +00:00
get_workflow_type.py GitHub workflows / Dynamic rollout (#125680) 2024-05-10 07:32:10 +00:00
github_utils.py
gitutils.py
gql_mocks.json.gz Update trymerge to honor the list of unstable failures from Dr.CI (#124965) 2024-04-26 05:10:50 +00:00
kill_active_ssh_sessions.ps1
label_utils.py
lint_native_functions.py
lintrunner.sh [CI] Pin uv==0.1.45 for lintrunner (#126908) 2024-05-22 21:41:21 +00:00
parse_ref.py
pr-sanity-check.sh
pytest_cache.py
pytest_caching_utils.py [TD] Upload names of failures to s3 for pytest cache (#126315) 2024-05-21 16:29:31 +00:00
README.md
report_git_status.sh
rockset_mocks.json.gz
stop_runner_service.sh
sync_distributed_folder_prototype.sh Add script to copy distributed commits to stable branch (#126918) 2024-05-29 03:33:44 +00:00
tag_docker_images_for_release.py
td_llm_indexer.sh
test_check_labels.py
test_filter_test_configs.py Enable test config selection when doing workflow dispatch (#124795) 2024-04-24 03:13:38 +00:00
test_gitutils.py
test_label_utils.py
test_pytest_caching_utils.py
test_trymerge.py Update trymerge to honor the list of unstable failures from Dr.CI (#124965) 2024-04-26 05:10:50 +00:00
test_tryrebase.py
trymerge.py Update trymerge to honor the list of unstable failures from Dr.CI (#124965) 2024-04-26 05:10:50 +00:00
trymerge_explainer.py
tryrebase.py [BE]: TRY002 - Ban raising vanilla exceptions (#124570) 2024-04-21 22:26:40 +00:00
wait_for_ssh_to_drain.ps1

pytorch/.github

NOTE: This README contains information for the .github directory but cannot be located there because it will overwrite the repo README.

This directory contains workflows and scripts to support our CI infrastructure that runs on GitHub Actions.

Workflows

  • 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 main.
  • Binary CI is run to package binaries for distribution for all platforms.

Templates

Templates written in Jinja are located in the .github/templates directory and used to generate workflow files for binary jobs found in the .github/workflows/ directory. These are also a couple of utility templates used to discern common utilities that can be used amongst different templates.

(Re)Generating workflow files

You will need jinja2 in order to regenerate the workflow files which can be installed using:

pip install -r .github/requirements/regenerate-requirements.txt

Workflows can be generated / regenerated using the following command:

.github/regenerate.sh

Adding a new generated binary workflow

New generated binary workflows can be added in the .github/scripts/generate_ci_workflows.py script. You can reference examples from that script in order to add the workflow to the stream that is relevant to what you particularly care about.

Different parameters can be used to achieve different goals, i.e. running jobs on a cron, running only on trunk, etc.

ciflow (trunk)

The label ciflow/trunk can be used to run trunk only workflows. This is especially useful if trying to re-land a PR that was reverted for failing a non-default workflow.

Infra

Currently most of our self hosted runners are hosted on AWS, for a comprehensive list of available runner types you can reference .github/scale-config.yml.

Exceptions to AWS for self hosted:

  • ROCM runners

Adding new runner types

New runner types can be added by committing changes to .github/scale-config.yml. Example: https://github.com/pytorch/pytorch/pull/70474

NOTE: New runner types can only be used once the changes to .github/scale-config.yml have made their way into the default branch

Testing pytorch/builder changes

In order to test changes to the builder scripts:

  1. Specify your builder PR's branch and repo as builder_repo and builder_branch in .github/templates/common.yml.j2.
  2. Regenerate workflow files with .github/regenerate.sh (see above).
  3. Submit fake PR to PyTorch. If changing binaries build, add an appropriate label like ciflow/binaries to trigger the builds.