-
-
Notifications
You must be signed in to change notification settings - Fork 783
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
Why is pyannote not using my GPU ro CPU? So slow too. #1702
Comments
Hi, I am facing the same issue. Did you solve the problem? |
No I didn't. I just ended up letting it take forever. It eventually does its job without fully utilizing my GPU(s). |
Just wanted to chime in and say that I'm seeing similar-ish issues. I do see utilization on my GPU, so might not be the same thing, but general performance issues. I may have localized the issue to passing an audio file path to the pipeline directly. TL;DR -- try preprocessing your audio into a waveform and running it that way. I dropped my processing from 50 seconds down to 12 seconds by doing so. I had a 3 minute clip I used as a test here. Passing it into the pipeline as a path, e.g. pipline = Pipeline.from_pretrained(...)
pipline('audio.mp3') took about 50 seconds overall. Doing some profiling, I found that the code was spending a ton of time in the function Specifically this snippet here: pyannote-audio/pyannote/audio/core/io.py Lines 341 to 354 in 6a972c0
where passing an audio file directly follows the Insteading of running it completely to ground since it seemed to mostly be a problem with audio file processing, I tried preprocessing via a torchaudio load as recommended on the HF page: waveform, sample_rate = torchaudio.load("audio.wav")
diarization = pipeline({"waveform": waveform, "sample_rate": sample_rate}) This resulted in my 6 min clip being diarized in 12 seconds and I seed solid GPU utilization along the way. |
Probably not directly related but the way pyannote is currently packaged overwrites your environment torch and installs the CPU version instead... I spent way too long tracking it down to this project so that might be it... You can quickly check with: |
you need to install the cuda libraries and reinstall pyannote. There are 2 seperate cuda related nvidia libraries that need to be installed before it properly detects cuda and uses gpu. |
Tested versions
latest version 3.1
System information
windows 11, amd 5950x cpu, ubuntu 20.04 python 3.9 latest pyannote 3.1
Issue description
CPU at 10%, both Nvidia rtx3080s at 0%, I only see the model taking up GPU memory and it is very small. Using the sample code provided in the README
Minimal reproduction example (MRE)
Use the sample speaker diarization README code
The text was updated successfully, but these errors were encountered: