8000 Simplify _compute_symbolic_stride() by aorenste · Pull Request #138844 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Simplify _compute_symbolic_stride() #138844

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

Closed
wants to merge 6 commits into from

Conversation

aorenste
Copy link
Contributor
@aorenste aorenste commented Oct 24, 2024

Rewrite _compute_symbolic_stride() to make it simpler and faster.

The existing code involves several inner loops in an attempt to process the common case faster - but in reality this effort is actually slower than the simpler code.

Testing:
The initial version of this PR (which passed all tests) ran both the old algorithm and new algorithm and compared the results to make sure that results were substantially the same (they weren't the same simply because the algorithm allocates new dynamic symbols as part of it).

I also measured the timing of both methods and from the cases I checked the simpler algorithm was generally about 30% faster (which was usually the "fast path" of the old algorithm).

Stack from ghstack (oldest at bottom):

cc @ezyang @SherlockNoMad @EikanWang @jgong5 @wenzhe-nrv

[ghstack-poisoned]
Copy link
pytorch-bot bot commented Oct 24, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 3bee778 with merge base 82ce888 (image):
💚 Looks good so far! There are no failures yet. 💚

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

cc ezyang SherlockNoMad EikanWang jgong5 wenzhe-nrv

[ghstack-poisoned]
aorenste added a commit that referenced this pull request Oct 25, 2024
ghstack-source-id: c27a525
Pull Request resolved: #138844
cc ezyang SherlockNoMad EikanWang jgong5 wenzhe-nrv

[ghstack-poisoned]
cc ezyang SherlockNoMad EikanWang jgong5 wenzhe-nrv

[ghstack-poisoned]
cc ezyang SherlockNoMad EikanWang jgong5 wenzhe-nrv

[ghstack-poisoned]
aorenste added a commit that referenced this pull request Oct 25, 2024
ghstack-source-id: db29a07
Pull Request resolved: #138844
@aorenste aorenste changed the title WIP Simplify _compute_symbolic_stride() Oct 25, 2024
@aorenste aorenste requested review from ezyang and Chillee October 25, 2024 18:53
@aorenste aorenste marked this pull request as ready for review October 25, 2024 18:53
Rewrite _compute_symbolic_stride() to make it simpler and faster.

The existing code involves several inner loops in an attempt to process the common case faster - but in reality this effort is actually slower than the simpler code.

Testing:
The initial version of this PR (which passed all tests) ran both the old algorithm and new algorithm and compared the results to make sure that results were substantially the same (they weren't the same simply because the algorithm allocates new dynamic symbols as part of it).

I also measured the timing of both methods and from the cases I checked the simpler algorithm was generally about 30% faster (which was usually the "fast path" of the old algorithm).





cc ezyang SherlockNoMad EikanWang jgong5 wenzhe-nrv

[ghstack-poisoned]
aorenste added a commit that referenced this pull request Dec 13, 2024
ghstack-source-id: 9a3df31
Pull Request resolved: #138844
@ezyang ezyang requested a review from bobrenjc93 December 13, 2024 14:53
@ezyang
Copy link
Contributor
ezyang commented Dec 13, 2024

I am deferring to Bob as he is also monkeying around with this code recently

@aorenste
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 17, 2024
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

aditew01 pushed a commit to aditew01/pytorch that referenced this pull request Dec 18, 2024
Rewrite _compute_symbolic_stride() to make it simpler and faster.

The existing code involves several inner loops in an attempt to process the common case faster - but in reality this effort is actually slower than the simpler code.

Testing:
The initial version of this PR (which passed all tests) ran both the old algorithm and new algorithm and compared the results to make sure that results were substantially the same (they weren't the same simply because the algorithm allocates new dynamic symbols as part of it).

I also measured the timing of both methods and from the cases I checked the simpler algorithm was generally about 30% faster (which was usually the "fast path" of the old algorithm).

Pull Request resolved: pytorch#138844
Approved by: https://github.com/bobrenjc93
ghstack dependencies: pytorch#138843
@github-actions github-actions bot deleted the gh/aorenste/140/head branch January 18, 2025 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request fx Merged release notes: fx release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0