scripts: speculative ctx should raise the tiered default, not override it - #140
Draft
gdevenyi wants to merge 1 commit into
Draft
scripts: speculative ctx should raise the tiered default, not override it#140gdevenyi wants to merge 1 commit into
gdevenyi wants to merge 1 commit into
Conversation
gdevenyi
marked this pull request as draft
July 30, 2026 18:18
Contributor
Author
|
This has exposed a bug in your llama.cpp fork. It looks like the dflash model is not properly considered in the --fit of llama.cpp such that it always crashes. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
scripts/start_llama_server.sh:112
_ctxcontains both auto-tiered and explicit values, so this also raises an explicitBONSAI_CTX=8192to 16384. That breaks the documented contract that every explicit non-zero value wins; gate the floor onBONSAI_CTXbeing unset or0.
[ "$_ctx" -lt 16384 ] 2>/dev/null && _ctx=16384
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.
Problem
With
BONSAI_SPECULATIVE=1, the speculative-decoding branch inscripts/start_llama_server.shoverrode the context size to a fixed16384wheneverBONSAI_CTXwas unset or0:This contradicts the
BONSAI_CTX=0= "auto" semantics established in #127 /common.sh:169, where0/unset resolves to the RAM-tiered default. So a 48 GB+ machine (auto tier131072) would get silently capped to16384as soon as speculative decoding was turned on.The floor exists for a real reason (dspark re-prefills every request and drafts 1.5-2k tokens, so a tiny context truncates answers), but it should be a floor, not a hard override.
Fix
_ctxis already initialized toCTX_SIZE_DEFAULT(line 100), which honorsBONSAI_CTXsemantics fromcommon.sh(explicit non-zero wins,0/unset = RAM tier). Replace the override with a raise:Behavior (
BONSAI_SPECULATIVE=1)Explicit
BONSAI_CTX=N(non-zero) is unchanged — it always wins.2>/dev/nullguards the-ltcomparison in case_ctxis ever non-numeric.Verified
sh -npasses.