Skip to content

Conversation

@larryliu0820
Copy link
Contributor

@larryliu0820 larryliu0820 commented Oct 13, 2025

This pull request introduces a new script, .github/scripts/update_pytorch_pin.py, which automates the process of updating the PyTorch commit pin based on the nightly version specified in torch_pin.py. The script parses the nightly version, fetches the corresponding commit hash from the PyTorch nightly branch using the GitHub API, and updates the pin file accordingly. This automation helps ensure that the CI environment uses the correct nightly commit for PyTorch.

Automation of PyTorch nightly pin updating:

  • Added .github/scripts/update_pytorch_pin.py, a script that reads the nightly version from torch_pin.py, parses the date, fetches the corresponding commit hash from the PyTorch nightly branch via the GitHub API, and updates .ci/docker/ci_commit_pins/pytorch.txt with the new hash.

Test plan:

Run .githooks/install.sh
Tested manually by changing NIGHTLY_VERSION and try to commit locally. Was able to see .ci/docker/ci_commit_pins/pytorch.txt being updated.

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 13, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15072

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 3 New Failures, 3 Cancelled Jobs, 13 Pending, 3 Unrelated Failures

As of commit a4f8fee with merge base 481c9cf (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 13, 2025
@larryliu0820 larryliu0820 added the release notes: none Do not include this in the release notes label Oct 13, 2025
@@ -0,0 +1,57 @@
# Git Hooks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean this line or the whole file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel like it is helpful. Developers will have to do some manual install to enable this.

Copy link
Contributor

@Gasoonjia Gasoonjia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!! I can get rid of my CI #15070

@larryliu0820 larryliu0820 merged commit 7efe09c into main Oct 13, 2025
126 of 148 checks passed
@larryliu0820 larryliu0820 deleted the add_precommit_hook branch October 13, 2025 22:24
Gasoonjia pushed a commit that referenced this pull request Oct 14, 2025
…s/pytorch.txt when torch_pin.py is changed. (#15072)

This pull request introduces a new script,
`.github/scripts/update_pytorch_pin.py`, which automates the process of
updating the PyTorch commit pin based on the nightly version specified
in `torch_pin.py`. The script parses the nightly version, fetches the
corresponding commit hash from the PyTorch nightly branch using the
GitHub API, and updates the pin file accordingly. This automation helps
ensure that the CI environment uses the correct nightly commit for
PyTorch.

Automation of PyTorch nightly pin updating:

* Added `.github/scripts/update_pytorch_pin.py`, a script that reads the
nightly version from `torch_pin.py`, parses the date, fetches the
corresponding commit hash from the PyTorch nightly branch via the GitHub
API, and updates `.ci/docker/ci_commit_pins/pytorch.txt` with the new
hash.

Test plan:

Run `.githooks/install.sh`
Tested manually by changing `NIGHTLY_VERSION` and try to commit locally.
Was able to see `.ci/docker/ci_commit_pins/pytorch.txt` being updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants