Skip to content

performance_parity: Q4_0 buffer of 640 bytes is not a multiple of the 18-byte block size #3181

Description

@noahgift

What

cargo run -p aprender-serve --example performance_parity panics:

thread 'main' panicked at crates/aprender-serve/examples/performance_parity.rs:493:45:
test: InvalidShape { reason: "Q4_0 data length 640 is not a multiple of block size 18" }

A Q4_0 block is 18 bytes (one f16 scale + 16 bytes of packed nibbles). 640 / 18 = 35.55…, so the buffer handed to the reader cannot be a whole number of Q4_0 blocks. Either the example builds its fixture with the wrong stride (640 = 32 × 20 suggests a 20-byte block was assumed), or the reader is computing the block size wrong on this path.

Worth resolving in that order: check the fixture construction at performance_parity.rs:493 first, because a wrong constant in a test fixture is the cheaper explanation and this repository has just had three separate "the reader invented a layout" defects (Q5_K on the CPU path, in apr import, and in the CUDA GEMV, #3110/#3113). If the fixture is right, the defect is in the reader and it is the same family.

How it was found

APR-RELEASE-001 §4 T-2 runs every cargo run --example before a tag (G3.EX, #3121/#3122). This is one of six genuine defects the first such sweep surfaced across 981 example targets. CI builds examples with --examples and has never executed one, so a panic on the very first line of real work has been invisible.

Done

The example completes, and whichever side held the wrong constant is covered by a test that names the block size explicitly rather than deriving it from a length that happened to divide.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium prioritybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions