-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
How to increase speed? #32
Comments
What have you tried so far? Could you show me your logs from |
2024-01-12 17:29:06.296 - INFO - cli - Separator version 0.13.0 beginning with input file: audio.wav |
Also when increasing segment_size WARNING - separator - Model converted from onnx to pytorch due to segment size not matching dim_t, processing may be slower. |
Gotcha; that all looks right to me - you're using ONNX Runtime How long is it actually taking? In my experience, on a machine with CUDA GPU, a 4 minute track takes about 20-30 seconds to process. If you check the full logs without debug loglevel there should be a couple of messages e.g. |
It takes duration: 60.22055721282959s for 8 mins track . I have a quite large gpu the model is only using 3 - 4gb of my gpu I want to increase speed I have no issues with high gpu ussage |
Yeah that's expected if you change segment size, you can see where that comes from here: Why are you changing the segment size? That will certainly make things slower in my experience. Out of curiosity, have you benchmarked / compared against running the same separation using UVR GUI? |
Gotcha, that time is pretty normal. If you want to make it faster, you'll need to dig into the code and work out some way to optimize it! The work which @nnyj did in this fork may help! https://github.com/nnyj/python-audio-separator-live#benchmark-results See #3 PRs very welcome if you're able to improve performance :) |
I was thinking about using ffmpeg to segment the file 1mins segment each (variable) then process and combine final stage ? What do you think of this approach ? |
It's certainly worth trying! The codebase already has PyDub as a dependency: Which is a wrapper around So you've got a bit of a headstart; though I'm not sure off the top of my head what the right approach to parallelizing would be. Good luck, and feel free to email me if you want to schedule a pair programming call or any other knowledge transfer :) |
Hi Bveradb, Tried to do parallel ! Segmented the file to 5 sections but your app dooesnt seem to handle multi processing especially with one loaaded model ! It works with batching but not parallel. |
You'd need to modify the code... that's why this is open source, you can just fork it and work on it |
To be honnest am a newbie if you would just let me know which file to dig in to fix this and i'll try to ! |
All of the separation logic is in the main Separator class: Good luck! If you haven't written much Python code before you'll probably need to do quite a bit of learning in order to get to the point where you can contribute, but there's a lot of tutorials online :) If you want to organize a pair programming call at some point, feel free to email me with a suitable date/time and I'm happy to try and help! |
I was able to get it to work ! Using threading local ! Updating def separate(self, audio_file_path) ! This way variable are stored locally for each thread to avoid racing issue while running in parallel ! |
This cut processing time / 3 for now I'll try to optimize and make it faster ! Btw for denoising either using true or false can't seem to have any impact is that only for me or for everyone ? Or I missed out something in call here is my code separator = Separator( |
Nice work! Good to know it works as a proof of concept! If you could add the actual segmenting / thread management functionality to audio-separator and allow users to enable that via an initialization parameter using the class or CLI (e.g. |
Once everything optimized I'll ping you for an update ! Just wanted to thank you for quick response and help :) Good work |
FYI @yassinebelatar you may want to check out the latest version of There's now support for newer models and VR arch models, some of which are much faster on my machine (e.g.
|
FYI @yassinebelatar there's some sample code for splitting input audio into shorter segments, separating each, and then rejoining the separated parts afterwards in this comment: You could potentially adapt something like that to launch multiple Also, I'd encourage you to try some of the VR arch ( I'm going to close this issue now as I think there are several options you can explore to make more efficient use of your resources, but feel free to reply in here if you want to share your progress or get any more support with this! |
I have a very large gpu 80GB i want to increase speed increasing batch doesn't help at all . Thanks
The text was updated successfully, but these errors were encountered: