-
Notifications
You must be signed in to change notification settings - Fork 128
fix repeated unnecessary device check #1221
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
Cache results of device/arch detection to avoid repeated and costly runtime queries.
- Add functools.lru_cache to get_arch and get_device
- Import lru_cache and configure cache size to 8
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
LGTM
|
Let me fix the lint and the copilot suggestion, I think it's acc correct |
31a3a27 to
ec0f7d0
Compare
|
@valarLip Thanks for reviewing. I fixed the lint |
|
Hi, it doesn't look like the CI failure is related. |
Motivation
Technical Details
It seems to be spending a non trivial time in CUDA & it generally should be cached. We assume up to 8 devices.
Submission Checklist