Skip to content
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

Out of memory in Colab (free) #15

Closed
gnmarten opened this issue Mar 17, 2023 · 5 comments
Closed

Out of memory in Colab (free) #15

gnmarten opened this issue Mar 17, 2023 · 5 comments

Comments

@gnmarten
Copy link

Thanks for the Colab.

I ran into the dreaded out memory while

processing the embedding files saved to nemo_outputs/speaker_outputs/embeddings

Just trying to understand: My audio file is only 1h18 minutes long, but its embeddings amount to: "Dataset loaded with 9209 items, total duration of 2.55 hours." Since segmentations and subsegmentations are done automatically, I wonder what the upper limit filesize for the script to work on Colab would be.

Full error:
RuntimeError: CUDA out of memory. Tried to allocate 7.61 GiB (GPU 0; 14.75 GiB total capacity; 7.81 GiB already allocated; 5.65 GiB free; 7.83 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

@KevinGeLe
Copy link

KevinGeLe commented Mar 17, 2023

Thats weird havent had that problem on long audio files. Try with another smaller whisper model "--whisper-model" Default is "medium.en", so try with "small.en" it will reduce the accuracy but should use 3x less memory.

Edit: adding "torch.cuda.empty_cache()", will free up memory thats not in use.

@MahmoudAshraf97
Copy link
Owner

Hi, this is strange as nemo automatically segments the file to avoid OOM errors, setting the max split size might help because there's plenty of memory available

@rashi-budati
Copy link

Hello, I would like your help to know where to set the max split size. in the create_config function, i could not find any such parameter.

@MahmoudAshraf97
Copy link
Owner

@rashi-budati check max_split_size_mb Here

@kksgandhi
Copy link

If you're having OOM issues and don't mind a performance hit, always remember that you can run this with --device cpu, that way you aren't worrying about your GPU at all.

I'm running whisper-diarization locally though, unsure how this would interact with GColab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants