benchmark_batch_beam_search.py
Less than 1 minute
benchmark_batch_beam_search.py
Measure the speedup of decoding several utterances in one beam search.
This is a synthetic benchmark: it builds a randomly initialized attention decoder plus CTC and decodes random encoder outputs, so the hypotheses are meaningless but the amount of work per decoding step is representative. It reports the wall time of espnet2.legacy.nets.batch_beam_search.BatchBeamSearch given one utterance at a time and given batches of increasing size, and checks that they produce the same best hypothesis for every utterance.
Example:
python utils/benchmark_batch_beam_search.py --device cuda --variedusage: benchmark_batch_beam_search.py [-h] [--device DEVICE] [--vocab VOCAB]
[--dim DIM] [--layers LAYERS]
[--heads HEADS] [--units UNITS]
[--beam BEAM] [--nutt NUTT]
[--frames FRAMES] [--steps STEPS]
[--ctc CTC] [--varied]
[--threads THREADS] [--seed SEED]