Skip to content

mel: skip zero-weight filterbank entries in the mel projection - #64

Merged
mudler merged 1 commit into
mudler:masterfrom
haydonryan:opt/mel-sparse-filterbank
Aug 18, 2026
Merged

mel: skip zero-weight filterbank entries in the mel projection#64
mudler merged 1 commit into
mudler:masterfrom
haydonryan:opt/mel-sparse-filterbank

Conversation

@haydonryan

Copy link
Copy Markdown
Contributor

The mel filterbank matrix is ~98% zeros (426 nonzero of 20 560 on the 110m). frame_logmel now iterates a precomputed nonzero (bin, weight) index instead of all n_bins per mel filter, cutting the per-frame filterbank multiply-adds ~48x. Skipping an exact-zero weight contributes exactly 0.0, so the output is bit-identical (verified by checksum and the NeMo mel parity test test_mel).

Measured: ~55% faster mel frontend on the 110m (bit-identical).

Assisted-by: AI:DeepSeek-V4-Flash

The mel filterbank matrix is ~98% zeros (426 nonzero of 20 560 on the
110m). frame_logmel now iterates a precomputed nonzero (bin, weight)
index instead of all n_bins per mel filter, cutting the per-frame
filterbank multiply-adds ~48x. Skipping an exact-zero weight contributes
exactly 0.0, so the output is bit-identical (verified by checksum and the
NeMo mel parity test test_mel).

Measured: ~55% faster mel frontend on the 110m (bit-identical).

Assisted-by: AI:DeepSeek-V4-Flash
@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

The sparse projection preserves the accumulation order of every non-zero term and removes only exact-zero multiplications; the storage is built once and the hot path stays allocation-free. This is a focused, worthwhile frontend optimization. @mudler this looks good to merge.

One non-blocking housekeeping note: the Assisted-by trailer does not use the repository's documented AGENT_NAME:MODEL_VERSION [TOOL] form; please normalize it when convenient.

@mudler
mudler merged commit e75de9b into mudler:master Aug 18, 2026
4 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.

3 participants