Skip to content

npu: the draft loop refuses the hidden-row shape its own interface documents, aborting the run at the first partial accept #1137

Closed

Description

@bong-water-water-bong

BaseModel::last_hidden_rows() (npu/mtp/draft.h) documents "Every row's hidden of the last batched pass (M x hidden_size, row-major)" — the whole verify batch. Q4nxNpuForward::commit_verify_rows truncates that buffer to the accepted prefix (#820), and run() required exactly that second shape:

if (rows.size() != (size_t)take * (size_t)base.hidden_size()) {
    if (!rows.empty()) { r.err = "drafter rows: base returned a partial batch hidden"; return r; }
}

So any base that keeps its batch buffer — the documented shape, and what a new target (NpuModel P4, Hexagon P5) writes first — fails the whole run on the first partial accept, with an error calling a full buffer "partial". Reproduced with a toy base that keeps its rows: 680 of 2000 randomised cases (k, tau, budget, batch width, head accuracy) aborted, while the same 2000 with the pre-truncated shape all passed on text, state and position.

Row m is the hidden after the token at start_pos+m in both shapes, so the first accepted rows are the ones the drafter must advance over either way.

Fixed in #PR (next message): the loop takes the first accepted rows of either shape and still fails loudly on any other count; tests/mtp_draft_test.cpp [13] is red before and green after.

Activity

  1. added
    npu
    on Nov 5, 2026
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

    npu

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions