-
Notifications
You must be signed in to change notification settings - Fork 24.1k
Optimize AOTInductor: Caching, Reduced Decompositions, and Improved JSON Handling #148616
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
base: main
Are you sure you want to change the base?
Optimize AOTInductor: Caching, Reduced Decompositions, and Improved JSON Handling #148616
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/148616
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 7890c7b with merge base 4b35139 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "topic: not user facing" |
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.
I will let @EikanWang to comment the aoti_eager part.
@@ -0,0 +1,259 @@ | |||
torch/_higher_order_ops/utils.py: operator: OperatorBase, delayed_error: bool, *args: Any, **kwargs: Any |
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.
What is this file for?
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.
Please revert this third-party change.
@@ -168,7 +173,7 @@ def __init__( | |||
if len(self.device_ids) == 1: | |||
self.module.to(self.src_device_obj) | |||
|
|||
def forward(self, *inputs: Any, **kwargs: Any) -> Any: | |||
def forward(self, *inputs: P.args, **kwargs: P.kwargs) -> R: |
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.
Is this relevant to this PR?
PR Description:
This PR improves AOTInductor's compilation performance by introducing caching, limiting unnecessary decompositions, and optimizing JSON handling.
Changes:
Added persistent caching to avoid redundant recompilation.
Restricted decompositions to only necessary operators (aten::add, aten::mul).
Optimized JSON metadata updates to prevent unnecessary file writes.
Impact:
Reduces compilation time for repeated runs.
Improves efficiency by only updating metadata when needed.
Helps prevent excessive decompositions, leading to better overall performance.
Testing:
Ran pytest test/inductor to check for regressions.
Verified that AOT compilation is significantly faster on repeated runs.
cc @H-Huang @awgu @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov