Montreal-Forced-Aligner icon indicating copy to clipboard operation
Montreal-Forced-Aligner copied to clipboard

Multiprocessing

Open cveaux opened this issue 6 years ago • 6 comments

Hi, from my experiments it seems that the MFA is running on only one cpu when there is only one speaker to align. I am running the alignment on the LJSpeech corpus (one speaker, 13100 audio files) and have specified -j 8 in the arguments. However I got num_jobs=1 in the mfcc function in multiprocessing.py (and same for subsequent steps). Do you confirm this behaviour or I am doing something wrong?

p.s.: I am running the MFA with this command:

python ~/corpustools/montreal_forced_aligner/aligner/command_line/train_and_align.py -s 0 -t ~/MFA -j 8 --verbose --clean ljspeech word_lexicon.txt mfa_align

Thanks

cveaux avatar Apr 26 '18 18:04 cveaux

pps: Indeed, I just saw in corpus.py (__init__ and find_best_groupings) that the actual number of parallel jobs depends on the number of speakers and different sampling rates. I guess that a way to do multi-processing with a single speaker might be to split the data beforehand into several "speakers" and then stop the training after the trigram alignment.

cveaux avatar Apr 26 '18 20:04 cveaux

Yeah, that would be my thought as well. The original use case is geared towards datasets that have lots of speakers, rather than just one. In principle, it shouldn't be too hard to assign extra processes to speakers with the most data. I'll think some more about it.

mmcauliffe avatar Apr 27 '18 13:04 mmcauliffe

Did you come to a conclusion?

I guess that a way to do multi-processing with a single speaker might be to split the data beforehand into several "speakers" and then stop the training after the trigram alignment.

Is this the workaround to choose?

phtephanx avatar Sep 05 '19 06:09 phtephanx

Hi, yes, that's what I did, works very well. However I haven't followed latest updates of MFA so maybe the multi-processing for a single speaker has been implemented since.

cveaux avatar Sep 05 '19 14:09 cveaux

this caught me as well, glad to find this thread!

JRMeyer avatar Oct 09 '20 12:10 JRMeyer

Is single-speaker multi-processing supported now?

owaski avatar Jun 20 '22 20:06 owaski