Move the mel buffer into the single-item MelBatch in vendored parakeet.cpp
Categories
(Core :: Audio/Video, task)
Tracking
()
| 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
| Assignee | ||
Comment 1•9 days ago
|
||
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.
Updated•9 days ago
|
| Assignee | ||
Comment 2•9 days ago
|
||
Comment 4•6 days ago
|
||
| bugherder | ||
Description
•