-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[AOTAutograd] Micro-optimize runtime_wrapper #128188
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/128188
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit d774dbd with merge base a21d436 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
1. `config.__getattr__` takes ~.5us so move outside of the wrapper 2. use builtins.zip instead of `strict_zip` since we assert the lengths anyway 3. also in `strict_zip` we don't need to find the min length [ghstack-poisoned]
1. `config.__getattr__` takes ~.5us so move outside of the wrapper 2. use builtins.zip instead of `strict_zip` since we assert the lengths anyway 3. also in `strict_zip` we don't need to find the min length [ghstack-poisoned]
1. `config.__getattr__` takes ~.5us so move outside of the wrapper 2. use builtins.zip instead of `strict_zip` since we assert the lengths anyway 3. also in `strict_zip` we don't need to find the min length ghstack-source-id: 59b865c Pull Request resolved: pytorch#128188
1. `config.__getattr__` takes ~.5us so move outside of the wrapper 2. use builtins.zip instead of `strict_zip` since we assert the lengths anyway 3. also in `strict_zip` we don't need to find the min length ghstack-source-id: b5b6f51 Pull Request resolved: pytorch#128188
This moves a bunch of runtime inspection of the `output_info` for alias handling into the construction of fixed output handlers that are called at runtime. [ghstack-poisoned]
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'll let Brian look into these.
Could you also add a benchmark at ./benchmarks/dynamo/microbenchmarks/microbench.py
and do a before / after with how much speed-up this PR is expected to bring?
I'm seeing a 20% speedup in |
I've run some benchmarks and the cold start times are the same to within .1% in a variety of torchbench models, so I don't think there is any issue here. |
@pytorchbot merge -r |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
@pytorchbot 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 |
Stack from ghstack (oldest at bottom):
This moves a bunch of runtime inspection of the
output_info
for alias handling into the construction of fixed output handlers that are created during compilation and captured by the runtime wrapper.cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang