talmolab / sleap

A deep learning framework for multi-animal pose tracking.
https://sleap.ai
Other
435 stars 97 forks source link

Fix Auto-select GPU #1474

Closed gitttt-1234 closed 1 year ago

gitttt-1234 commented 1 year ago

Description

Fix auto-selecting GPU. Issue: #1318

Types of changes

Does this address any currently open issues?

[list open issues here]

Outside contributors checklist

Thank you for contributing to SLEAP!

:heart:

Summary by CodeRabbit

codecov[bot] commented 1 year ago

Codecov Report

Merging #1474 (11d1cc5) into develop (0ef52cd) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #1474   +/-   ##
========================================
  Coverage    73.04%   73.05%           
========================================
  Files          134      134           
  Lines        23849    23851    +2     
========================================
+ Hits         17421    17424    +3     
+ Misses        6428     6427    -1     
Files Changed Coverage Δ
sleap/nn/system.py 42.85% <ø> (ø)
sleap/nn/__init__.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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

coderabbitai[bot] commented 1 year ago

Walkthrough

This pull request primarily focuses on setting and testing the GPU device order. It introduces an environment variable for CUDA device order and includes a test to ensure it's correctly set. The changes are minor but crucial for ensuring the correct operation of GPU-based computations.

Changes

File Summary
sleap/nn/__init__.py Added import for os module and set CUDA_DEVICE_ORDER environment variable.
sleap/nn/system.py Introduced a minor formatting change in the get_gpu_memory() function.
tests/nn/test_system.py Added a new test function test_gpu_device_order() to verify the GPU device order.

🐇💻

In the land of code, where the GPUs play, A rabbit hopped in, with changes today. With a tweak and a test, he set the stage, For the GPU order, he did engage. Now the devices, in their proper array, Will compute and perform, in the right way! 🎉

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. The bot stays silent unless called upon. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume.