-
Notifications
You must be signed in to change notification settings - Fork 114
Add test and fix for GPU memory query #950
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
Codecov Report
@@ Coverage Diff @@
## develop #950 +/- ##
===========================================
- Coverage 67.58% 67.57% -0.02%
===========================================
Files 130 130
Lines 22227 22240 +13
===========================================
+ Hits 15023 15028 +5
- Misses 7204 7212 +8
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
try: | ||
memory_poll = subprocess.run(command, capture_output=True) | ||
except (subprocess.SubprocessError, FileNotFoundError): | ||
return [] |
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.
It would be nice to have a logger print something here for when we actually find a good GPU to use or just default to 0.
sleap/nn/training.py
Outdated
if args.gpu == "auto": | ||
gpu_ind = np.argmax(sleap.nn.system.get_gpu_memory()) | ||
gpu_memory = sleap.nn.system.get_gpu_memory() | ||
gpu_ind = np.argmax(gpu_memory) if len(gpu_memory) > 0 else 0 | ||
else: | ||
gpu_ind = int(args.gpu) | ||
sleap.nn.system.use_gpu(gpu_ind) |
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.
We can also add a logging statement here
Description
It seems that #911 introduces an error on some systems that can't query
nvidia-smi
.This PR catches that.
Types of changes
Does this address any currently open issues?
#949
Outside contributors checklist
Thank you for contributing to SLEAP!
❤️