-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[inductor] switch AotCodeCompiler to new cpp_builder. (take 2) #131304
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
[inductor] switch AotCodeCompiler to new cpp_builder. (take 2) #131304
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/131304
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 20035b1 with merge base 1439bd3 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@desertfire has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hi @xuhancn, I will be helping with fixing fbcode tests for this PR. One thing I noticed so far: Should we add That seems to be the logic here https://github.com/pytorch/pytorch/blob/main/torch/_inductor/codecache.py#L1735 |
Hi @henrylhtsang , |
Hi, one problem is that passthough flags is not None when cuda and fbcode is used Are there any problems with adding that |
Hi @henrylhtsang , could you please try #132594? |
@henrylhtsang you can also reference to my design doc: #124245 |
@henrylhtsang Yes, test them together. |
@xuhancn I will circle back in a few hours. I think after this fix it might be good to go. edit: nevermind celebrated too early. it fixes some errors but not all errors |
@xuhancn just to update a bit more:
Let me know if you have more ideas. Otherwise will continue to investigate. |
Looks like Before: After: |
Thanks for the investigation. So, looks like we might want to keep using the absolution path for fbcode, e.g. differentiating fbcode from oss in |
Hi @henrylhtsang could you please try to add some logical to fix the target path here: #131304 (comment) |
#132708 seems to fix the test those errors. Do you know a way to incorporate them? |
@henrylhtsang |
@henrylhtsang |
@xuhancn sorry I am not getting it. Can you elaborate a bit more for both cases? edit: okay maybe I get the output_so part. But not sure about the output_o part (where to add logical?) edit2: okay still confused about both parts |
For For def get_name_and_dir_from_output_file_path(
file_path: str, specified_so_name: str = ""
) -> Tuple[str, str]:
if len(specified_so_name) > 0
file_path = config.aot_inductor.output_path
name_and_ext = os.path.basename(file_path)
name, ext = os.path.splitext(name_and_ext)
dir = os.path.dirname(file_path)
return name, dir |
Additional, for control |
@xuhancn update: it seems like we can always add For example:
As a matter of fact, we do that for consts_o already. Let me know if this works. I am waiting for test signals now and will circle back in a few hours. |
It is also a solution, if we never plan to support AoT for Windows. |
Well I guess we can move it inside the |
Sounds good, it's only impact |
Internal signals LGTM (D60773405) I think it is good to land as long as #132594 and the relative path thing is patched. cc @desertfire @chenyang78 |
@henrylhtsang so, could you please help on merge these PRs? |
Yes. Can you add the commits to this PR? |
Added comments and request review: #132594 @henrylhtsang , @desertfire |
@xuhancn is that a good reason to split it into a few PRs? It will add a few more cycles to merging this PR. |
My suggest is you re-create a new PR and land it. @henrylhtsang |
sure I can do that |
…ch#132766) Summary: Pull Request resolved: pytorch#132766 This is basically pytorch#131304 together with pytorch#132594 and absolute path fix for fbcode. Test Plan: ci Differential Revision: D60773405
Summary: This is basically #131304 together with #132594 and absolute path fix for fbcode. Test Plan: ci Differential Revision: D60773405 Pull Request resolved: #132766 Approved by: https://github.com/xuhancn, https://github.com/chenyang78, https://github.com/desertfire
close by #132766 |
…ilder. (take 3) Summary: Forward fix of a test failure caused by D60773405. The idea of D60773405 is that we need to use absolute path. So we will want to use the older version of path for output_so and output_o. However, when I was copying the older definitions of output_so and output_o, I thought it was okay to simplify it a bit. See #131304 (comment) Turns out I was wrong. Test Plan: ci Differential Revision: D60990594
…ilder. (take 3) (#133042) Summary: Forward fix of a test failure caused by D60773405. The idea of D60773405 is that we need to use absolute path. So we will want to use the older version of path for output_so and output_o. However, when I was copying the older definitions of output_so and output_o, I thought it was okay to simplify it a bit. See #131304 (comment) Turns out I was wrong. Test Plan: ci Differential Revision: D60990594 Pull Request resolved: #133042 Approved by: https://github.com/hl475, https://github.com/desertfire
We have tried to switch
AotCodeCompiler
to new cpp_builder in the PR: #130127But, it has some compatibility issue to
fb_code
, and it was reverted: #130127 (comment)I re-created this PR and add some debug code to help fix compatibility issue: 20035b1
@desertfire could please help me to import this PR to
fb_code
?cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @voznesenskym @penguinwu @EikanWang @Guobing-Chen @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang