From 4eca56f46a0664fc7607be3c9645934949a3f4fd Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Mon, 12 Oct 2026 18:30:51 +0200 Subject: [PATCH] metal: --spec defaults to 2 on Metal builds (an explicit --spec N wins) Owner decision. Only the Options default under STRATA_GPU_METAL; CUDA/HIP/SYCL keep 0: on P2003 the CUDA generate.cpp translation unit preprocesses IDENTICAL and its object is byte-IDENTICAL. M5 Max, MTP, 200 tokens, greedy output equal to no MTP in every run: Q2_0 114.0 / 107.9 tok/s (prompt1 / story, --suffix-draft 0; was 112.0 / 86.2 at --spec 4), 119.5 / 108.2 with the default suffix drafter; IQ3_XXS 103.5 / 96.9, 108.9 / 97.0 (was 110.2 / 87.4). --- src/program/generate.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/program/generate.cpp b/src/program/generate.cpp index a601fbcc..9128f368 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -551,7 +551,11 @@ struct Options { /// Plan v0.3 P6: speculative decoding with a verify window of this many tokens (the last accepted token and /// spec-1 drafts); 0 = plain decode. `spec_oracle` drafts from a token file (the expected continuation, for /// the exactness test); `spec_corrupt` N > 0 replaces every Nth draft with a wrong token. +#if defined(STRATA_GPU_METAL) + int spec = 2; // Metal: a window of 2 by default (measured best on the M5 Max; an explicit --spec wins) +#else int spec = 0; +#endif /// --serve runs up to this many sequences at once, one token each per batch window (0 = off). A request /// sent as `BGEN ...` reads its prompt and its first token through the usual path, then /// continues in slot of the batch windows (`BT ` lines, then `BDONE ...`).