Slowdown Process when Concurrent Process #163
Replies: 5 comments
-
Hi @zanjabil2502, could you provide more information about your setup? |
Beta Was this translation helpful? Give feedback.
-
I found the solution, before i using OnlineSpeakerDiarization as model_pipeline for two process or more process. |
Beta Was this translation helpful? Give feedback.
-
def diarization(self,pathaudio):
model_pipeline = OnlineSpeakerDiarization()
audio = FileAudioSource(pathaudio,model_pipeline.config.sample_rate)
inference = RealTimeInference(model_pipeline, audio, show_progress=False, do_plot=False)
prediction = inference()
for c in client:
process = Tread(target=diarization,args=(pathaudio,)) This is new schema from me |
Beta Was this translation helpful? Give feedback.
-
Sorry, i have problem again, when i use the new schema like above, in 5 thread, it is safe, process still fast, but when i use 10 thread why the process is so long. The result like this:
I use 5s for the step and 300s audio for testing. |
Beta Was this translation helpful? Give feedback.
-
@zanjabil2502 when you run more systems in multithreading, your threads may start competing for the same resources (e.g. RAM/VRAM, because you instantiate new models in each thread). There's also python's GIL that may be bothering there. I suggest you try multiprocessing instead. This is what I found to be most effective and it's the way I implemented the parallelization of |
Beta Was this translation helpful? Give feedback.
-
I have 300s duration audio, when i use single process, the result like that:
Took 0.183 (+/-0.023) seconds/chunk -- ran 59 times
with Step is 5 seconc
but when two concurrent process, the result like that:
Took 3.367 (+/-2.031) seconds/chunk -- ran 59 times
Took 3.627 (+/-1.946) seconds/chunk -- ran 59 times
with the same configuration
the program running on GPU. why the process will slowdown?
Beta Was this translation helpful? Give feedback.
All reactions