[aot] add format_consts_to_cpp function for further development.#157608
[aot] add format_consts_to_cpp function for further development.#157608xuhancn wants to merge 12 commits intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/157608
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 c85dd9a with merge base 64f2ec7 ( 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. |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
33d0a18 to
eb40b92
Compare
jansel
left a comment
There was a problem hiding this comment.
@desertfire should review this one, but do we need to add a test for this? Or is there an existing test that covers this?
|
Thanks for @jansel ‘s comments. |
desertfire
left a comment
There was a problem hiding this comment.
Similar to @jansel 's comment, let's add an aoti_inductor config for this and make sure the new opt-in path is also tested.
|
Hi @jansel and @desertfire I have added aot_config to control asm and cpp build, besides that, I added UT also: 57b6378 |
desertfire
left a comment
There was a problem hiding this comment.
Please also add a test to test_aot_inductor.py.
|
@pytorchmergebot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
From the perivous PR: #157608 , I added `format_consts_to_cpp` to build consts bytes. But it still raise clang ASAN `stack alloction`, when build large size consts. This PR: 1. add `test_aot_inductor_consts_cpp_build` to stack allocation skip list. 2. add ATTRIBUTE_NO_SANITIZE_ADDRESS to skip ASAN check, because consts array is locate in global area. Pull Request resolved: #158175 Approved by: https://github.com/jansel
Changes:
format_consts_to_asmfunction, which is current way to convert consts to object.format_consts_to_cppfunction, which would support for more compiler support, such asmsvcandicx.config.aot_inductor.use_consts_asm_buildforformat_consts_to_asmandformat_consts_to_cppcontrol.format_consts_to_cpp.For

format_consts_to_cpp, I have local tested it:Case: https://docs.pytorch.org/docs/main/torch.compiler_aot_inductor.html
Run it and
catcpp code:cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @voznesenskym @penguinwu @EikanWang @Guobing-Chen @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov