mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
Control: a feed model whose entry says drafter: none starts with no drafter, and the Terminal plans none for it
Setup already left out the Flash-Next MTP head for it (Q4-P8 F3), but the start and the Terminal's plan still went through the usual drafter decision (G14). Setup now also writes "drafting": "off", drafting.apply starts and reports none for a model whose draft layer is off, and the Terminal resolves "off" for such a family.
This commit is contained in:
1 parent
b473875485
commit
519c7e8c08
5 files changed
+56
-3
No files matched your search
@@ -10688,6 +10688,7 @@ def main() -> int:
|
||||
ok(f"model: {fam['title']}")
|
||||
if fam.get("feed") and fam.get("drafter") == "none" and a.mtp is None:
|
||||
a.mtp = "off" # the feed says this model has no draft layer: the Flash-Next one (fetched below for every qwen4exp model) is not its own
|
||||
a.feed_no_drafter = True # and no drafter at its starts either: the run config says "drafting": "off" (setup_config; APP-LIN 0.2.14)
|
||||
say(" The model list says this model has no draft layer (MTP), so none is fetched or used.")
|
||||
if fam.get("ready") and nvfp4_cpu_note(avx2, avx512): # #2347: a note (the AVX2 rows work), not a refusal
|
||||
warn(nvfp4_cpu_note(avx2, avx512))
|
||||
|
||||
@@ -1561,6 +1561,8 @@ class Runner:
|
||||
"""modelstate.resolved_drafting for this launch: Auto where the all-cards split engine will take the start is the MTP (it runs the model's draft layer and
|
||||
nothing else), so the plan and the fetch include the draft layer and not DFlash2's drafter. A drafter the person chose is kept."""
|
||||
from strata_control import drafting
|
||||
if self.feed_without_draft_layer(family): # the model list says this model has no draft layer: no drafter is planned or fetched for it (G14, APP-LIN 0.2.14)
|
||||
return "off"
|
||||
r = modelstate.resolved_drafting(self.s.drafting, family)
|
||||
if r == "dflash2" and drafting.normalize(self.s.drafting) == "auto" and self.split_expected():
|
||||
return "mtp"
|
||||
@@ -2592,10 +2594,11 @@ class Runner:
|
||||
text = "Speed: " + S.speed_words(speed[0], speed[1])
|
||||
return text + (". " + S.FASTER_NOTE if speed[0] == "faster" else "")
|
||||
|
||||
def feed_without_draft_layer(self) -> bool:
|
||||
"""A model of the signed feed whose entry says `drafter: none` (strata_control/feed_models.py puts it on the family): nothing drafts, whatever Auto would pick for a Flash-Next model."""
|
||||
def feed_without_draft_layer(self, family: str | None = None) -> bool:
|
||||
"""A model of the signed feed whose entry says `drafter: none` (strata_control/feed_models.py puts it on the family): nothing drafts, whatever Auto would pick for a Flash-Next model.
|
||||
`family`: another family than this launch's (None: this launch's)."""
|
||||
try:
|
||||
fam = self.catalog.tables()[1].get(self.s.family) or {}
|
||||
fam = self.catalog.tables()[1].get(family or self.s.family) or {}
|
||||
return bool(fam.get("feed")) and fam.get("drafter") == "none"
|
||||
except Exception: # noqa: BLE001 - an unreadable table is only the generic plan line
|
||||
return False
|
||||
|
||||
@@ -1118,6 +1118,9 @@ def apply(cfg: dict[str, Any], *, klass: str = "other", data_dir: str | Path | N
|
||||
return Decision("dflash2", "dflash2")
|
||||
if not supported_model(cfg.get("model_name"), family): # another model: its drafting is not this choice's business (DeepSeek, Swift, Coder, NVFP4, Qwen3.6...)
|
||||
asked = normalize(cfg.get("drafting"))
|
||||
if asked == "off" or cfg.get("mtp") is False: # no drafter for this model (its draft layer is off, or a feed model whose entry says drafter: none): say so, start none
|
||||
cfg["args"] = strip_mtp_flags(strip_draft_flags(args))
|
||||
return Decision(asked, "off")
|
||||
if asked == "dflash2":
|
||||
cfg["args"] = strip_draft_flags(args)
|
||||
return Decision(asked, "mtp", NOT_SUPPORTED)
|
||||
|
||||
@@ -529,6 +529,8 @@ def config_for(inp: SetupInputs, lib) -> SetupConfig:
|
||||
if a.mtp == "off":
|
||||
cfg["mtp"] = False
|
||||
removed = draft_layer.apply(cfg)
|
||||
if getattr(a, "feed_no_drafter", False):
|
||||
cfg["drafting"] = "off" # a feed model with no draft layer (its entry says drafter: none): no drafter at any start, Auto or not
|
||||
ok("the draft layer (MTP) is off for this model" + (f" ({' '.join(removed)} left out)" if removed else "") +
|
||||
": less graphics memory and RAM, slower words per second. `--mtp on` turns it back on")
|
||||
else:
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
"""A feed model whose entry says `drafter: none` starts with no drafter at every start, and the Terminal plans none for it (lane APP-LIN 0.2.14 item 8; Q4-P8 G14)."""
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
from strata_cli.launch import runner as R
|
||||
from strata_control import drafting
|
||||
|
||||
|
||||
def _cfg(**kw):
|
||||
return {"model_name": "qwen4exp-q4_k_m", "args": ["--native", "/m/a.gguf", "--mtp", "/d/mtp/rt", "--spec-min-p", "0.5", "--max-context", "32768"], **kw}
|
||||
|
||||
|
||||
def test_a_feed_model_with_no_draft_layer_starts_with_no_drafter():
|
||||
for extra in ({"mtp": False, "drafting": "off"}, {"mtp": False}, {"drafting": "off"}):
|
||||
cfg = _cfg(**extra)
|
||||
d = drafting.apply(cfg, backend="cuda", archs=["sm_86"])
|
||||
assert d.drafter == "off", extra
|
||||
assert "--mtp" not in cfg["args"] and "--spec-min-p" not in cfg["args"]
|
||||
assert cfg["args"][-2:] == ["--max-context", "32768"]
|
||||
|
||||
|
||||
def test_other_models_keep_their_decision():
|
||||
cfg = _cfg() # a model DFlash2 is not for, draft layer on: as before
|
||||
assert drafting.apply(cfg, backend="cuda", archs=["sm_86"]).drafter == "mtp"
|
||||
assert "--mtp" in cfg["args"]
|
||||
cfg = _cfg(drafting="dflash2")
|
||||
d = drafting.apply(cfg, backend="cuda", archs=["sm_86"])
|
||||
assert (d.drafter, d.note) == ("mtp", drafting.NOT_SUPPORTED)
|
||||
|
||||
|
||||
def test_the_terminal_plans_no_drafter_for_it():
|
||||
fake = SimpleNamespace(s=SimpleNamespace(drafting=None, family="qwen4exp"), split_expected=lambda: False,
|
||||
feed_without_draft_layer=lambda family=None: family == "qwen4exp")
|
||||
assert R.Runner.resolved_drafting(fake, "qwen4exp") == "off"
|
||||
fake.s.drafting = "mtp"
|
||||
assert R.Runner.resolved_drafting(fake, "qwen4exp") == "off", "the head the MTP would load is Flash-Next's, not this model's"
|
||||
|
||||
|
||||
def test_setup_writes_drafting_off_for_it():
|
||||
src = (Path(drafting.__file__).parent / "setup_config.py").read_text(encoding="utf-8")
|
||||
assert 'if getattr(a, "feed_no_drafter", False):' in src and 'cfg["drafting"] = "off"' in src
|
||||
setup = (Path(drafting.__file__).parent.parent / "setup.py").read_text(encoding="utf-8")
|
||||
at = setup.index('fam.get("drafter") == "none" and a.mtp is None')
|
||||
assert "a.feed_no_drafter = True" in setup[at:at + 600]
|
||||
Reference in new issue
Block a user