Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wav2Vec2 upgrade with Conv1D options #1758

Merged
merged 15 commits into from
Aug 19, 2024
Merged

Conversation

homink
Copy link
Contributor

@homink homink commented Aug 13, 2024

This PR enhances the efficiency of Wav2Vec2 inference within the CTranslate2 framework, specifically improving both speed and memory usage. Compared to the HuggingFace implementation, the int8 quantized model shows an 11% increase in speed and a 70% reduction in memory usage on GPU, as well as a 5% increase in speed and a 71% reduction in memory usage on CPU when processing 300 audio files. Additionally, using an N-gram language model with pyctcdecode further can improve the speech recognition accuracy. My environment includes an NVIDIA GeForce RTX 3090 24GB with CUDA 12.4, torch==2.12+cu12.1, and transformers==4.41.0. Special thanks for the Depthwise convolution process introduced in #1749.

@homink
Copy link
Contributor Author

homink commented Aug 14, 2024

@minhthuc2502 could you please have a look at this PR and merge it?

src/layers/wav2vec2.cc Outdated Show resolved Hide resolved
src/layers/wav2vec2.cc Outdated Show resolved Hide resolved
@homink
Copy link
Contributor Author

homink commented Aug 15, 2024

@minhthuc2502 Thank you for your suggestions. I agree that the changes were redundant. I've updated the code as you recommended and made the necessary commits to ensure all checks pass. It appears that the network conditions for build-and-push-docker-images are more favorable in the morning where I am located.

@minhthuc2502
Copy link
Collaborator

Hello, Thank you for your updates. I'll merge this. I agree that there is some network problems with build-and-push-docker-images , currently, I have rerun it manually. Have to fix this in the future.

@minhthuc2502 minhthuc2502 merged commit 8ba828c into OpenNMT:master Aug 19, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants