Skip to content

Enable strict=false in aot_compiler #12872

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
merged 1 commit into from
Jul 29, 2025
Merged

Enable strict=false in aot_compiler #12872

merged 1 commit into from
Jul 29, 2025

Conversation

mcr229
Copy link
Contributor

@mcr229 mcr229 commented Jul 25, 2025

There were some issues with ic3/ci4 when strict=false, turning it on in aot compiler and seeing what throws.

Copy link

pytorch-bot bot commented Jul 25, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 3d19bcc with merge base 2c84f70 (image):

NEW FAILURE - The following job has failed:

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 Jul 25, 2025
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.

@@ -1 +1 @@
ab43fe4bdf5ccd82897f0e982c451a0127bd175e
2dccff7dcf56b0d168ebfd7ca08bdeca37273c56
Copy link
Contributor

@digantdesai digantdesai Jul 28, 2025

Choose a reason for hiding this comment

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

Nit: Split it in a different PT? And all the c10 changes with it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry a lot of the changes that you reviewed here are not related commits, they just somehow got pulled into this PR

@@ -278,7 +278,7 @@ def transform_fn(x):
return x[0]

quantized_model = quantize_model(
cast(torch.fx.GraphModule, aten_dialect.module()),
cast(torch.fx.GraphModule, aten_dialect.module()), # type: ignore[redundant-cast]
Copy link
Contributor

Choose a reason for hiding this comment

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

just drop cast then?

def __init__(self):
self.parent = {}

def find(self, x):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: change the fn name to reflect mutation of the internal state?


# Union overlaps into a single group
if len(partition) > 0:
dsj.find(partition[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit

Suggested change
dsj.find(partition[0])
_ = dsj.find(partition[0])


for external_node in user_nodes:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice. Does this speed things up?

# this likely needs to be combined with the process_remaining_nodes
# TODO: this currently doesn't work with _process_remaining_nodes so
# if a user provides grouped nodes with operatorsupport, then this will
# faile
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# faile
# fail


return matched_nodes
return dsj.gen_groups()
Copy link
Contributor

Choose a reason for hiding this comment

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

How different is it from the base partitioner disjoint set creation? i.e. can we reuse that?
https://github.com/pytorch/pytorch/blob/f3913ea641d871f04fa2b6588a77f63efeeb9f10/torch/fx/passes/infra/partitioner.py#L78

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is lighter weight. I don't have to do the dep checks, I think an underlying assumption i'm making here is that the groups proposed by the configs are valid(do not create cycles). As a result we can reduce the number of checks we have to do.

@mcr229 mcr229 merged commit f7e72ee into pytorch:main Jul 29, 2025
154 of 174 checks passed
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.

4 participants