Skip to content

Commit 0b15d48

Browse files
GratefulTonyfumiamaNatoBoram
authored
feat: unblock cpu training (#889)
* Update train_nsf_sim_cache_sid_load_pretrain.py patch to unblock cpu training. CPU training took ~12 hours for me. * Update train_nsf_sim_cache_sid_load_pretrain.py Co-authored-by: Nato Boram <[email protected]> --------- Co-authored-by: 源文雨 <[email protected]> Co-authored-by: Nato Boram <[email protected]>
1 parent 8d8eb8e commit 0b15d48

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

train_nsf_sim_cache_sid_load_pretrain.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,13 @@ def record(self):
6767

6868
def main():
6969
n_gpus = torch.cuda.device_count()
70+
7071
if torch.cuda.is_available() == False and torch.backends.mps.is_available() == True:
7172
n_gpus = 1
73+
if n_gpus < 1:
74+
# patch to unblock people without gpus. there is probably a better way.
75+
print("NO GPU DETECTED: falling back to CPU - this may take a while")
76+
n_gpus = 1
7277
os.environ["MASTER_ADDR"] = "localhost"
7378
os.environ["MASTER_PORT"] = str(randint(20000, 55555))
7479
children = []

0 commit comments

Comments
 (0)