Skip to content

Lintrunner: Enable mypy testing on backends/arm #7776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

perheld
Copy link
Collaborator

@perheld perheld commented Jan 20, 2025

Migration from pyre to mypy in the lintrunner by enabling mypy for backends/arm.

But, choosing to ignore the directory backends/arm/test.

Adding ignores all over the place. These needs to be fixed properly in the future, but now we will start to catch new things trying to sneak in.

Change-Id: Ie7f73d5688aaec3b32dca9f0cd042da94c06f487

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

Copy link

pytorch-bot bot commented Jan 20, 2025

🔗 Helpful Links

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

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

✅ No Failures

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

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

@facebook-github-bot facebook-github-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 Jan 20, 2025
@perheld
Copy link
Collaborator Author

perheld commented Jan 20, 2025

@pytorchbot label "topic: not user facing"

@perheld
Copy link
Collaborator Author

perheld commented Jan 20, 2025

@pytorchbot label ciflow/trunk

Copy link

pytorch-bot bot commented Jan 20, 2025

To add these label(s) (ciflow/trunk) to the PR, please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

@oscarandersson8218 oscarandersson8218 added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk labels Jan 20, 2025
Copy link

pytorch-bot bot commented Jan 20, 2025

To add the ciflow label ciflow/trunk please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

@perheld perheld marked this pull request as ready for review January 20, 2025 13:18
Copy link

pytorch-bot bot commented Jan 20, 2025

To add the ciflow label ciflow/trunk please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

@perheld perheld force-pushed the github/ph-MLETORCH-455-mypy-arm-backend branch 2 times, most recently from edfb288 to 59b6ade Compare January 21, 2025 12:52
@perheld
Copy link
Collaborator Author

perheld commented Jan 21, 2025

Rebased and force pushed. Would like some external review of lintrunner.toml since that is the only file touched outside of backends/arm.

@zingo zingo requested a review from mergennachin January 21, 2025 13:01
@zingo
Copy link
Collaborator

zingo commented Jan 21, 2025

@mergennachin here are some mypy include folder changes for you :)

@perheld perheld force-pushed the github/ph-MLETORCH-455-mypy-arm-backend branch 2 times, most recently from f32537c to fd7207e Compare January 21, 2025 20:07
Copy link
Contributor

@mergennachin mergennachin left a comment

Choose a reason for hiding this comment

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

lintrunner.toml file looks good

But in the future, if there are common configs you want to apply across the repo, feel free to modify directly in https://github.com/pytorch/executorch/blob/main/.mypy.ini file

For instance, the tosa serializer could be there.

that way, you don't have to do inline annotations all over

@facebook-github-bot
Copy link
Contributor

@mergennachin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@mergennachin
Copy link
Contributor

Don't merge just yet pls, let me run our internal pyre typechecker first

@perheld
Copy link
Collaborator Author

perheld commented Jan 21, 2025

lintrunner.toml file looks good

But in the future, if there are common configs you want to apply across the repo, feel free to modify directly in https://github.com/pytorch/executorch/blob/main/.mypy.ini file

For instance, the tosa serializer could be there.

that way, you don't have to do inline annotations all over

Cool, thanks for the suggestion.

@facebook-github-bot
Copy link
Contributor

@mergennachin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@perheld
Copy link
Collaborator Author

perheld commented Jan 22, 2025

Don't merge just yet pls, let me run our internal pyre typechecker first

Do I need to do anything else to this PR before it can be merged?

@perheld perheld force-pushed the github/ph-MLETORCH-455-mypy-arm-backend branch from fd7207e to 53f72fd Compare January 23, 2025 16:07
@perheld
Copy link
Collaborator Author

perheld commented Jan 23, 2025

Did a rebase and fixed merge conflicts. Just small ones. And a new file got added that needed some ignores.

@facebook-github-bot
Copy link
Contributor

@mergennachin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@mergennachin
Copy link
Contributor

Do I need to do anything else to this PR before it can be merged?

Still trying to check something internally first. Our infra setup was broken yesterday, trying again today.

@mergennachin
Copy link
Contributor

@perheld - can you rebase this commit on top of the latest commit in main

i still can't import this internally yet

