mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
Terminal: --expert-skip medium is offered on every Ling engine except Metal
Align the Terminal with the desktop app (owner 2026-12-04). The expert skip stays opt-in and off by default, with the same words about the accuracy cost; it is no longer limited to an NVIDIA CUDA card of the 24 GB class in tier B or C on Linux. ling32_fit.expert_skip_applies is true for every backend but metal (any card, tier and platform), so `--expert-skip medium` writes `--skip-tau 0.05` on Windows, on AMD and Intel engines and on small cards too; on a Mac the notice says the engine has no expert skip and nothing is written. Measured: +9 to 10 % on a 3090 (Linux, tier B), +9 to 11 % on an RTX 5070 12 GB (Windows, tier C, the app run). Help texts, the settings register note and docs/SETTINGS.md say the same; test_ling32_expert_skip.py and test_ling32_expert_skip_app.py pin the new rule (every backend but metal, the Mac's notice, setup writes the pair on a 12 GB card, HIP and SYCL).
This commit is contained in:
1 parent
f2356adf3e
commit
97c06b65f3
8 files changed
+65
-69
No files matched your search
+2
-2
@@ -697,8 +697,8 @@ except the thinking default (off) and the memory tier (chosen for your computer
|
||||
| `--ram-budget-gib N` | let the engine hold at most N GiB of RAM (default: the available RAM less 6 GiB) | launcher-flag | opt-in |
|
||||
| `--turbo-ssd` | faster, may change answers: in tier C the engine skips a cold expert read from the SSD once memory covers enough of the routing weight; off unless asked | launcher-flag | opt-in |
|
||||
| `--cpu-coexec N` | N CPU threads work on the experts that are not on the card; answers stay identical; off unless asked | launcher-flag | opt-in |
|
||||
| `--expert-skip LEVEL` | Ling-3.2-Air expert skip: medium = the engine's --skip-tau 0.05, faster (about +9 to 10 % on a 3090) and slightly less exact (about 1 word in 60 differs); offered only for an NVIDIA card of the 24 GB class (3090, 4090) on Linux when the plan streams experts (tier B or C); off unless asked; written into the saved run config as `--skip-tau 0.05` only when on; the desktop app's Ling panel (Models page and the model's settings) has the same choice, Expert skip Off / Medium, and writes the same pair (also on Windows; the Terminal's own offer stays as measured) | launcher-flag | opt-in |
|
||||
| `--expert-skip LEVEL (setup)` | Ling-3.2-Air expert skip: medium = the engine's --skip-tau 0.05, faster (about +9 to 10 % on a 3090) and slightly less exact (about 1 word in 60 differs); offered only for an NVIDIA card of the 24 GB class (3090, 4090) on Linux when the plan streams experts (tier B or C); off unless asked; written into the saved run config as `--skip-tau 0.05` only when on | setup-flag | opt-in |
|
||||
| `--expert-skip LEVEL` | Ling-3.2-Air expert skip: medium = the engine's --skip-tau 0.05, faster (about +9 to 10 % on a 3090) and slightly less exact (about 1 word in 60 differs); offered on every Ling engine except the Mac's (measured: +9 to 10 % on a 3090 on Linux in tier B, +9 to 11 % on an RTX 5070 12 GB on Windows in tier C); off unless asked; written into the saved run config as `--skip-tau 0.05` only when on; the desktop app's Ling panel (Models page and the model's settings) has the same choice, Expert skip Off / Medium, and writes the same pair | launcher-flag | opt-in |
|
||||
| `--expert-skip LEVEL (setup)` | Ling-3.2-Air expert skip: medium = the engine's --skip-tau 0.05, faster (about +9 to 10 % on a 3090) and slightly less exact (about 1 word in 60 differs); offered on every Ling engine except the Mac's (measured: +9 to 10 % on a 3090 on Linux in tier B, +9 to 11 % on an RTX 5070 12 GB on Windows in tier C); off unless asked; written into the saved run config as `--skip-tau 0.05` only when on | setup-flag | opt-in |
|
||||
| `--tier / --vram-budget-gib / --ram-budget-gib / --turbo-ssd / --cpu-coexec / --thinking` | the same options for setup.py (the first install writes them into the run config) | setup-flag | opt-in |
|
||||
| `--tier vram/hybrid/nvme` | the engine's own words for tiers A / B / C (strata-ling32 --tier); passed only when the person chose one | engine-flag | default |
|
||||
| `--vram-budget-gib / --ram-budget-gib / --turbo-ssd / --cpu-coexec` | passed to strata-ling32 only when given | engine-flag | opt-in |
|
||||
|
||||
@@ -36499,7 +36499,7 @@
|
||||
"last_date": "2026-12-03",
|
||||
"status": "opt-in",
|
||||
"owner": "L32",
|
||||
"note": "experiment, NOT exact: drop a decode / verify token's routed experts whose share of its routing weight is below this value (the top expert is kept, weights renormalized); default 0 (off). The launcher's optional `--expert-skip medium` writes --skip-tau 0.05 (24 GB NVIDIA class, Linux, tier B / C)",
|
||||
"note": "experiment, NOT exact: drop a decode / verify token's routed experts whose share of its routing weight is below this value (the top expert is kept, weights renormalized); default 0 (off). The launcher's optional `--expert-skip medium` writes --skip-tau 0.05 (every Ling engine except the Mac's)",
|
||||
"retire_after": "",
|
||||
"retired_in": ""
|
||||
},
|
||||
@@ -70140,7 +70140,7 @@
|
||||
"family": "ling-3.2-air",
|
||||
"status": "opt-in",
|
||||
"default": "",
|
||||
"note": "Ling-3.2-Air expert skip: medium = the engine's --skip-tau 0.05, faster (about +9 to 10 % on a 3090) and slightly less exact (about 1 word in 60 differs); offered only for an NVIDIA card of the 24 GB class (3090, 4090) on Linux when the plan streams experts (tier B or C); off unless asked; written into the saved run config as `--skip-tau 0.05` only when on; the desktop app's Ling panel (Models page and the model's settings) has the same choice, Expert skip Off / Medium, and writes the same pair (also on Windows; the Terminal's own offer stays as measured)",
|
||||
"note": "Ling-3.2-Air expert skip: medium = the engine's --skip-tau 0.05, faster (about +9 to 10 % on a 3090) and slightly less exact (about 1 word in 60 differs); offered on every Ling engine except the Mac's (measured: +9 to 10 % on a 3090 on Linux in tier B, +9 to 11 % on an RTX 5070 12 GB on Windows in tier C); off unless asked; written into the saved run config as `--skip-tau 0.05` only when on; the desktop app's Ling panel (Models page and the model's settings) has the same choice, Expert skip Off / Medium, and writes the same pair",
|
||||
"where": {
|
||||
"terminal/strata_cli/launch/cmd.py": "\"--expert-skip\"",
|
||||
"terminal/strata_control/ling32_fit.py": "Faster, slightly less exact",
|
||||
@@ -70153,7 +70153,7 @@
|
||||
"family": "ling-3.2-air",
|
||||
"status": "opt-in",
|
||||
"default": "",
|
||||
"note": "Ling-3.2-Air expert skip: medium = the engine's --skip-tau 0.05, faster (about +9 to 10 % on a 3090) and slightly less exact (about 1 word in 60 differs); offered only for an NVIDIA card of the 24 GB class (3090, 4090) on Linux when the plan streams experts (tier B or C); off unless asked; written into the saved run config as `--skip-tau 0.05` only when on",
|
||||
"note": "Ling-3.2-Air expert skip: medium = the engine's --skip-tau 0.05, faster (about +9 to 10 % on a 3090) and slightly less exact (about 1 word in 60 differs); offered on every Ling engine except the Mac's (measured: +9 to 10 % on a 3090 on Linux in tier B, +9 to 11 % on an RTX 5070 12 GB on Windows in tier C); off unless asked; written into the saved run config as `--skip-tau 0.05` only when on",
|
||||
"where": {
|
||||
"terminal/setup.py": "\"--expert-skip\""
|
||||
}
|
||||
|
||||
+1
-1
@@ -12729,7 +12729,7 @@ def main() -> int:
|
||||
ap.add_argument("--vram-budget-gib", type=float, metavar="N", help="Ling-3.2-Air only: use at most N GiB of the card (default: what is free)")
|
||||
ap.add_argument("--ram-budget-gib", type=float, metavar="N", help="Ling-3.2-Air only: let the engine hold at most N GiB of RAM (default: the available RAM less 6 GiB)")
|
||||
ap.add_argument("--expert-skip", choices=("off", "medium"), default=None,
|
||||
help="Ling-3.2-Air only: medium = faster, slightly less exact (about 1 word in 60 differs); offered for an NVIDIA card of the 24 GB class on Linux when the plan streams experts. Off unless asked")
|
||||
help="Ling-3.2-Air only: medium = faster, slightly less exact (about 1 word in 60 differs); offered on every Ling engine except the Mac's. Off unless asked")
|
||||
ap.add_argument("--turbo-ssd", action="store_true",
|
||||
help="Ling-3.2-Air only: faster, may change answers. In tier C the engine skips a cold expert read from the SSD once the experts in memory cover enough of the "
|
||||
"routing weight. Off unless you ask")
|
||||
|
||||
@@ -165,7 +165,7 @@ def add_parsers(sp: argparse._SubParsersAction) -> list[argparse.ArgumentParser]
|
||||
"routing weight. Off unless you ask")
|
||||
g.add_argument("--expert-skip", choices=("off", "medium"), metavar="LEVEL",
|
||||
help="Ling-3.2-Air only: medium = faster, slightly less exact (about 1 word in 60 differs): the engine leaves out an expert that carries little of a token's routing weight. "
|
||||
"Offered for an NVIDIA card of the 24 GB class (3090, 4090) on Linux when the plan streams experts (tier B or C). Off unless you ask")
|
||||
"Offered on every Ling engine except the Mac's. Off unless you ask")
|
||||
g.add_argument("--cpu-coexec", type=_parallel, metavar="N", help="Ling-3.2-Air only: N CPU threads work on the experts that are not on the card (answers stay identical; off unless you ask)")
|
||||
g.add_argument("--speed", metavar="WORD", help=argparse.SUPPRESS) # DeepSeek (no longer run): accepted, answered in plain words
|
||||
g.add_argument("--full-quality", action="store_true", help=argparse.SUPPRESS) # DeepSeek (no longer run): accepted, answered in plain words
|
||||
|
||||
@@ -179,7 +179,7 @@ class LaunchSettings:
|
||||
tier: str | None = None # Ling-3.2-Air: auto | A | B | C (None = auto: Strata chooses from video memory, RAM and disk)
|
||||
vram_budget: float | None = None # Ling-3.2-Air: GiB of the card the engine may use (None = what is free)
|
||||
ram_budget: float | None = None # Ling-3.2-Air: GiB of RAM the engine may hold (None = the available RAM less 6 GiB)
|
||||
expert_skip: str | None = None # Ling-3.2-Air expert skip: None = as installed (off), "off", "medium" (--skip-tau 0.05: faster, slightly less exact; the NVIDIA 24 GB class in tier B / C on Linux only)
|
||||
expert_skip: str | None = None # Ling-3.2-Air expert skip: None = as installed (off), "off", "medium" (--skip-tau 0.05: faster, slightly less exact; every Ling engine except the Mac's)
|
||||
turbo_ssd: bool = False # Ling-3.2-Air tier C: skip cold experts once memory covers enough of the routing weight: faster, may change answers (off unless asked)
|
||||
mtp: str | None = None # None = as installed (draft layer on); "off" starts without it (less graphics memory and RAM, slower); "on" overrides an installed "off"
|
||||
tune: str = "skip" # quick | thorough | skip
|
||||
@@ -420,17 +420,13 @@ def old_nvidia_cards(cards) -> list[dict]:
|
||||
|
||||
|
||||
def expert_skip_applies(s: LaunchSettings, comp) -> bool:
|
||||
"""Is the Ling expert skip offered on this computer for these settings (ling32_fit.expert_skip_applies: NVIDIA, Linux, the 24 GB class, a plan in tier B or C). Never raises."""
|
||||
"""Is the Ling expert skip offered on this computer for these settings (ling32_fit.expert_skip_applies: every Ling engine except the Mac's). Never raises."""
|
||||
try:
|
||||
if s.family != "ling-3.2-air" or str(getattr(comp, "engine_vendor", "") or "").lower() != "nvidia":
|
||||
if s.family != "ling-3.2-air":
|
||||
return False
|
||||
from strata_control import ling32_family, ling32_fit
|
||||
vram_gb = getattr(comp, "main_vram_gb", None) or None
|
||||
mtp_mode = ling32_fit.mtp_mode(s.mtp, default_on=ling32_family.DEFAULT_MTP, vram_gib=vram_gb, unified=False)
|
||||
adv = ling32_fit.advise(vram_gb, float(getattr(comp, "ram_gb", 0.0) or 0.0), unified=False, tier=s.tier or "auto", vram_budget_gib=s.vram_budget or 0.0, ram_budget_gib=s.ram_budget or 0.0,
|
||||
turbo_ssd=bool(s.turbo_ssd), ctx=s.context, vision=s.vision not in ("off", "no"), vision_device=s.vision if s.vision in ("gpu", "cpu") else "auto",
|
||||
mtp="auto" if mtp_mode == "auto" else mtp_mode == "on", backend="cuda", card_gib=vram_gb)
|
||||
return ling32_fit.expert_skip_applies("cuda", vram_gb, adv.get("tier"))
|
||||
from strata_control import ling32_fit
|
||||
vendor = str(getattr(comp, "engine_vendor", "") or "").lower()
|
||||
return ling32_fit.expert_skip_applies({"apple": "metal", "amd": "hip", "intel": "sycl"}.get(vendor, "cuda"))
|
||||
except Exception: # noqa: BLE001
|
||||
return False
|
||||
|
||||
@@ -492,8 +488,8 @@ def check_ling32(s: LaunchSettings, *, vram_gb: float | None, ram_gb: float | No
|
||||
from strata_control import ling32_family
|
||||
out.append(Notice("warn", f"MTP sidecar licence: {ling32_family.MTP_LICENSE['spdx']}. {ling32_family.MTP_LICENSE['attribution']}", ""))
|
||||
if s.expert_skip == "medium":
|
||||
out.append(Notice("warn", ling32_fit.EXPERT_SKIP_NOTE if ling32_fit.expert_skip_applies(engine_backend, vram_gb, adv["tier"]) else
|
||||
"--expert-skip changes nothing here: it is offered for an NVIDIA card of the 24 GB class (3090, 4090) on Linux when the plan streams experts (tier B or C).", ""))
|
||||
out.append(Notice("warn", ling32_fit.EXPERT_SKIP_NOTE if ling32_fit.expert_skip_applies(engine_backend) else
|
||||
"--expert-skip changes nothing here: the Mac's engine has no expert skip.", ""))
|
||||
if s.turbo_ssd:
|
||||
out.append(Notice("warn", ling32_fit.TURBO_SSD_NOTE if adv["tier"] == "C" else "--turbo-ssd changes nothing here: it only acts in tier C and this computer plans another tier.",
|
||||
"Take the flag away to get exact answers again."))
|
||||
|
||||
@@ -526,19 +526,17 @@ def plan(vram_gib: float | None, ram_gib: float, *, unified: bool = False, tier:
|
||||
#: top-1 agreement with the unpruned run 100 / 98-100 / 97.5-98 %, mean KL 1e-4 / 1e-3 / 1.6e-2: medium is +9 to 10 % for about 1 word in 60 different on code). Off by default; the person turns it on.
|
||||
SKIP_TAU_MEDIUM = 0.05
|
||||
EXPERT_SKIP_WORDS = ("off", "medium")
|
||||
EXPERT_SKIP_PLATFORMS = ("linux",) # measured on Linux only; Windows, HIP, SYCL and Metal are not offered until they are measured
|
||||
EXPERT_SKIP_NOTE = "Faster, slightly less exact (about 1 word in 60 differs)."
|
||||
EXPERT_SKIP_NO_ENGINE = frozenset({"metal"}) # the Mac's engine has no skip kernel (0.2.26, owner 2026-12-04: every other Ling engine is offered it, as the desktop app does)
|
||||
|
||||
|
||||
def expert_skip_applies(backend: str | None, card_gib: float | None, tier: str | None, platform: str | None = None) -> bool:
|
||||
"""Is the expert skip offered here: the NVIDIA CUDA engine on Linux, a card of the 24 GB class (CLASS_24_GIB up to CLASS_32_GIB: the 3090 and 4090), and a plan that streams experts (tier B or C; tier A gains nothing)."""
|
||||
import sys as _sys
|
||||
if str(backend or "cuda").lower() != "cuda" or not str(platform or _sys.platform).startswith(EXPERT_SKIP_PLATFORMS):
|
||||
return False
|
||||
return bool(card_gib and CLASS_24_GIB <= float(card_gib) < CLASS_32_GIB and tier in ("B", "C"))
|
||||
def expert_skip_applies(backend: str | None, card_gib: float | None = None, tier: str | None = None, platform: str | None = None) -> bool:
|
||||
"""Is the expert skip offered here: every Ling engine except the Mac's (Metal), on any card, tier and platform (measured: an RTX 3090 on Linux in tier B, +9 to 10 %; an RTX 5070 12 GB on Windows in tier C, +9 to 11 %).
|
||||
It stays opt-in and off by default. `card_gib`, `tier` and `platform` are accepted for the callers that pass them and no longer matter."""
|
||||
return str(backend or "cuda").lower() not in EXPERT_SKIP_NO_ENGINE
|
||||
|
||||
|
||||
def skip_tau_args(word: str | None, backend: str | None, card_gib: float | None, tier: str | None, platform: str | None = None) -> list[str]:
|
||||
def skip_tau_args(word: str | None, backend: str | None, card_gib: float | None = None, tier: str | None = None, platform: str | None = None) -> list[str]:
|
||||
"""`--skip-tau 0.05` when the person chose "medium" and the expert skip is offered here, else nothing."""
|
||||
if str(word or "").lower() == "medium" and expert_skip_applies(backend, card_gib, tier, platform):
|
||||
return ["--skip-tau", f"{SKIP_TAU_MEDIUM:g}"]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Ling-3.2-Air expert skip, "Medium" (0.2.25, owner decision 2026-12-03): the engine's `--skip-tau 0.05` (f-ling32-int c966eccc17: at decode and speculative-verify rows, a token's experts with a routing-weight
|
||||
share below 0.05 are dropped, the top expert kept; NOT exact; +9 to 10 % on a 3090, about 1 word in 60 different). An optional setting, off by default, offered only where it was measured: the NVIDIA CUDA engine on
|
||||
Linux, a card of the 24 GB class, a plan that streams experts (tier B or C). What these tests pin:
|
||||
* the rule (ling32_fit.expert_skip_applies / skip_tau_args) for every class of card, tier, backend and platform;
|
||||
share below 0.05 are dropped, the top expert kept; NOT exact; +9 to 10 % on a 3090, about 1 word in 60 different). An optional setting, off by default. 0.2.25 offered it only where it was measured (NVIDIA CUDA on
|
||||
Linux, the 24 GB class, tier B or C); 0.2.26 (owner 2026-12-04, the desktop app offers the same choice) offers it on every Ling engine except the Mac's (Metal), on any card, tier and platform. What these tests pin:
|
||||
* the rule (ling32_fit.expert_skip_applies / skip_tau_args) for every backend, card, tier and platform;
|
||||
* the Terminal: `--expert-skip medium` reaches the saved run config as `--skip-tau 0.05` only where it is offered; off, unset or not offered write nothing; "off" removes an earlier pair; the default rows are unchanged;
|
||||
* setup writes the same pair for the same rows; the notice says what it costs, or that it changes nothing here;
|
||||
* the saved representation is the one the app reads: the two entries in the engine args, no other key.
|
||||
@@ -39,16 +39,14 @@ def computer(vendor="nvidia", vram=23.5, ram=64.0):
|
||||
class Rule(unittest.TestCase):
|
||||
def test_where_it_is_offered(self):
|
||||
F = ling32_fit
|
||||
for card in (23.5, 24.0, 20.0, 26.9): # the 24 GB class: 3090, 4090 (23.x GiB), the edges of CLASS_24_GIB .. CLASS_32_GIB
|
||||
for tier in ("B", "C"):
|
||||
self.assertTrue(F.expert_skip_applies("cuda", card, tier, "linux"), (card, tier))
|
||||
self.assertFalse(F.expert_skip_applies("cuda", 23.5, "A", "linux")) # tier A gains nothing
|
||||
for card in (8.0, 11.95, 15.9, 19.9, 27.0, 31.4, 47.5, 96.0, None, 0):
|
||||
self.assertFalse(F.expert_skip_applies("cuda", card, "B", "linux"), card)
|
||||
for backend in ("hip", "sycl", "metal"):
|
||||
self.assertFalse(F.expert_skip_applies(backend, 23.5, "B", "linux"), backend)
|
||||
for platform in ("win32", "darwin"):
|
||||
self.assertFalse(F.expert_skip_applies("cuda", 23.5, "B", platform), platform) # measured on Linux only
|
||||
for backend in ("cuda", "hip", "sycl", None, "CUDA"): # every Ling engine but the Mac's
|
||||
for card in (8.0, 11.95, 23.5, 47.5, 96.0, None, 0):
|
||||
for tier in ("A", "B", "C", None):
|
||||
for platform in ("linux", "win32", None):
|
||||
self.assertTrue(F.expert_skip_applies(backend, card, tier, platform), (backend, card, tier, platform))
|
||||
self.assertTrue(F.expert_skip_applies("cuda")) # the card, tier and platform no longer matter
|
||||
for platform in ("linux", "win32", "darwin", None):
|
||||
self.assertFalse(F.expert_skip_applies("metal", 96.0, None, platform), platform) # the Mac's engine has no skip kernel (it is never offered, nor written)
|
||||
|
||||
def test_the_flag_and_its_level(self):
|
||||
F = ling32_fit
|
||||
@@ -57,22 +55,20 @@ class Rule(unittest.TestCase):
|
||||
self.assertEqual(F.skip_tau_args("medium", "cuda", 23.5, "B", "linux"), ["--skip-tau", "0.05"])
|
||||
for word in (None, "", "off", "light", "strong"):
|
||||
self.assertEqual(F.skip_tau_args(word, "cuda", 23.5, "B", "linux"), [], word)
|
||||
self.assertEqual(F.skip_tau_args("medium", "cuda", 15.9, "B", "linux"), [])
|
||||
self.assertIn("1 word in 60", F.EXPERT_SKIP_NOTE)
|
||||
for backend, card, tier, platform in (("cuda", 11.9, "C", "win32"), ("hip", 32.0, "A", "linux"), ("sycl", 16.0, "B", "win32"), ("cuda", None, None, None)):
|
||||
self.assertEqual(F.skip_tau_args("medium", backend, card, tier, platform), ["--skip-tau", "0.05"], (backend, card, tier, platform))
|
||||
self.assertEqual(F.skip_tau_args("medium", "metal", 96.0, None, "darwin"), [])
|
||||
self.assertIn("1 word in 60", F.EXPERT_SKIP_NOTE) # the same words about the accuracy cost as 0.2.25
|
||||
|
||||
def test_the_helper_the_launcher_uses(self):
|
||||
with mock.patch.object(ling32_fit, "EXPERT_SKIP_PLATFORMS", ("",)): # any platform: the tests run on Linux and Windows
|
||||
s = S.LaunchSettings(family="ling-3.2-air")
|
||||
self.assertTrue(S.expert_skip_applies(s, computer("nvidia", 23.5, 64.0))) # a 3090 with 64 GB: the experts stream (tier B or C)
|
||||
self.assertFalse(S.expert_skip_applies(s, computer("nvidia", 15.9, 64.0)))
|
||||
self.assertFalse(S.expert_skip_applies(s, computer("nvidia", 47.5, 128.0)))
|
||||
self.assertFalse(S.expert_skip_applies(s, computer("amd", 23.5, 64.0)))
|
||||
self.assertFalse(S.expert_skip_applies(s, computer("intel", 23.5, 64.0)))
|
||||
self.assertFalse(S.expert_skip_applies(s, computer(None, 23.5, 64.0)))
|
||||
self.assertFalse(S.expert_skip_applies(S.LaunchSettings(family="qwen"), computer()))
|
||||
self.assertFalse(S.expert_skip_applies(s, object())) # a computer record without the fields: no crash
|
||||
with mock.patch.object(ling32_fit, "EXPERT_SKIP_PLATFORMS", ("linux",)), mock.patch.object(sys, "platform", "win32"):
|
||||
self.assertFalse(S.expert_skip_applies(S.LaunchSettings(family="ling-3.2-air"), computer()))
|
||||
s = S.LaunchSettings(family="ling-3.2-air")
|
||||
for vendor, vram, ram in (("nvidia", 23.5, 64.0), ("nvidia", 15.9, 64.0), ("nvidia", 11.9, 64.0), ("nvidia", 47.5, 128.0), ("amd", 23.5, 64.0), ("intel", 16.0, 64.0), (None, 23.5, 64.0)):
|
||||
self.assertTrue(S.expert_skip_applies(s, computer(vendor, vram, ram)), (vendor, vram))
|
||||
self.assertFalse(S.expert_skip_applies(s, computer("apple", 96.0, 128.0))) # the Mac
|
||||
self.assertFalse(S.expert_skip_applies(S.LaunchSettings(family="qwen"), computer()))
|
||||
self.assertTrue(S.expert_skip_applies(s, object())) # a computer record without the fields: no crash (the CUDA default)
|
||||
with mock.patch.object(sys, "platform", "win32"):
|
||||
self.assertTrue(S.expert_skip_applies(s, computer())) # Windows too
|
||||
|
||||
|
||||
class Terminal(unittest.TestCase):
|
||||
@@ -112,11 +108,14 @@ class Terminal(unittest.TestCase):
|
||||
|
||||
def test_the_notice(self):
|
||||
s = S.LaunchSettings(family="ling-3.2-air", expert_skip="medium")
|
||||
with mock.patch.object(ling32_fit, "EXPERT_SKIP_PLATFORMS", ("",)):
|
||||
on = S.check_ling32(s, vram_gb=23.5, ram_gb=64.0, vendor="nvidia")
|
||||
off_card = S.check_ling32(s, vram_gb=15.9, ram_gb=64.0, vendor="nvidia")
|
||||
self.assertTrue(any("1 word in 60" in n.line() for n in on))
|
||||
self.assertTrue(any("--expert-skip changes nothing here" in n.line() for n in off_card))
|
||||
on = S.check_ling32(s, vram_gb=23.5, ram_gb=64.0, vendor="nvidia")
|
||||
small = S.check_ling32(s, vram_gb=11.9, ram_gb=64.0, vendor="nvidia") # a 12 GB card: offered too
|
||||
amd = S.check_ling32(s, vram_gb=24.0, ram_gb=64.0, vendor="amd")
|
||||
mac = S.check_ling32(s, vram_gb=None, ram_gb=128.0, vendor="apple", unified=True)
|
||||
for notes in (on, small, amd):
|
||||
self.assertTrue(any("1 word in 60" in n.line() for n in notes))
|
||||
self.assertFalse(any("--expert-skip changes nothing here" in n.line() for n in notes))
|
||||
self.assertTrue(any("--expert-skip changes nothing here: the Mac's engine has no expert skip" in n.line() for n in mac), [n.line() for n in mac])
|
||||
self.assertFalse(any("expert-skip" in n.line() for n in S.check_ling32(S.LaunchSettings(family="ling-3.2-air"), vram_gb=23.5, ram_gb=64.0, vendor="nvidia")))
|
||||
|
||||
|
||||
@@ -124,15 +123,18 @@ class Setup(unittest.TestCase):
|
||||
def test_setup_writes_the_same_pair(self):
|
||||
import setup
|
||||
a = argparse.Namespace(tier=None, vram_budget_gib=None, ram_budget_gib=None, turbo_ssd=False, cpu_coexec=None, expert_skip="medium")
|
||||
with mock.patch.object(ling32_fit, "EXPERT_SKIP_PLATFORMS", ("",)):
|
||||
args, adv = setup.ling32_engine_args(a, 23.0, 64.0, False, 32768, backend="cuda", card_gib=23.5)
|
||||
self.assertEqual(args[args.index("--skip-tau") + 1], "0.05")
|
||||
self.assertIn(adv["tier"], ("B", "C"))
|
||||
a.expert_skip = None
|
||||
self.assertNotIn("--skip-tau", setup.ling32_engine_args(a, 23.0, 64.0, False, 32768, backend="cuda", card_gib=23.5)[0])
|
||||
a.expert_skip = "medium"
|
||||
self.assertNotIn("--skip-tau", setup.ling32_engine_args(a, 15.0, 64.0, False, 32768, backend="cuda", card_gib=15.9)[0]) # not the 24 GB class
|
||||
self.assertNotIn("--skip-tau", setup.ling32_engine_args(a, 23.0, 64.0, False, 32768, backend="hip", card_gib=23.5)[0]) # not CUDA
|
||||
args, adv = setup.ling32_engine_args(a, 23.0, 64.0, False, 32768, backend="cuda", card_gib=23.5)
|
||||
self.assertEqual(args[args.index("--skip-tau") + 1], "0.05")
|
||||
self.assertIn(adv["tier"], ("B", "C"))
|
||||
a.expert_skip = None
|
||||
self.assertNotIn("--skip-tau", setup.ling32_engine_args(a, 23.0, 64.0, False, 32768, backend="cuda", card_gib=23.5)[0])
|
||||
a.expert_skip = "off"
|
||||
self.assertNotIn("--skip-tau", setup.ling32_engine_args(a, 23.0, 64.0, False, 32768, backend="cuda", card_gib=23.5)[0])
|
||||
a.expert_skip = "medium"
|
||||
for vram, backend in ((15.0, "cuda"), (11.0, "cuda"), (23.0, "hip"), (16.0, "sycl")): # any card and any engine but the Mac's
|
||||
args = setup.ling32_engine_args(a, vram, 64.0, False, 32768, backend=backend, card_gib=vram + 0.5)[0]
|
||||
self.assertEqual(args[args.index("--skip-tau") + 1], "0.05", (vram, backend))
|
||||
self.assertNotIn("--skip-tau", setup.ling32_engine_args(a, 96.0, 128.0, True, 32768, backend="metal", card_gib=96.0)[0]) # the Mac: no tiers, no skip
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -3,7 +3,7 @@ The app writes the choice in the form the Terminal already uses, so the two are
|
||||
* a config the app wrote for Medium (the pair in "args" and in "user_args") starts with exactly one pair, from serve's own merge (strata_control/user_args.py);
|
||||
* the Terminal reads it back unchanged (nothing set: kept), `--expert-skip off` takes the pair out of "args" AND "user_args" (or the next start would put it back), `--expert-skip medium` leaves one pair;
|
||||
* a config the Terminal wrote for Medium (the pair in "args" only) is what the app calls Medium, and the app's Off removes it;
|
||||
* Medium where the Terminal does not offer it (Windows, a card outside the 24 GB class) leaves the app's choice alone: "changes nothing here" must not turn it off;
|
||||
* Medium where the Terminal does not offer it (the Mac's engine; derive_config's expert_skip_ok False) leaves the app's choice alone: "changes nothing here" must not turn it off;
|
||||
* the default: no choice anywhere, the same args as before.
|
||||
Offline: nothing runs but Python."""
|
||||
|
||||
|
||||
Reference in new issue
Block a user