Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions dev/tests/test_rfc_187_verify_rows.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""RFC 187 scaffolding test: verify-rows flag defaults to 8, off."""

import unittest
from pathlib import Path

ROOT = Path(__file__).resolve().parents[2]


class Rfc187VerifyRowsTest(unittest.TestCase):
def test_header_defaults(self):
header = ROOT / "runtime/ops/Rfc187VerifyRows.hpp"
self.assertTrue(header.is_file())
text = header.read_text()
self.assertIn("kEnabledDefault = false", text)
self.assertIn("SPLASH_VERIFY_ROWS", text)
self.assertIn("kVerifyRowsDefault = 8", text)
self.assertIn("kVerifyRowsCandidate = 16", text)

def test_doc_exists(self):
doc = ROOT / "docs/rfc/187-verify-16.md"
self.assertTrue(doc.is_file())
self.assertIn("issues/187", doc.read_text())


if __name__ == "__main__":
unittest.main()
43 changes: 43 additions & 0 deletions docs/rfc/187-verify-16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# RFC 187 — Deeper verify rows (8 → 16)

Upstream issue: https://github.com/incoai/splash/issues/187

Source: `mlxfast-bonsai2-27b` `Qwen35MTPTopTwo.swift` (verify `L=16`
folded `repeats*L` rows, vocab-head `16x32x16` kernel),
`AttentionV1 verifyFoldRepeats` (bit-identical `BK/SK` reduction).

## Problem

Splash pins `TARGET_VERIFY_ROWS=8`, `DRAFT_QUERY_ROWS=8`,
`DRAFT_PROPOSAL_TOKENS=7` (`runtime/metal/abi/ExecutionGeometry.h:5`,
`model/Model.hpp:269`); decode shapes are lanes×8 only. The 27B dense
slabs (`5120×17408`) and 35B MoE tiles stay under-occupied. `PLAN.md:26`
scoped deeper verify out; bonsai evidence reopens it. Related: #168, #169.

## Proposal

Tunable verify axis, default 8:

1. `runtime/ops/Rfc187VerifyRows.hpp` declares the flag, env var
(`SPLASH_VERIFY_ROWS`), and candidate set `{8, 16}`.
2. Follow-up threads it through `ExecutionGeometry.h`,
`PagedAttention::verifyPlan`, `Linear::decodePlan`, arena packing, and
`SPLASH_SPECULATIVE_SCRATCH_TOKENS`; draft depth fills the wider window.
3. Tuner (`decodeCandidates()`) picks per device; `MAX_BATCH_WIDTH`
coordination follows.

## Contracts

- Bit-identical verify (folded view, same reduction order).
- Memory plan bounds extra scratch at startup; ABBA acceptance gate.

## Validation

- `benchmark-decode-profile` B1–B4 + `benchmark-gguf-moe` rows 8/16 +
serving ABBA (MLX + GGUF, both models).

## Rollout

1. This RFC (flag + doc + test).
2. Plan/ABI threading (default 8).
3. Per-device promotion with evidence.
19 changes: 19 additions & 0 deletions runtime/ops/Rfc187VerifyRows.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

// RFC 187 scaffolding: deeper verify rows (8 -> 16 candidate).
// Not wired into ExecutionGeometry / verifyPlan yet.
// See docs/rfc/187-verify-16.md and
// https://github.com/incoai/splash/issues/187.

#include <cstdint>

namespace splash::ops::rfc187 {

inline constexpr bool kEnabledDefault = false;
inline constexpr const char* kEnvVar = "SPLASH_VERIFY_ROWS";

// Shipped default stays 8; 16 is the measured candidate.
inline constexpr std::uint32_t kVerifyRowsDefault = 8;
inline constexpr std::uint32_t kVerifyRowsCandidate = 16;

} // namespace splash::ops::rfc187