NeMo icon indicating copy to clipboard operation
NeMo copied to clipboard

GPU-based vectorized Specaug Version 2

Open amorari-nvidia opened this issue 1 year ago • 6 comments

What does this PR do ?

This PR proposes a faster version of the Spectrogram Augmentation module for time and frequency masking.

amorari-nvidia avatar May 09 '24 18:05 amorari-nvidia

After this I think that we may also have to add the flag in the audio processing module: https://github.com/amorari-nvidia/NeMo/blob/d26eab45d54e9e00e74c68ea4b0bbbf7b48a7a50/nemo/collections/asr/modules/audio_preprocessing.py#L494

And also we may have to add a test, adding the pytest run_only_on('GPU') flag the same it is done for the numba code: #https://github.com/amorari-nvidia/NeMo/blob/d26eab45d54e9e00e74c68ea4b0bbbf7b48a7a50/tests/collections/asr/test_asr_modules.py#L71

ghost avatar May 09 '24 22:05 ghost

@amorari-nvidia As a last thing, could you remove the numba specaug implementation altogether in this PR? IIRC it will automatically kick in with numba 0.58 (or when numba+cuda versions are compatible for earlier versions), overriding the implementation here. CC @titu1994 pls double check if I'm right about this.

pzelasko avatar May 13 '24 15:05 pzelasko

Waiting for confirmation from @titu1994

ghost avatar May 13 '24 18:05 ghost

You can remove it entirely, or set the default flag of numba cuda to false. I think that's sufficient for the time being.

If you can remove it cleanly, then that's fine too

titu1994 avatar May 13 '24 19:05 titu1994

I will just set the Numba version default flag to false for now

ghost avatar May 13 '24 20:05 ghost

I will just set the Numba version default flag to false for now

The Numba SpecAugment version is already set to false, while the vectorized version is set to true and is the default code.

ghost avatar May 13 '24 20:05 ghost

great, re-triggered tests, LGTM as soon as it's green

pzelasko avatar May 14 '24 15:05 pzelasko

great, re-triggered tests, LGTM as soon as it's green

CI passed

pablo-garay avatar May 14 '24 23:05 pablo-garay

Congrats @amorari-nvidia on the first contribution!

pzelasko avatar May 15 '24 20:05 pzelasko