Skip to content

Commit

Permalink
Merge pull request #75 from AllenCell/bugfix-mig-devices
Browse files Browse the repository at this point in the history
MID ID selection
  • Loading branch information
fatwir authored Dec 9, 2024
2 parents df6a3e1 + a91f5aa commit b38b1f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/br/analysis/analysis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from aicsimageio import AICSImage
from sklearn.decomposition import PCA
from tqdm import tqdm
import random

from br.data.utils import get_iae_reconstruction_3d_grid
from br.features.plot import plot_pc_saved, plot_stratified_pc
Expand Down Expand Up @@ -127,8 +128,9 @@ def config_gpu():
mig_ids = get_mig_ids(uuid)

if mig_ids:
selected_gpu_id_or_uuid = mig_ids[0] # Select the first MIG ID
break # Exit the loop after finding the first MIG ID
mid_id_rand = random.randint(0, len(mig_ids) - 1)
selected_gpu_id_or_uuid = mig_ids[mid_id_rand] # Select the MIG ID
break # Exit the loop after finding the MIG ID
else:
selected_gpu_id_or_uuid = uuid
print(f"Selected UUID is {selected_gpu_id_or_uuid}")
Expand Down

0 comments on commit b38b1f2

Please sign in to comment.