-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[AOTI Minifier] Exclude illegal graphs from minifier search #140999
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/140999
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New FailureAs of commit 1c425dd with merge base 0443398 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D66143487 |
| def export_for_aoti_minifier(gm, tuple_inputs) -> Optional[torch.nn.Module]: | ||
| # Some graphs cannot be used for AOTI/export (illegal graphs), these should be | ||
| # considered as graphs that don't fail in the minifier, so the minifier keeps searching. | ||
| # In these case, we return None. Otherwise, we return the exported graph module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably mention that this won't affect the minifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added now
beb6e5f to
714f493
Compare
|
This pull request was exported from Phabricator. Differential Revision: D66143487 |
714f493 to
2b2c361
Compare
…140999) Summary: Some graphs cannot be used for AOTI/export (illegal graphs), these should be considered as graphs that don't fail in the minifier, so the minifier keeps searching. One example is the following graph, where `true_graph_0` is an fx.GraphModule. ``` # graph(): # %true_graph_0 : [num_users=1] = get_attr[target=true_graph_0] # return (true_graph_0,) ``` Here, export.export() would give a `UserError` with `ErrorType = UserErrorType.INVALID_OUTPUT`. So we detect such errors, and exclude them from minifier's search (consider these graphs as didn't fail). Test Plan: ``` buck2 run fbcode//caffe2/test/inductor:minifier_utils_cpu -- -r invalid_output ``` Reviewed By: henrylhtsang Differential Revision: D66143487
2b2c361 to
b5005e7
Compare
|
This pull request was exported from Phabricator. Differential Revision: D66143487 |
1 similar comment
|
This pull request was exported from Phabricator. Differential Revision: D66143487 |
…140999) Summary: Some graphs cannot be used for AOTI/export (illegal graphs), these should be considered as graphs that don't fail in the minifier, so the minifier keeps searching. One example is the following graph, where `true_graph_0` is an fx.GraphModule. ``` # graph(): # %true_graph_0 : [num_users=1] = get_attr[target=true_graph_0] # return (true_graph_0,) ``` Here, export.export() would give a `UserError` with `ErrorType = UserErrorType.INVALID_OUTPUT`. So we detect such errors, and exclude them from minifier's search (consider these graphs as didn't fail). Test Plan: ``` buck2 run fbcode//caffe2/test/inductor:minifier_utils_cpu -- -r invalid_output ``` Reviewed By: henrylhtsang Differential Revision: D66143487
b5005e7 to
1c425dd
Compare
|
This pull request was exported from Phabricator. Differential Revision: D66143487 |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
6 similar comments
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
Merge startedYour change will be merged while ignoring the following 1 checks: Lint / lintrunner-noclang / linux-job Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
15 similar comments
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -f "landed internally" |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
2 similar comments
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
Merge startedYour change will be merged while ignoring the following 1 checks: Lint / lintrunner-noclang / linux-job Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…140999) Summary: Some graphs produced by the minifier graph cutter cannot be used for AOTI/export (illegal graphs), these should be considered as graphs that don't fail in the minifier, so the minifier keeps searching. One example is the following graph, where `true_graph_0` is an fx.GraphModule. Here, export.export() would give a `UserError` with `ErrorType = UserErrorType.INVALID_OUTPUT`. ``` # graph(): # %true_graph_0 : [num_users=1] = get_attr[target=true_graph_0] # return (true_graph_0,) ``` This graph could be obtained from the module below: ```python class M(torch.nn.Module): def forward(self, x, flag): flag = flag.item() def true_fn(x): return x.clone() return torch.cond(flag > 0, true_fn, true_fn, [x]) ``` So we detect such errors, and exclude them from minifier's search (consider these graphs as didn't fail). This is ok and won't miss any actual errors, since the AOTI minifier is only designed to catch errors in the AOTI phase anyway, it is not responsible to catching export bugs. Test Plan: ``` buck2 run fbcode//caffe2/test/inductor:test_minifier_utils -- -r invalid_output ``` Differential Revision: D66143487 Pull Request resolved: pytorch#140999 Approved by: https://github.com/henrylhtsang
Summary:
Some graphs produced by the minifier graph cutter cannot be used for AOTI/export (illegal graphs), these should be considered as graphs that don't fail in the minifier, so the minifier keeps searching.
One example is the following graph, where
true_graph_0is an fx.GraphModule. Here, export.export() would give aUserErrorwithErrorType = UserErrorType.INVALID_OUTPUT.This graph could be obtained from the module below:
So we detect such errors, and exclude them from minifier's search (consider these graphs as didn't fail).
This is ok and won't miss any actual errors, since the AOTI minifier is only designed to catch errors in the AOTI phase anyway, it is not responsible to catching export bugs.
Test Plan:
Differential Revision: D66143487
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov