Skip to content

Conversation

@perheld
Copy link
Collaborator

@perheld perheld commented Nov 7, 2025

Add test directory in arm backend to lintrunner. Except the ops directory which has to be fixed later.

About "disallow_untyped_decorators = False":
The only way to make mypy happy seems to be a wrapper around the decorator for each file it is used. I have read numerous of threads about it and there seems to be no good solution. Hence the added ignore for backends/arm.

Signed-off-by: per.held@arm.com
Change-Id: I0430041cb3308b51798d74da61cc4d310966772a

cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai

@perheld perheld added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk release notes: none Do not include this in the release notes labels Nov 7, 2025
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 7, 2025

🔗 Helpful Links

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

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

⏳ 1 Pending, 6 Unrelated Failures

As of commit c501ea7 with merge base 747fc6f (image):

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.

@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 Nov 7, 2025
@perheld perheld requested a review from digantdesai as a code owner November 7, 2025 12:17
@perheld perheld force-pushed the ph-mypy-ops-enable-mypy-tests branch from 0a4b843 to ec1f6a5 Compare November 7, 2025 12:24
@perheld
Copy link
Collaborator Author

perheld commented Nov 7, 2025

I added all needes commits to this PR to make life easier.

@zingo
Copy link
Collaborator

zingo commented Nov 7, 2025

@mergennachin and/or @SS-JIA there is one line in this PR that is not 100% Arm specific, it adds the "new" src folder to .mypy.ini this clean up some lintrunner problem as project starting to use it also.

e.g.
mypy_path = executorch,src

I'm not sure if this is something you would like to test internally or not, we let this PR be up for some days so you get a chance to weight in. As there is a inflow of PR that might breaks this as it not enabled until this lands, we will need to rebase and maybe add more lintrunner fixes in this PR before merging and we hope/plan to do this "Europe" time so can test it and retrigger some random PR to make sure there is no problem and do a fast fix or revert while less people is active in the project.

@perheld
Copy link
Collaborator Author

perheld commented Nov 7, 2025

Fix incoming for the actual lint error. :)

@perheld
Copy link
Collaborator Author

perheld commented Nov 7, 2025

Fix incoming for the actual lint error. :)

And the lintrunner-mypy got green with that commit. So Im confident it is running the right thing.

Copy link
Contributor

@SS-JIA SS-JIA left a comment

Choose a reason for hiding this comment

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

Should be ok, MYPY/lintrunner is not run internally

@zingo
Copy link
Collaborator

zingo commented Nov 7, 2025

Thanks

@zingo
Copy link
Collaborator

zingo commented Nov 7, 2025

Ill rebase and check that lintrunner is still happy :)
... I manage to merge a conflict just before :) Well we check it next week and fix it more calmly.

Fix mypy warning about type.

Signed-off-by: per.held@arm.com
Change-Id: I09a5f75943c12b304a2e4d4ff6af8739021aeb44
Some missing imports for third-party libraries used in
stable_diffusion had ignores added to them.

Signed-off-by: per.held@arm.com
Change-Id: Icd86edd39ae4541813bc84c07fdab90571da98c2
Add src to mypy_path to get rid of lots of missing import warnings.

Signed-off-by: per.held@arm.com
Change-Id: I4ed1a08cfe185aa956c6408fefa5aadeb567d4c1
Add test directory in arm backend to lintrunner. Except the ops
directory which has to be fixed later.

About "disallow_untyped_decorators = False":
The only way to make mypy happy seems to be a wrapper around the
decorator for each file it is used. I have read numerous of threads
about it and there seems to be no good solution. Hence the added
ignore for backends/arm.

Signed-off-by: per.held@arm.com
Change-Id: I0430041cb3308b51798d74da61cc4d310966772a
Add ignore for import as well, since on github these packages are not
installed and thus its a import-not-found error and not untyped as it
becomes locally if you have the packages installed.

Signed-off-by: per.held@arm.com
Change-Id: Iba7b579f8f95991aca26054698e1d357dc14a853
Signed-off-by: per.held@arm.com
Change-Id: I351b955621c8f5b807e4ead2722d3b7f0d98df51
@perheld perheld force-pushed the ph-mypy-ops-enable-mypy-tests branch from b1bdf8e to c501ea7 Compare November 10, 2025 09:09
@perheld
Copy link
Collaborator Author

perheld commented Nov 10, 2025

Failed are unrelated. Ive rebased locally and it still passes lintrunner.

@perheld perheld merged commit c8e9684 into pytorch:main Nov 10, 2025
373 of 384 checks passed
@perheld perheld deleted the ph-mypy-ops-enable-mypy-tests branch November 10, 2025 12:59
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 release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants