Skip to content

Conversation

@larryliu0820
Copy link
Contributor

This pull request enhances the workflow for updating the PyTorch commit pin by also automatically syncing the c10 directories between ExecuTorch and PyTorch. The changes update both the pre-commit hook and the update script to ensure that any time the PyTorch pin is updated, the corresponding source files in runtime/core/portable_type/c10/ are checked and grafted from PyTorch if needed. This helps keep the local codebase consistent with upstream changes and reduces manual maintenance.

Pre-commit hook improvements:

  • The .githooks/pre-commit script now triggers both the PyTorch pin update and the c10 directory sync whenever torch_pin.py is changed, and automatically stages any modified files for commit.

Sync logic and automation:

  • Added new functions in .github/scripts/update_pytorch_pin.py to compare files in ExecuTorch's c10 and torch/headeronly directories against the corresponding PyTorch repo files at the pinned commit, and graft upstream changes when differences are detected.
  • The script fetches file content directly from GitHub using the API, skipping build files and handling missing files gracefully.
  • The main update script now calls the new sync logic after updating the commit pin, and provides clear output indicating the number of files grafted or confirming directories are in sync.

Dependency and import updates:

  • Added necessary imports (base64, hashlib, Path) to support file comparison and GitHub API interactions in the update script.

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 16, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 17 Pending

As of commit a334281 with merge base bf7d755 (image):
💚 Looks good so far! There are no failures yet. 💚

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 16, 2025
@larryliu0820 larryliu0820 marked this pull request as ready for review October 16, 2025 06:17
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

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! And i believe you've tested locally right

@larryliu0820 larryliu0820 merged commit 4bf7e12 into main Oct 16, 2025
135 of 136 checks passed
@larryliu0820 larryliu0820 deleted the c10_sync branch October 16, 2025 18:01
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants