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

passing samples_padded by ref to the threads. #2534

Merged
merged 5 commits into from
Nov 6, 2024

Conversation

vinmisra
Copy link
Contributor

@vinmisra vinmisra commented Nov 6, 2024

I observed substantial memory usage during multithreaded MFCC processing of large audio files. This appears to originate from copying the full samples_padded audio sequence to each MFCC processing thread.

This minor optimization switches to a cref to avoid copying. MFCC extraction doesn't modify the samples so I believe this is safe.

Copy link
Owner

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good one! Thanks

@ggerganov ggerganov merged commit 31aea56 into ggerganov:master Nov 6, 2024
45 checks passed
@Josscii
Copy link
Contributor

Josscii commented Nov 10, 2024

@ggerganov I tested this change, and it introduce a new memory leak, after whisper_free, it has more memory usage than before this change.

Josscii added a commit to Josscii/whisper.cpp that referenced this pull request Nov 10, 2024
@ggerganov
Copy link
Owner

I don't see why it would cause more memory usage.

adutilleul pushed a commit to adutilleul/whisper.cpp that referenced this pull request Nov 19, 2024
* passing samples_padded by ref to the threads.

* passing samples_padded by ref to the threads.

---------

Co-authored-by: Vinith Misra <[email protected]>
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.

3 participants