@perheld perheld force-pushed the github/ph-MLETORCH-455-mypy-arm-backend branch from 53f72fd to 3374ce1 Compare January 23, 2025 17:13
@perheld
Copy link
Collaborator Author

perheld commented Jan 23, 2025

Rebased. It's a race now with others doing patches in backends/arm that causes conflicts or adds warnings. 😅

@perheld perheld force-pushed the github/ph-MLETORCH-455-mypy-arm-backend branch from 3374ce1 to 3970efa Compare January 23, 2025 17:31
@facebook-github-bot
Copy link
Contributor

@mergennachin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@mergennachin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@mergennachin
Copy link
Contributor

mergennachin commented Jan 27, 2025

Finally was able to import internally. Confirmed internal typechecker is fine.

Please rebase again (and do necessary updates) and merge to main

@perheld perheld force-pushed the github/ph-MLETORCH-455-mypy-arm-backend branch from 3970efa to d201afe Compare January 28, 2025 07:31
@zingo
Copy link
Collaborator

zingo commented Jan 28, 2025

Fail CI jobbs seem very unrelated

@zingo
Copy link
Collaborator

zingo commented Jan 28, 2025

@mergennachin We get problem with "Meta Internal-Only Changes Check" and it seems we can merge it from Gitbub :(
https://github.com/pytorch/executorch/pull/7776/checks?check_run_id=36271892928

Is this a downside when you test patches internally that they get some "interesting" link between the worlds.

@facebook-github-bot
Copy link
Contributor

@mergennachin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Migration from pyre to mypy in the lintrunner by enabling mypy for
backends/arm.

But, choosing to ignore the directory backends/arm/test.

Adding ignores all over the place. These needs to be fixed properly in
the future, but now we will start to catch new things trying to sneak
in.

Change-Id: Ie7f73d5688aaec3b32dca9f0cd042da94c06f487
@mergennachin mergennachin force-pushed the github/ph-MLETORCH-455-mypy-arm-backend branch from d201afe to aef367d Compare January 28, 2025 16:33
@mergennachin mergennachin merged commit f4786ac into pytorch:main Jan 28, 2025
108 checks passed
@zingo
Copy link
Collaborator

zingo commented Jan 28, 2025

@mergennachin thanks a lot for the help.

YIWENX14 pushed a commit that referenced this pull request Jan 28, 2025
Migration from pyre to mypy in the lintrunner by enabling mypy for
backends/arm.

But, choosing to ignore the directory backends/arm/test.

Adding ignores all over the place. These needs to be fixed properly in
the future, but now we will start to catch new things trying to sneak
in.

Change-Id: Ie7f73d5688aaec3b32dca9f0cd042da94c06f487
@perheld perheld deleted the github/ph-MLETORCH-455-mypy-arm-backend branch January 29, 2025 11:34
zonglinpeng pushed a commit to zonglinpeng/executorch that referenced this pull request Jan 30, 2025
Migration from pyre to mypy in the lintrunner by enabling mypy for
backends/arm.

But, choosing to ignore the directory backends/arm/test.

Adding ignores all over the place. These needs to be fixed properly in
the future, but now we will start to catch new things trying to sneak
in.

Change-Id: Ie7f73d5688aaec3b32dca9f0cd042da94c06f487
digantdesai added a commit that referenced this pull request Feb 25, 2025
Disabling Pyre. Relying on OSS mypy enabled in #7776.

Differential Revision: [D70146769](https://our.internmc.facebook.com/intern/diff/D70146769/)

[ghstack-poisoned]
digantdesai added a commit that referenced this pull request Feb 25, 2025
Disabling Pyre. Relying on OSS mypy enabled in #7776.

Differential Revision: [D70146769](https://our.internmc.facebook.com/intern/diff/D70146769/)

ghstack-source-id: 268178737
Pull Request resolved: #8664
kirklandsign pushed a commit that referenced this pull request Feb 27, 2025
Disabling Pyre. Relying on OSS mypy enabled in #7776.

Differential Revision: [D70146769](https://our.internmc.facebook.com/intern/diff/D70146769/)

ghstack-source-id: 268178737
Pull Request resolved: #8664

---------

Co-authored-by: Digant Desai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants