Skip to content
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

[dynamo][compile-time] Manually implement nn.Module.__getattr__ to reduce compile time #129315

Closed
wants to merge 4 commits into from

Conversation

anijain2305
Copy link
Contributor

@anijain2305 anijain2305 commented Jun 22, 2024

Stack from ghstack (oldest at bottom):

Compile time for eager backend

AlbertForMaskedLM

No inlining - 3.65 seconds
Inlining on main - 7.48 seconds
Inlining + this PR - 6.70 seconds

MobileBertForMaskedLM

No inlining - 26.90 seconds
Inlining on main - 48.21 seconds
Inlining + this PR - 43.85 seconds

Next PR in the stack makes the total compile time better/comparable to no inlining

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang

Copy link

pytorch-bot bot commented Jun 22, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/129315

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (2 Unrelated Failures)

As of commit 760e970 with merge base 94dc325 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:

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

…ttr__ to reduce compile time"

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang

[ghstack-poisoned]
…ttr__ to reduce compile time"

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang

[ghstack-poisoned]
…ttr__ to reduce compile time"

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang

[ghstack-poisoned]
OnlyFor pushed a commit to OnlyFor/pytorch that referenced this pull request Jun 23, 2024
…duce compile time

ghstack-source-id: f17873d97148db071dcf9cf76c3bc15ed24bb8d9
Pull Request resolved: pytorch#129315
pytorchmergebot pushed a commit that referenced this pull request Jun 25, 2024
…t nn.Module._call_impl (#129285)

# Compile time for eager backend
## AlbertForMaskedLM
No inlining - 3.65 seconds
Inlining on main - 7.48 seconds
Inlining + this PR - 2.86 seconds

## MobileBertForMaskedLM
No inlining - 26.90 seconds
Inlining on main - 48.21 seconds
Inlining + this PR - 24.25 seconds

Pull Request resolved: #129285
Approved by: https://github.com/jansel
ghstack dependencies: #129316, #129315
facebook-github-bot pushed a commit to pytorch/benchmark that referenced this pull request Jun 26, 2024
…315)

Summary:
# Compile time for eager backend
## AlbertForMaskedLM
No inlining - 3.65 seconds
Inlining on main - 7.48 seconds
Inlining + this PR - 6.70 seconds

## MobileBertForMaskedLM
No inlining - 26.90 seconds
Inlining on main - 48.21 seconds
Inlining + this PR - 43.85 seconds

*Next PR in the stack makes the total compile time better/comparable to no inlining*

X-link: pytorch/pytorch#129315
Approved by: https://github.com/jansel
ghstack dependencies: #129316

Reviewed By: huydhn

Differential Revision: D59036217

Pulled By: anijain2305

fbshipit-source-id: bb6a67f69faffc1a0809896ae6d44dc2ef2c8a4a
@github-actions github-actions bot deleted the gh/anijain2305/394/head branch July 25, 2024 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants