8000 Add test and fix for GPU memory query by talmo · Pull Request #950 · talmolab/sleap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 7 commits into from
Sep 13, 2022
Merged

Conversation

talmo
Copy link
Collaborator
@talmo talmo commented Sep 13, 2022

Description

It seems that #911 introduces an error on some systems that can't query nvidia-smi.

This PR catches that.

Types of changes

  • Bugfix
  • New feature
  • Refactor / Code style update (no logical changes)
  • Build / CI changes
  • Documentation Update
  • Other (explain)

Does this address any currently open issues?

#949

Outside contributors checklist

  • Review the guidelines for contributing to this repository
  • Read and sign the CLA and add yourself to the authors list
  • Make sure you are making a pull request against the develop branch (not main). Also you should start your branch off develop
  • Add tests that prove your fix is effective or that your feature works
  • Add necessary documentation (if appropriate)

Thank you for contributing to SLEAP!

❤️

@codecov
Copy link
codecov bot commented Sep 13, 2022

Codecov Report

Merging #950 (38db00f) into develop (d432889) will decrease coverage by 0.01%.
The diff coverage is 22.22%.

@@             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     
Impacted Files Coverage Δ
sleap/nn/inference.py 79.05% <0.00%> (-0.31%) ⬇️
sleap/nn/training.py 59.57% <0.00%> (-0.38%) ⬇️
sleap/nn/system.py 48.00% <66.66%> (+4.94%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines +205 to +208
try:
memory_poll = subprocess.run(command, capture_output=True)
except (subprocess.SubprocessError, FileNotFoundError):
return []
Copy link
Collaborator

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.

Comment on lines 1946 to 1951
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)
Copy link
Collaborator

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

@talmo talmo marked this pull request as ready for review September 13, 2022 19:04
@talmo talmo merged commit 7fbba44 into develop Sep 13, 2022
@talmo talmo deleted the talmo/fix-gpu-mem-query branch September 13, 2022 20:33
@talmo talmo mentioned this pull request Sep 13, 2022
talmo added a commit that referenced this pull request Sep 13, 2022
* Fix sleap-export CLI and add docs (#951)
* Add test and fix for GPU memory query (#950)
* Bump to v1.2.8 (#952)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
0