-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[inductor][cpp][gemm] cache blocking config for dynamic shapes #133538
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/133538
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 6d10526 with merge base 32f3af7 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| } | ||
|
|
||
| std::tuple<std::shared_ptr<int64_t[]>, int> get_factors(int64_t number) { | ||
| thread_local std::map<int64_t, std::tuple<std::shared_ptr<int64_t[]>, int>> cache; |
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.
nit: why do we need to set this cache as thread_local? If multiple threads are running workloads, I think these threads can share these factors since it only relates to the number of threads for division. Is it due to the concern about initializing this cache with multi threads?
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.
nit: why do we need to set this cache as
thread_local? If multiple threads are running workloads, I think these threads can share these factors since it only relates to the number of threads for division. Is it due to the concern about initializing this cache with multi threads?
Yes, thread_local avoids the lock contention when multiple threads need to access and modify the cache.
|
@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 |
…ch#133538) Pull Request resolved: pytorch#133538 Approved by: https://github.com/leslie-fang-intel ghstack dependencies: pytorch#135277, pytorch#133447 Co-authored-by: Wu, Chunyuan <[email protected]>
ghstack-source-id: 1f927ba Pull Request resolved: pytorch/pytorch#133538
Stack from ghstack (oldest at bottom):
cc @voznesenskym @penguinwu @EikanWang @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang