Enable the PyTorch PR review skill - #22748
Conversation
Import the core PyTorch pr-review skill unchanged and route GitHub @claude review requests through it. Authored with Codex.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22748
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 8aecaed with merge base 3faa2e4 ( BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
PyTorch pr-review skill has lots PyTorch-specific references though, and I don't think they all apply to ET. Should we ask for a core ET maintainer to review what should go into that skill? On the other hand, the workflow change LGTM |
|
@claude Review the new pr-review skill, highlight areas that PyTorch-specific and not related to ExecuTorch. Also check if there are areas in the skill where ExecuTorch could adopt the same best practices as PyTorch |
|
Claude finished @huydhn's task in 1m 33s —— View job Review: PyTorch-specific content vs. ExecuTorch applicabilitySummary: This PR imports the PyTorch 🔴 PyTorch-specific — does NOT apply to ExecuTorch
🟢 PyTorch best practices ExecuTorch should adoptThese are backend/framework-agnostic and are genuinely stronger than what ET's
RecommendationI agree with @huydhn's instinct. The workflow routing change ( Suggested path: land the workflow + skill scaffold, then fast-follow with an ET-authored pass that (a) strips the PyTorch-core infra/autograd/serialization sections, (b) rewrites "Infrastructure" around ET backends/delegates/exir passes, (c) rewrites I did not make code changes — this was a review-only request. |
| | Adding required arguments without defaults | Breaking | Add default value instead | | ||
| | Changing argument defaults | Potentially breaking | Document in release notes | | ||
| | Changing return type | Breaking | Deprecation period required | | ||
| | Removing, renaming or updating private API | Potentially Breaking | Validate no usage outside of PyTorch Core via global github search | |
There was a problem hiding this comment.
do we need to update this for ExecuTorch vs PyTorch Core?
izaitsevfb
left a comment
There was a problem hiding this comment.
infra looks good, but as claude mentioned, the prompt has some pytorch-specific residuals, see below
| An API is **public** if: | ||
| - It's name does not start with an `_` | ||
| - Its submodule as reported by `__module__` starts with `"torch."` | ||
| - Its submodule where no name in the path starts with underscore |
There was a problem hiding this comment.
please remove pytorch-specific sections.
🟡 Both tests the backward-compatibility rules give for "is this a public API" are keyed to PyTorch, so neither one selects an ExecuTorch API. (ai-generated section)
Step 3 of the review procedure sends the reviewer to bc-guidelines.md to judge backward compatibility, and that file carries PyTorch's public-API definition verbatim. Its structural test requires the module reported by __module__ to start with "torch."; its fallback test is whether the function is documented on pytorch.org/docs. This project's own APIs live in executorch.* modules and are documented elsewhere, so neither test reaches them, and a reviewer applying the rules literally can conclude there is no public API at stake on a change that does break callers. The file is also silent on the surfaces that carry compatibility risk in an on-device runtime: the serialized program schema in schema/program.fbs, the C++ runtime headers under runtime/, and the backend delegate interface. Changing the module prefix and naming those surfaces would make the step select something.
| - `torch/testing/_internal/opinfo/core.py` - OpInfo test framework | ||
| - `aten/src/ATen/native/native_functions.yaml` - Operator declarations (for checking tags, dispatch keys, structured kernels) | ||
| - `tools/autograd/derivatives.yaml` - Backward formulas (for checking if an op should register here) | ||
| - `aten/src/ATen/native/tags.yaml` - Operator semantic tags |
There was a problem hiding this comment.
make sure that references are correct.
🟡 The imported skill sends the reviewer to five reference files that are not in this repository. (ai-generated section)
SKILL.md closes with a "Files to Reference" list and tells the reviewer to read those files rather than rely on memory. Five of the seven are PyTorch core paths — torch/testing/_internal/common_utils.py, torch/testing/_internal/opinfo/core.py, aten/src/ATen/native/native_functions.yaml, tools/autograd/derivatives.yaml, aten/src/ATen/native/tags.yaml — and none of them exist here; there is no aten/ or torch/ tree in this repository at all. review-checklist.md's "PyTorch Infrastructure" section has the same shape: where a change touches its scope it asks the reviewer to stop and investigate whether a listed ATen or autograd mechanism should have been used, and several of those items turn on editing native_functions.yaml or derivatives.yaml, which a change to this repository cannot do. ExecuTorch declares its operators in kernels/*/functions.yaml instead. A reviewer following the list can dead-end on unreadable paths, or ask an author to adopt infrastructure this project does not carry — in a comment posted on a public pull request. Retargeting the reference list at this repository's own files would keep the rest of the import intact.
Measured: Checked against the full recursive git tree at the reviewed commit; there is no aten/ or torch/ directory..
Import the core PyTorch pr-review skill unchanged and route GitHub @claude review requests through it.