Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

devsashidhar
Copy link

@devsashidhar devsashidhar commented Mar 5, 2025

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

Copy link

pytorch-bot bot commented Mar 5, 2025

🔗 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 Failures

As of commit 7890c7b with merge base 4b35139 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added module: inductor oncall: distributed Add this issue/PR to distributed oncall triage queue labels Mar 5, 2025
@devsashidhar
Copy link
Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Mar 5, 2025
@bdhirsh bdhirsh requested a review from desertfire March 6, 2025 01:53
@bdhirsh bdhirsh added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Mar 6, 2025
@desertfire desertfire requested a review from EikanWang March 6, 2025 13:54
Copy link
Contributor

@desertfire desertfire left a 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
Copy link
Contributor

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?

Copy link
Contributor

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:
Copy link
Contributor

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?

@mikaylagawarecki mikaylagawarecki removed their request for review May 2, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: inductor oncall: distributed Add this issue/PR to distributed oncall triage queue open source topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants