Performance improvements for transcription (up to 20% faster transcription on CPU)#2516
Performance improvements for transcription (up to 20% faster transcription on CPU)#2516eleanorTurintech wants to merge 3 commits into
Conversation
30abb70 to
d3f9b82
Compare
|
Hi @ccoenen, sorry for the @. Would it be possible to get a review / feedback on this PR? Thank you |
|
Hi, I think I was tagged by mistake? I'm not part of this project. |
Ah apologies yes that's the wrong username, sorry about that |
|
Hi @jongwook , sorry for the @. Would it be possible to get a review / feedback on this PR? Thank you |
|
|
||
| # Optimisation: Apply the precomputed CUDA mask if available. | ||
| if torch.cuda.is_available(): | ||
| mask = self.mask_cuda[:n_token, :n_token] |
There was a problem hiding this comment.
Some code formatting issues. You can check the flake8/black options in:
https://github.com/openai/whisper/blob/main/.pre-commit-config.yaml
There was a problem hiding this comment.
I'll fix that, thanks for the feedback :)
There was a problem hiding this comment.
@ryanheise thanks again for the review, I think my latest changes should have fixed those code formatting issues, would you mind taking another look? Thank you :)
|
This PR gives me this error: Reverting to the original code fixes the issue. |
Implements a suite of optimizations focusing on memory efficiency, tensor initialization, and model loading functionality. These changes improve performance, code clarity, and model handling flexibility in the Whisper ASR system that improves transcription speed by up to 20%.
These comprehensive changes optimize memory usage, enhance code quality, and improve model loading reliability while maintaining functional equivalence.
Changes:
Gradient Checkpointing Implementation:
Tensor initialization:
Model loading:
Before:
After:
Impact:
Testing:
python3 -m pytest --durations=0 -vv -k 'not test_transcribe or test_transcribe[tiny] or test_transcribe[tiny.en]' -m 'not requires_cuda'