Skip to content

fix(parakeet): store pointwise convs 2-D so they quantize (#281) - #307

Closed
patricksamuelevans wants to merge 1 commit into
handy-computer:mainfrom
patricksamuelevans:fix/parakeet-pointwise-quant
Closed

patricksamuelevans wants to merge 1 commit into
handy-computer:mainfrom
patricksamuelevans:fix/parakeet-pointwise-quant

Conversation

@patricksamuelevans

@patricksamuelevans patricksamuelevans commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #281

Summary

  • Parakeet conformer pointwise 1x1 convs were stored [1, in, out].
    transcribe-quantize classifies ne0 == 1 as ConvPw and keeps it F16
    because a 1-element row cannot be block-quantized.
  • 48 tensors per 0.6B model stayed F16; CPU also promoted them to F32
    (~290 MB copy).

Scope

  • scripts/convert-parakeet.py: squeeze conv.pointwise{1,2}.weight to
    [out, in] (same memory order, no transpose).
  • src/arch/parakeet/weights.cpp: GET_PW peeks at the stored layout and
    validates one shape; 2-D uses linear types, legacy 3-D uses conv types.
  • src/conformer/conformer.cpp: force the direct mul_mat pointwise path
    when either weight is 2-D; mixed layouts cannot select im2col.
  • src/arch/parakeet/weights.h, src/conformer/conformer.h: document both
    layouts.
  • tests/fixtures/make_gguf_fixtures.py: pointwise1 2-D + pointwise2 legacy
    3-D, covering both loader branches in parakeet_smoke.
  • docs/tools/quantization.md: legacy 3-D ConvPw vs 2-D Linear.

AI Assistance

  • AI-assisted implementation under human direction, following the issue
    proposal.
  • Author reviewed the diff and tests.

Validation

  • transcribe_parakeet_smoke passes with the mixed 2-D/legacy fixture.
  • CPU ctest: 65/66; only the pre-existing transcribe_sava_smoke crash.
  • clang-format 22.1.5 and git diff --check: clean.
  • Not run: real TDT reconvert, Q5_K_M size/RAM/transcript parity, and WER (no
    NeMo environment or model here). Expected from the issue: 539.0 -> 439.9 MB
    and 1258 -> 875 MB peak CPU RAM.
  • Limitation: the fixture is F32-only, so the quantized 2-D path still needs a
    real-model quant run.

A 1x1 conv is a linear layer: [out, in, 1] and [out, in] have the same
memory order. The converter now squeezes the conformer pointwise pair to
2-D, so transcribe-quantize classifies it as Linear instead of pinning
48 tensors per 0.6B model at F16 (about 100 MB at Q5_K_M and a ~290 MB
F32 promotion on CPU).

The loader accepts both layouts: GET_PW peeks at the stored rank and
validates one shape. The conformer forces the direct mul_mat path when
either pointwise weight is 2-D (the im2col fallback needs a kernel
axis). Legacy 3-D GGUFs keep loading, and mixed layouts cannot select
im2col by accident. The synthetic parakeet fixture stores pointwise1
2-D and pointwise2 legacy 3-D, covering both loader branches.

Docs/tools/quantization.md now separates legacy 3-D ConvPw from the
2-D Linear layout.

Fixes handy-computer#281.
@patricksamuelevans
patricksamuelevans marked this pull request as ready for review December 1, 2026 04:57
@cjpais

cjpais commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

not sure why this was opened, could have collaborated on #283

@cjpais cjpais closed this Dec 3, 2026
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.

Parakeet: conformer pointwise convs are never quantized

2 participants