Skip to content

Validate cooperative GEMV candidates before timing them - #429

Open
Taz33m wants to merge 1 commit into
Nehanth:mainfrom
Taz33m:fix/validate-cooperative-gemv
Open

Taz33m wants to merge 1 commit into
Nehanth:mainfrom
Taz33m:fix/validate-cooperative-gemv

Conversation

@Taz33m

@Taz33m Taz33m commented Nov 30, 2026 •

Copy link
Copy Markdown

What

A cooperative GEMV candidate could win the startup benchmark while producing wrong output because its inputs were zero. Browser and native rooms now compare each candidate’s output on signed Q4/Q8 fixtures against a CPU reference before timing it. The benchmark uses an input width and projection size from the GGUF header. Startup reports an error if every candidate fails. The Flash engine uses its own kernels and skips this tuner.

This is the autotune portion of #334, related to #47. The check exercises 17 rows at one representative input width. Batched prefill, the dense output head’s separately selected shape, and full-model token streams need their own coverage.

Correctness

  • Real Apple Metal, Chrome 158. All five offered shapes passed both reference checks. The test substituted incorrect output for the two eight-row Q8 candidates and verified both were excluded from timing.
  • Deno unit suite passed with 1,441 tests and five skips. The tests include stale outputs, failed full-size dispatches, slow devices and buffer cleanup.
  • Native room-node suite on Node 22, the CI runtime, passed 165 tests with five skips. An exploratory Node 23 run stalled in the disk-reader worker test.
  • Full-model GPU goldens and speculative/plain token-stream comparison on maintainer hardware, as offered in Validate GPU tuning and harden model startup #334.

To repeat the kernel check on macOS, run CHROMIUM='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' E2E_GPU=real node tests/e2e/autotune.mjs after npm ci.

Use signed reference fixtures at a model input width so invalid GPU results cannot select a tuning shape. Surface failure at startup when none of the candidates can run the model-shaped benchmark.
@Taz33m
Taz33m requested a review from Nehanth as a code owner November 30, 2026 23:28
@vercel

vercel Bot commented Nov 30, 2026

Copy link
Copy Markdown

@Taz33m is attempting to deploy a commit to the nehanth's projects Team on Vercel.

A member of the Team first needs to authorize it.

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