Skip to content

perf(inkling): verify rounds of up to 8 tokens run the compiled step (#650 P2b) - #737

Merged
goodmai merged 2 commits into
mainfrom
feat/650-p2b-compiled-verify
Nov 23, 2026
Merged

goodmai merged 2 commits into
mainfrom
feat/650-p2b-compiled-verify

Conversation

@goodmai

@goodmai goodmai commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

#650 P2b. Inkling2DecoderLayer runs its compiled pre/post steps for up to 8 rows instead of only one, so DSpark verify rounds leave the eager graph.

  • The compiled steps now return the conv windows. The states are sliced outside, the same slice as before, so a 1-token step is unchanged.
  • A round of 2 to 8 rows hands its windows to ConvolutionStatesCache, so a rejected suffix still rewinds.
  • Tests: InklingCompiledVerifyTests. A compiled 4-token round matches the eager graph within 1e-4 with the same greedy ids. Trimmed back to 1, 2 or 3 positions, it continues like the eager round.
  • To measure: verify-step time and --mtp decode on oQ3e.

Review fixes:

  • The compiled step runs only for 1 ... 8 rows.
  • The parity test covers rounds of 1, 4 and 8 tokens through the compiled step, and 9 tokens on the eager path.

Verified locally: strict build; InklingCompiledVerifyTests (7 cases) plus the Inkling suites (29 tests in 6 suites) pass; comment and size gates clean.

Not measured yet: verify-step time and --mtp decode on oQ3e.

🤖 Generated with Claude Code

https://claude.ai/code/session_012cicguZMN3jhNGmf5327oh

@goodmai

goodmai commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

Review (#650 P2b)

Very clean and minimal diff. Two small Should fix items:

  1. Boundary guard hidden.dim(1) <= Self.compiledRows admits dim(1) == 0 (Sources/BasaltInference/Models/Inkling2/Inkling2DecoderLayer.swift:60).
    • Fix: Narrow to (1 ... Self.compiledRows).contains(hidden.dim(1)).
  2. Test coverage for boundary lengths 1 and 8 (Tests/BasaltTests/InklingCompiledVerifyTests.swift:86, 102-116).
    • Case: preStep/postStep now return full keyWindow/valueWindow and slice convState outside the compiled step for length == 1 as well, and the upper compiled bound is 8, while the test only exercises round.count == 4.
    • Fix: Parameterize compiledMatchesEager over lengths [1, 4, 8] (or add a length-8 round alongside length-4).

@goodmai
goodmai marked this pull request as ready for review November 23, 2026 12:51
@goodmai
goodmai merged commit c1185f8 into main Nov 23, 2026
8 of 9 checks passed
@goodmai
goodmai deleted the feat/650-p2b-compiled-verify branch November 23, 2026 14:02
goodmai added a commit that referenced this pull request Nov 23, 2026
…g safety, DSpark config guards, compiled 1-row rewind, HF-aligned YaRN factor (#750)

* fix(rope,inkling): staging follows its source's file set and sweeps abandoned temporaries; MTP drafter from the staged config; DSpark block_size within the conv rewind, strictly increasing taps, null mtp_config; compiled 1-row steps keep conv windows; chunked drafter prefill (review)

* chore(fork): pin e9feb1e — HF-aligned YaRN attention factor, exact-trim precondition; test the attention-factor rules (review)
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