spleeter icon indicating copy to clipboard operation
spleeter copied to clipboard

[Discussion] How fast should spleeting be using spleeter-gpu?

Open zsaraf opened this issue 4 years ago • 7 comments

Hello all,

I'm running spleeter-gpu (installed via miniconda) on an ec2 GPU instance. I'm still seeing roughly ~25 seconds for it to run 2stem on a 5 minute track, and a bit longer for 5stem. Does this seem about right? Is this as fast at it gets?

Thanks

zsaraf avatar Jun 12 '20 15:06 zsaraf

Hi @zsaraf, no, it is much slower than it should be. For a 5 minutes audio, on a GPU you should be able to perform separation in a few seconds. Does the time you report include model download (model is automatically downloaded at first separation ) ? as model download should be done only once, it should be excluded for measuring speed of separation. Otherwise, are you sure the separation is actually running on GPU ? if the CUDA install is not correct/not compatible with the tf version, the separation may actually be running on CPU. Use the -v option of spleeter separate and check the tensorflow log to make sure the separation is actually performed by the GPU.

romi1502 avatar Jun 12 '20 15:06 romi1502

To bring more precision: actually 25s for a single audio file may be right as there is quite a big overhead for building the model (~20s). Once the model is built, separation should be about 100x real time (i.e. ~3s for a 5min audio file). So if you need to separate a lot of files, you can build the model only once using a single command for batch processing or instantiating a single Separator in the python API and calling several times the separate methods.

romi1502 avatar Jun 19 '20 11:06 romi1502

You probably have tensorflow installed, and not tensorflow-gpu.

I don't know what environment you're using but, either way you'll probably have to run pip install tensorflow-gpu.

aidv avatar Jun 23 '20 18:06 aidv

Thank you for the help, I got the time down a lot! As I'm building for a server that needs to be able to take requests at any time, I will give the single Separator a try. Especially because it seems like the cli can't be used to process 2 files at a time if not instantiated via batch. When I try to do this, I get the following error:

ValueError: Couldn't find trained model at /model/2stems.

Is this a known issue?

zsaraf avatar Jun 25 '20 14:06 zsaraf

It can't find the model. you need to remove the folder "pretrained" models and run the command again so it re-downloads the model.

aidv avatar Jun 26 '20 23:06 aidv

I'm so stress with cuda instalation. Maybe my card so very old (GT 630 asus 2GB) current system: Ubuntu 20.04.1 nvidia driver 390.138 On nvidia page it's install cuda 11.2 but after reboot graphic display "unknow" with very bad resolution. i can see only "450 or 460" nvidia version with these cuda package.... try "sudo apt install nvidia-cuda-toolkit" -> "....packages have unmet dependencies..." so stress......

lacvietanh avatar Dec 22 '20 02:12 lacvietanh

To bring more precision: actually 25s for a single audio file may be right as there is quite a big overhead for building the model (~20s). Once the model is built, separation should be about 100x real time (i.e. ~3s for a 5min audio file). So if you need to separate a lot of files, you can build the model only once using a single command for batch processing or instantiating a single Separator in the python API and calling several times the separate methods.

Is this 3 seconds is the complete time for separation? means time from when I hit the command to when it shows completed and generates the separated files.

Command:- spleeter separate --verbose Wav_45mb.wav recording10.wav -p spleeter:4stems -o output5

Sameerhesta avatar Dec 27 '21 12:12 Sameerhesta