Closed Bug 2069578 Opened 9 days ago Closed 6 days ago

Move the mel buffer into the single-item MelBatch in vendored parakeet.cpp

Categories

(Core :: Audio/Video, task)

task

Tracking

()

RESOLVED FIXED
157 Branch
Tracking Status
firefox157 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Coverity CIDs 1700839 and 1700842 (COPY_INSTEAD_OF_MOVE) flag the same statement, duplicated in Model::transcribe_16k (third_party/parakeet.cpp/src/model.cpp:153) and Model::transcribe_16k_with_timestamps (:405):

mb1.data = feats;   // feats is [n_mels,T] = the B=1 batch buffer

feats is a local std::vector<float> that is not read again on that branch, so std::move(feats) is correct.

This is not a micro-optimisation: the sub_tile > 0 branch is the long-audio path, where feats is n_mels * T floats - roughly 30 MB for ten minutes of audio at 128 mels / 100 fps. The copy doubles peak mel-buffer footprint for exactly the inputs where memory is already tightest.

I will fw this upstream

transcribe_16k and transcribe_16k_with_timestamps both copied feats into
mb1.data on the long-audio path, where feats is n_mels * T floats (tens of MB
for minutes of audio) and is dead after the assignment.

Carried as parakeet-move-mel-batch.patch so it survives re-vendoring; it should
go upstream to mudler/parakeet.cpp and be dropped once it lands there.

Assignee: nobody → sledru
Status: NEW → ASSIGNED
Pushed by sledru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8e67ec05999d https://hg.mozilla.org/integration/autoland/rev/eae40bd23d4f Move the mel buffer into the 1-item MelBatch in vendored parakeet.cpp (Coverity CIDs 1700839, 1700842) r=media-playback-reviewers,padenot
Status: ASSIGNED → RESOLVED
Closed: 6 days ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: