Skip to content

Conversation

@swolchok
Copy link
Contributor

@swolchok swolchok commented Sep 11, 2025

lintrunner is required to land, but it takes 10-15 minutes. This seems to improve on that by:

  • split out lintrunner-mypy job
  • copy pytorch/pytorch's changed files tracking
  • don't run lintrunner init unnecessarily

[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

swolchok commented Sep 11, 2025

Stack from ghstack (oldest at bottom):

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 11, 2025

🔗 Helpful Links

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

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

❌ 2 Cancelled Jobs, 3 Pending, 5 Unrelated Failures

As of commit d93113d with merge base e6b9111 (image):

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

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

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.

swolchok added a commit that referenced this pull request Sep 11, 2025
lintrunner is required to land, but it takes 10-15 minutes. Can we cut that down if we split out MYPY?


ghstack-source-id: f89f9ee
ghstack-comment-id: 3282934023
Pull-Request: #14240
@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 Sep 11, 2025
RC=0
# Run lintrunner on all files
if ! lintrunner --force-color --all-files --skip MYPY --tee-json=lint.json 2> /dev/null; then
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking what if instead of --all-files can we run this on "changed" files in this PR as a required, not sure if that helps with MYPY performance or not..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the problem isn't MYPY performance, it's the time to build and install executorch. check out some recent lintrunner runs on HUD: https://hud.pytorch.org/hud/pytorch/executorch/main/1?per_page=50&name_filter=lintrunner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

instead of --all-files can we run this on "changed" files in this PR

good idea, PyTorch's lint.yml does something like this, but it's out of scope for this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

on second thought, this is a good idea and I'm open to just increasing scope of this PR so that we can be confident that we actually get a speed improvement.

Copy link
Contributor

@digantdesai digantdesai left a comment

Choose a reason for hiding this comment

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

Stamping to unblock you from landing once ready

@swolchok swolchok added the release notes: none Do not include this in the release notes label Sep 11, 2025
[ghstack-poisoned]
swolchok added a commit that referenced this pull request Sep 12, 2025
lintrunner is required to land, but it takes 10-15 minutes. Can we cut that down if we split out MYPY?

ghstack-source-id: fe28042
ghstack-comment-id: 3282934023
Pull-Request: #14240
swolchok added a commit that referenced this pull request Sep 12, 2025
lintrunner is required to land, but it takes 10-15 minutes. Can we cut that down if we split out MYPY?

ghstack-source-id: 00a3261
ghstack-comment-id: 3282934023
Pull-Request: #14240
@swolchok
Copy link
Contributor Author

ugh, this only knocks 3 minutes off the time for the lintrunner job. I think we're better off just not running lintrunner init, I'll try that. Also note that these jobs are mysteriously doing nothing for 5 minutes -- there's a huge gap in the log timestamps.

swolchok added a commit that referenced this pull request Sep 12, 2025
lintrunner is required to land, but it takes 10-15 minutes. Can we cut that down if we split out MYPY?

ghstack-source-id: 7acad79
ghstack-comment-id: 3282934023
Pull-Request: #14240
[ghstack-poisoned]
swolchok added a commit that referenced this pull request Sep 12, 2025
lintrunner is required to land, but it takes 10-15 minutes. Can we cut that down if we split out MYPY?

ghstack-source-id: 3de552d
ghstack-comment-id: 3282934023
Pull-Request: #14240
@swolchok
Copy link
Contributor Author

@digantdesai can you please rereview? this has had several major changes

@swolchok swolchok changed the title Create lintrunner-mypy so main lintrunner job doesn't have to build Improve lintrunner job runtime Sep 12, 2025
PR_NUMBER="${{ github.event.number }}"
# Use gh CLI to get changed files in the PR with explicit repo
CHANGED_FILES=$(gh api repos/${{ github.repository }}/pulls/$PR_NUMBER/files --paginate --jq '.[] | select(.status != "removed") | .filename' | tr '\n' ' ' | sed 's/ $//')
Copy link
Contributor

Choose a reason for hiding this comment

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

Will —paginate give all the files at once or gives a page and ask you to go to next page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

beats me. this is an exact copy from pytorch/pytorch

@swolchok swolchok merged commit eb1099e into main Sep 12, 2025
116 of 125 checks passed
@swolchok swolchok deleted the gh/swolchok/576/head branch September 12, 2025 20:07
StrycekSimon pushed a commit to nxp-upstream/executorch that referenced this pull request Sep 23, 2025
lintrunner is required to land, but it takes 10-15 minutes. This seems
to improve on that by:
- split out lintrunner-mypy job
- copy pytorch/pytorch's changed files tracking
- don't run `lintrunner init` unnecessarily
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.

4 participants