pytorch/.github/scripts
Xuehai Pan 4dce5b71a0 [build] modernize build-frontend: python setup.py develop/install -> [uv ]pip install --no-build-isolation [-e ]. (#156027)
Modernize the development installation:

```bash
# python setup.py develop
python -m pip install --no-build-isolation -e .

# python setup.py install
python -m pip install --no-build-isolation .
```

Now, the `python setup.py develop` is a wrapper around `python -m pip install -e .` since `setuptools>=80.0`:

- pypa/setuptools#4955

`python setup.py install` is deprecated and will emit a warning during run. The warning will become an error on October 31, 2025.

- 9c4d383631/setuptools/command/install.py (L58-L67)

> ```python
> SetuptoolsDeprecationWarning.emit(
>     "setup.py install is deprecated.",
>     """
>     Please avoid running ``setup.py`` directly.
>     Instead, use pypa/build, pypa/installer or other
>     standards-based tools.
>     """,
>     see_url="https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html",
>     due_date=(2025, 10, 31),
> )
> ```

- pypa/setuptools#3849

Additional Resource:

- [Why you shouldn't invoke setup.py directly](https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/156027
Approved by: https://github.com/ezyang
2025-07-09 11:24:27 +00:00
..
amd [BE] fix typos in .ci/, .circleci/, .github/ (#156069) 2025-06-17 09:43:14 +00:00
s390x-ci s390x: use qemu issue workaround for runner registration too (#154030) 2025-05-21 18:30:25 +00:00
windows Revert "Simplify nvtx3 CMake handling, always use nvtx3 (#153784)" 2025-06-24 20:02:07 +00:00
build_triton_wheel.py [CI] Fix triton version split issue (#155670) 2025-06-17 12:42:40 +00:00
check_labels.py [ez] Fix check labels error when deleting comment (#140578) 2024-11-13 23:00:58 +00:00
cherry_pick.py PEP585: .github (#145707) 2025-01-27 21:21:01 +00:00
close_nonexistent_disable_issues.py Fix workflow for closing nonexistent disable issues (#146447) 2025-02-05 22:29:05 +00:00
collect_ciflow_labels.py PEP585: .github (#145707) 2025-01-27 21:21:01 +00:00
comment_on_pr.py [EZ][GHF] Rephrase cancelled message (#124947) 2024-04-25 22:24:08 +00:00
convert_lintrunner_annotations_to_github.py [BE][Easy][2/19] enforce style for empty lines in import segments in .ci/ and .github/ (#129753) 2024-07-16 09:40:00 +00:00
delete_old_branches.py [ez][BE] Tag deletion script to delete any old ciflow + autorevert tags (#157468) 2025-07-02 20:42:32 +00:00
docathon-label-sync.py Update GH action to use the correct label (#154126) 2025-05-23 00:29:43 +00:00
drci_mocks.json.gz Skip signals from older runs of the same workflows (#129291) 2024-06-26 03:49:09 +00:00
ensure_actions_will_cancel.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
export_pytorch_labels.py [BE][Easy][2/19] enforce style for empty lines in import segments in .ci/ and .github/ (#129753) 2024-07-16 09:40:00 +00:00
file_io_utils.py PEP585: .github (#145707) 2025-01-27 21:21:01 +00:00
filter_test_configs.py [ez][CI] Print set output in CI (#157477) 2025-07-02 21:47:19 +00:00
generate_binary_build_matrix.py [BE]: Update NCCL to 2.27.5 (#157108) 2025-07-08 15:40:54 +00:00
generate_ci_workflows.py Enable manywheel build and smoke test on main branch for ROCm (#153287) 2025-06-14 19:14:31 +00:00
generate_docker_release_matrix.py PEP585: .github release triggers (#145708) 2025-02-04 01:02:46 +00:00
generate_pytorch_version.py [BE][Easy][2/19] enforce style for empty lines in import segments in .ci/ and .github/ (#129753) 2024-07-16 09:40:00 +00:00
get_aws_session_tokens.py [CI] Script to fetch creds from current AWS session (#121426) 2024-03-07 19:25:54 +00:00
get_ci_variable.py Automate stable CUDA update and linter using min Python verison (#148912) 2025-03-12 18:12:34 +00:00
get_workflow_job_id.py [ez][CI] Print set output in CI (#157477) 2025-07-02 21:47:19 +00:00
github_utils.py Fix broken URLs (#152237) 2025-04-27 09:56:42 +00:00
gitutils.py [BE] fix typos in .ci/, .circleci/, .github/ (#156069) 2025-06-17 09:43:14 +00:00
gql_mocks.json.gz [trymerge] Error on ghstack commit with multiple PRs (#154941) 2025-06-11 20:26:50 +00:00
kill_active_ssh_sessions.ps1 .github: Enable with-ssh for Windows (#63440) 2021-08-24 14:14:27 -07:00
label_utils.py Fix more URLs (#153277) 2025-05-14 16:23:50 +00:00
lint_native_functions.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
lintrunner.sh [BE][CI][Easy] Run lintrunner on generated .pyi stub files (#150732) 2025-05-27 14:58:02 +00:00
parse_ref.py [ez][CI] Print set output in CI (#157477) 2025-07-02 21:47:19 +00:00
pr-sanity-check.sh [BE] fix typos in .ci/, .circleci/, .github/ (#156069) 2025-06-17 09:43:14 +00:00
pytest_cache.py [BE][Easy][2/19] enforce style for empty lines in import segments in .ci/ and .github/ (#129753) 2024-07-16 09:40:00 +00:00
pytest_caching_utils.py Enable ruff rule S324 (#147665) 2025-02-25 18:27:34 +00:00
README.md Rename default branch to main (#99210) 2023-04-16 18:48:14 -07:00
report_git_status.sh Fix timeout check workflow lint job (#142476) 2024-12-10 20:47:22 +00:00
rockset_mocks.json.gz [BE] Clean up trymerge code handling broken trunk failures (#111520) 2023-10-19 02:30:56 +00:00
runner_determinator.py Revert "[BE]: Enable RUFF TRY400 rule - log.exception (#153473)" 2025-05-16 08:29:26 +00:00
stop_runner_service.sh Stop runner service when its GPU crashes (#97585) 2023-03-29 21:17:13 +00:00
td_llm_indexer.sh [build] modernize build-frontend: python setup.py develop/install -> [uv ]pip install --no-build-isolation [-e ]. (#156027) 2025-07-09 11:24:27 +00:00
test_check_labels.py PEP585: .github (#145707) 2025-01-27 21:21:01 +00:00
test_delete_old_branches.py [ez][BE] Tag deletion script to delete any old ciflow + autorevert tags (#157468) 2025-07-02 20:42:32 +00:00
test_filter_test_configs.py [BE] fix typos in .ci/, .circleci/, .github/ (#156069) 2025-06-17 09:43:14 +00:00
test_gitutils.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
test_label_utils.py [BE] Apply ufmt to run_test and GitHub Python util scripts (#97588) 2023-03-26 04:52:55 +00:00
test_pytest_caching_utils.py Preserve PyTest Cache across job runs (#100522) 2023-05-10 18:37:28 +00:00
test_runner_determinator.py Enable opting out of experiments even when they're being rolled out (#140433) 2024-11-14 19:18:24 +00:00
test_trymerge.py [BE] fix typos in .ci/, .circleci/, .github/ (#156069) 2025-06-17 09:43:14 +00:00
test_tryrebase.py Bot message changes for -f and rebase (#106150) 2023-07-28 16:13:51 +00:00
trymerge_explainer.py [BE][CI] bump ruff to 0.9.0: string quote styles (#144569) 2025-02-24 19:56:09 +00:00
trymerge.py [BE] fix typos in .ci/, .circleci/, .github/ (#156069) 2025-06-17 09:43:14 +00:00
tryrebase.py Fix more URLs (#153277) 2025-05-14 16:23:50 +00:00
update_runner_determinator.py [BE] Add script to keept the runner-determinator scripts in sync (#136794) 2024-10-01 22:26:28 +00:00
upload_aws_ossci.sh Build magma binary tarballs for various cuda (#139888) 2024-11-08 13:28:27 +00:00
wait_for_ssh_to_drain.ps1 .github: Enable with-ssh for Windows (#63440) 2021-08-24 14:14:27 -07:00

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.