Repository navigation
Revert "docs: MLXServer guide — setup for Hermes, opencode, Droid, Aider" - #20
Merged
Merged
Conversation
ekryski
marked this pull request as ready for review
April 12, 2026 00:51
ekryski
added a commit
that referenced
this pull request
Apr 30, 2026
Several follow-ups to spec 023 (Leviathan) bundled into PR #154's tail since they share the "set up the rest of the speculative-decoding roadmap" theme. **Q2 — spec 013 close-out:** - Implements phase 3.3 ("ngram-map-k4v" / "first 1-2 tokens"): adds `multiCandidateLookahead: Int = 1` parameter to `NGramLookup.proposeDraft` plus `MLX_NGRAM_MULTI_LOOKAHEAD=N` env var (default 1, preserves prior behaviour). Lookahead=2 disambiguates patterns where multiple prior occurrences share the same first continuation token but diverge on the second — group key changes from `Int` to `[Int]` for the multi-candidate grouping. - 2 new unit tests cover lookahead=1 vs lookahead=2 disambiguation (the "[A,B] → [X,Y] count 2 vs [X,Z] count 1" canonical case). 37/37 ngram tests pass. - Updates `specs/013-ngram-speculative-decoding.md` with an implementation-status table at the bottom: phases 1.4 / 2.2 / 2.3 / 3.1 / 3.2 / 3.3 shipped; 1.1 / 1.5 deferred (need real-model test harness); 1.2 mitigated; 2.1 partial (more model coverage as needed); 3.4 superseded by spec 020 tape-replay. **Q3 — eval harness:** - `scripts/spec-decode-sweep.sh` — parameterised sweep runner. Takes `--model`, `--quant`, `--prompts` (file or directory), `--cells` (colon-separated `LABEL:NGRAM:TEMP:EXTRA_ENV` specs comma-joined), `--trials`, `--max-tokens`. Replaces the per-PR ad-hoc shell loops in /tmp/ that we've been writing fresh each time. - `scripts/spec-decode-compare.py` — A vs B compare on two sweep logs. Computes per-cell medians + speedup-ratios with directional emoji (✅ /⚠️ / ≈). Tolerates both the new `extra=...` cell-line format and the older `leviathan=...` format from /tmp/ legacy runs. - `Tests/Benchmarks/Resources/ngram-sweep-prompts/README.md` — regime-classified workload guide. Three regimes (regurgitative / structured / paraphrastic) with expected speedup bands per regime, per-directory prompt counts, and the canonical 6-cell × 5-trial cell-set used in the Leviathan analysis. Reference for any future spec-decode PR's eval section. - 8 draft spec PRs (#141 / #142 / #143 / #144 / #145 / #146 / #147 / #148) updated with per-spec "Evaluation (when phase 2+ lands)" sections that include the canonical sweep+compare commands + per-spec pass criteria. **Q4 — IMPLEMENTATION-PLAN.md reorder:** Tier 1 ↔ Tier 3 swap. Tape-replay (#20) + prefix cache (#17) are now Tier 1 (deterministic infrastructure wins, scaffolds landed, unblocks 5+ models / universal multi-turn TTFT win). DFlash (#15) + Mirror SD (#21) are now Tier 3 (more experimental — DFlash needs draft model availability, Mirror SD needs CoreML-LLM Swift Package dep + ANE measurement infra). Rationale: lower experimental risk to land deterministic wins first. By the time DFlash + Mirror SD are unblocked (external model release, ANE infra), tape-replay will be in place to support DFlash phase 3. Status snapshot updated: Tier 0 (013 + 018 + 023 + eval harness) shipped; Tier 1 in flight (phase-1 scaffolds at #143, #144); Tier 2 phase-1 scaffolds also landed (#145, #146, #147, #148). Closing notes in the plan also reflect spec 023's phase-2 / phase-3 deferral (subsumed by issue #153) so they're not re-attempted. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ekryski
added a commit
that referenced
this pull request
Apr 30, 2026
Several follow-ups to spec 023 (Leviathan) bundled into PR #154's tail since they share the "set up the rest of the speculative-decoding roadmap" theme. **Q2 — spec 013 close-out:** - Implements phase 3.3 ("ngram-map-k4v" / "first 1-2 tokens"): adds `multiCandidateLookahead: Int = 1` parameter to `NGramLookup.proposeDraft` plus `MLX_NGRAM_MULTI_LOOKAHEAD=N` env var (default 1, preserves prior behaviour). Lookahead=2 disambiguates patterns where multiple prior occurrences share the same first continuation token but diverge on the second — group key changes from `Int` to `[Int]` for the multi-candidate grouping. - 2 new unit tests cover lookahead=1 vs lookahead=2 disambiguation (the "[A,B] → [X,Y] count 2 vs [X,Z] count 1" canonical case). 37/37 ngram tests pass. - Updates `specs/013-ngram-speculative-decoding.md` with an implementation-status table at the bottom: phases 1.4 / 2.2 / 2.3 / 3.1 / 3.2 / 3.3 shipped; 1.1 / 1.5 deferred (need real-model test harness); 1.2 mitigated; 2.1 partial (more model coverage as needed); 3.4 superseded by spec 020 tape-replay. **Q3 — eval harness:** - `scripts/spec-decode-sweep.sh` — parameterised sweep runner. Takes `--model`, `--quant`, `--prompts` (file or directory), `--cells` (colon-separated `LABEL:NGRAM:TEMP:EXTRA_ENV` specs comma-joined), `--trials`, `--max-tokens`. Replaces the per-PR ad-hoc shell loops in /tmp/ that we've been writing fresh each time. - `scripts/spec-decode-compare.py` — A vs B compare on two sweep logs. Computes per-cell medians + speedup-ratios with directional emoji (✅ /⚠️ / ≈). Tolerates both the new `extra=...` cell-line format and the older `leviathan=...` format from /tmp/ legacy runs. - `Tests/Benchmarks/Resources/ngram-sweep-prompts/README.md` — regime-classified workload guide. Three regimes (regurgitative / structured / paraphrastic) with expected speedup bands per regime, per-directory prompt counts, and the canonical 6-cell × 5-trial cell-set used in the Leviathan analysis. Reference for any future spec-decode PR's eval section. - 8 draft spec PRs (#141 / #142 / #143 / #144 / #145 / #146 / #147 / #148) updated with per-spec "Evaluation (when phase 2+ lands)" sections that include the canonical sweep+compare commands + per-spec pass criteria. **Q4 — IMPLEMENTATION-PLAN.md reorder:** Tier 1 ↔ Tier 3 swap. Tape-replay (#20) + prefix cache (#17) are now Tier 1 (deterministic infrastructure wins, scaffolds landed, unblocks 5+ models / universal multi-turn TTFT win). DFlash (#15) + Mirror SD (#21) are now Tier 3 (more experimental — DFlash needs draft model availability, Mirror SD needs CoreML-LLM Swift Package dep + ANE measurement infra). Rationale: lower experimental risk to land deterministic wins first. By the time DFlash + Mirror SD are unblocked (external model release, ANE infra), tape-replay will be in place to support DFlash phase 3. Status snapshot updated: Tier 0 (013 + 018 + 023 + eval harness) shipped; Tier 1 in flight (phase-1 scaffolds at #143, #144); Tier 2 phase-1 scaffolds also landed (#145, #146, #147, #148). Closing notes in the plan also reflect spec 023's phase-2 / phase-3 deferral (subsumed by issue #153) so they're not re-attempted. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #19