Skip to content

test(zoo): run Moonshine from an int8 and int4 checkpoint on the GPU - #100

Draft
chmjkb wants to merge 1 commit into
mainfrom
@chmjkb/quant-moonshine-models
Draft

chmjkb wants to merge 1 commit into
mainfrom
@chmjkb/quant-moonshine-models

Conversation

@chmjkb

@chmjkb chmjkb commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Part of #70, phase 4: a GPU test that runs Moonshine from int8 and int4 checkpoints.

test/zoo/moonshine/model.gpu.test.ts builds a Moonshine checkpoint in Hugging Face names, quantizes every Linear, and compares the quantized model against the CPU-dequantized float reference and the float model, in int8 and int4. 4 cases.

Measured on the real Hub files with runntime quantize --bits 8 --group-size 32 from the f16 files (this Mac, f16 math):

model f16 int8 g32 15 s clip f16 → int8 WER vs reference
Tiny 54.2 MB 39.3 MB 104.2 → 107.5 ms 6.6% → 6.6%
Base 123.1 MB 81.5 MB 106.0 → 106.1 ms 7.0% → 7.7%

int4 raises Tiny's WER to 10.7% and is not faster. Moonshine runs at float speed on int8 because decode is bound by dispatch count, not by weight bytes.

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Performance (kernel tuning, graph building, anything related to performance)
  • Other (chores, tests, code style improvements etc.)

Testing instructions

  1. pnpm typecheck
  2. pnpm --filter runntime exec vitest run --project gpu test/zoo/moonshine

Related issues

Part of #70. Stacked on #96.

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

  • The test helpers (cosine, quantize every Linear, dequantized reference) now exist in the MiniLM, EmbeddingGemma 2 and Moonshine tests; they move into test/core/weights/checkpoint.ts once these land.
  • The quantized files are not on the Hub yet; models.ts entries come with the upload.

@chmjkb
chmjkb force-pushed the @chmjkb/quant-small-m branch from 0d254be to bf24cd4 Compare November 4, 2026 12:31
@chmjkb
chmjkb force-pushed the @chmjkb/quant-moonshine-models branch from eafb11b to 9816e38 Compare November 4, 2026 12:31
@chmjkb
chmjkb force-pushed the @chmjkb/quant-small-m branch from 0d2fe22 to fcbcf19 Compare November 5, 2026 09:11
Base automatically changed from @chmjkb/quant-small-m to main November 5, 2026 09:11
@chmjkb
chmjkb force-pushed the @chmjkb/quant-moonshine-models branch from 9816e38 to a709377 Compare November 5, 2026 11:42

This branch has not been deployed

No deployments
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.

1 participant