From aab3810b549e7c8cea2b658ed87f2f0be020bc6f Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Fri, 16 Oct 2026 01:03:41 +0200 Subject: [PATCH] tuner: the GPU cache's 'resident experts' wording is not the low-RAM resident mode --- strata_control/tune_knobs.py | 4 ++-- strata_control/tune_session.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/strata_control/tune_knobs.py b/strata_control/tune_knobs.py index 5785f88c..b6a296dd 100644 --- a/strata_control/tune_knobs.py +++ b/strata_control/tune_knobs.py @@ -193,7 +193,7 @@ class Context: def condition_holds(name: str, ctx: Context) -> bool: f = ctx.facts return { - "resident_ram": bool(f.get("resident_ram")), + "resident_ram": bool(f.get("resident_ram")) or "--resident-experts" in ctx.base_args, "one_gpu": ctx.gpu_count <= 1, "two_gpus": ctx.gpu_count == 2, "hybrid_cpu": ctx.hybrid_cpu, @@ -214,7 +214,7 @@ def machine_classes(ctx: Context) -> list[str]: return classes if ctx.backend == "sycl": return ["G"] - if ctx.facts.get("resident_ram") or (ctx.ram_gib and ctx.model_gib and ctx.ram_gib - ctx.model_gib < 12): + if condition_holds("resident_ram", ctx) or (ctx.ram_gib and ctx.model_gib and ctx.ram_gib - ctx.model_gib < 12): classes.append("A") classes.append("B" if ctx.vram_mib >= 24000 else "C") if ctx.hybrid_cpu: diff --git a/strata_control/tune_session.py b/strata_control/tune_session.py index bef618bf..54232e4b 100644 --- a/strata_control/tune_session.py +++ b/strata_control/tune_session.py @@ -119,7 +119,8 @@ def parse_facts(text: str) -> dict[str, Any]: if "workers" not in facts and "cpu_threads" in facts: facts["workers"] = facts["cpu_threads"] low = text.lower() - facts["resident_ram"] = bool(re.search(r"resident[- ](?:ram|experts)|low-ram mode|resident ram", low)) + # the engine's low-RAM resident mode (--resident-experts) says so in its log; "resident experts" alone is the GPU cache's own wording + facts["resident_ram"] = bool(re.search(r"resident ram mode|resident complement|resident [\d.]+ gib, pinned|low-ram mode", low)) facts["hybrid_experts"] = "hybrid experts" in low or "hybrid:" in low facts["unknown_argument"] = bool(re.search(r"unknown argument|unrecognized (?:argument|option)", low)) return facts