From 14817168b638ff4359b7718d5063f714d81aa4a3 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Tue, 13 Oct 2026 02:06:01 +0200 Subject: [PATCH] One strata binary for both families: the Qwen3.6 engine path as a library strata reads the --native file's architecture at the top of main() and hands a qwen35moe model to strata::qwen35::run (src/qwen35, now the strata_qwen35 library; strata-q36 wraps the same entry point) before any Flash-Next state exists; every other file runs exactly as before. strata --families lists the architectures a build runs. The Qwen3.6 path takes strata's flag names where they mean the same (--native, --max-new, --pool-workers, --no-token-graph, --gpu, --mtp N) and skips Flash-Next-only ones in serve mode. The SYCL build keeps refusing the family, now saying CUDA and HIP run it. setup: Qwen3.6-35B-A3B is a family in the menu (OWN_PATH_FAMILIES, install_own_path): size, context, the engine (checked with --families), the pinned GGUF, its tokenizer, a config with --native/--max-context/--mtp 2 and the start script; no pack, profile, draft layer or tuning. The engine step is a function shared with the Flash-Next path. strata_inspect says the family runs on CUDA and HIP. --- CMakeLists.txt | 18 +- include/strata/artifact/model_family.hpp | 9 +- include/strata/qwen35/engine.hpp | 13 ++ setup.py | 259 +++++++++++++++++++---- src/program/generate.cpp | 29 +++ src/qwen35/q36_engine.cu | 20 +- src/qwen35/q36_main.cpp | 5 + tools/strata_inspect.py | 8 +- tools/test_setup_qwen36.py | 132 ++++++++---- tools/test_strata_inspect.py | 6 +- 10 files changed, 401 insertions(+), 98 deletions(-) create mode 100644 include/strata/qwen35/engine.hpp create mode 100644 src/qwen35/q36_main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 7332283c..f4134952 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -617,15 +617,21 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) add_executable(strata-q36ref src/qwen35/q36ref.cu) target_include_directories(strata-q36ref PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories}) target_link_libraries(strata-q36ref PRIVATE strata_kernels strata_warnings ${_strata_gpu_runtime_target}) - # the engine path for the same family (serve protocol, prompt chunks, decode graph): src/qwen35/q36_engine.cu - add_executable(strata-q36 src/qwen35/q36_engine.cu) - target_include_directories(strata-q36 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories}) - target_link_libraries(strata-q36 PRIVATE strata_prefill strata_kernels strata_warnings ${_strata_gpu_runtime_target}) + # the engine path for the same family (serve protocol, prompt chunks, decode graph): src/qwen35/q36_engine.cu, a + # library that `strata` switches to for a qwen35moe model (the family switch at the top of its main) and that + # strata-q36 wraps on its own + add_library(strata_qwen35 STATIC src/qwen35/q36_engine.cu) + target_include_directories(strata_qwen35 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(strata_qwen35 PRIVATE strata_prefill strata_kernels strata_warnings ${_strata_gpu_runtime_target}) if(STRATA_NATIVE_EXPERTS) # the hybrid mode (experts that do not all fit in VRAM): the CPU expert pool on ggml-cpu's arithmetic - target_link_libraries(strata-q36 PRIVATE strata_kernels_cpu) - target_compile_definitions(strata-q36 PRIVATE STRATA_Q36_CPU_POOL=1) + target_link_libraries(strata_qwen35 PRIVATE strata_kernels_cpu) + target_compile_definitions(strata_qwen35 PRIVATE STRATA_Q36_CPU_POOL=1) endif() + add_executable(strata-q36 src/qwen35/q36_main.cpp) + target_link_libraries(strata-q36 PRIVATE strata_qwen35 ${_strata_gpu_runtime_target}) + target_link_libraries(strata PRIVATE strata_qwen35) + target_compile_definitions(strata PRIVATE STRATA_HAVE_QWEN35=1) if(STRATA_ENABLE_HIP) enable_testing() diff --git a/include/strata/artifact/model_family.hpp b/include/strata/artifact/model_family.hpp index 9507c9d0..a1aaeec3 100644 --- a/include/strata/artifact/model_family.hpp +++ b/include/strata/artifact/model_family.hpp @@ -48,8 +48,9 @@ inline const char* model_family_title(ModelFamily f) { } } -/// Whether this engine has a path for the family. Qwen3.6 is recognised (reader, geometry, layout, setup) but -/// has no engine path yet: phase T1 of NEW-MODELS-PLAN.md adds it. +/// Whether Flash-Next's engine path runs the family. Qwen3.6 has an engine path of its own (src/qwen35), which the +/// CUDA and HIP builds of `strata` switch to at the top of main(); the Intel Arc (SYCL) build has none yet, so there +/// (and on Flash-Next's path) the family is refused with `model_family_not_supported`. inline bool model_family_runs(ModelFamily f) { return f == ModelFamily::Qwen4Exp; } /// The refusal for a recognised family the engine does not run (empty when it runs it). @@ -57,8 +58,8 @@ inline std::string model_family_not_supported(ModelFamily f) { if (model_family_runs(f)) return {}; if (f == ModelFamily::Unknown) return "this is not a model family Strata knows"; return std::string(model_family_title(f)) + " (architecture '" + model_family_arch(f) + - "') is recognised, but this engine does not run it yet - support for it is in development. " - "Use a Qwen3.8-Flash-Next model file (setup.py installs one)"; + "') runs on the NVIDIA (CUDA) and AMD (HIP) builds of Strata; this build does not run it yet (the Intel " + "Arc / SYCL port is in development). Use a CUDA or HIP build, or a Qwen3.8-Flash-Next model file"; } } // namespace strata diff --git a/include/strata/qwen35/engine.hpp b/include/strata/qwen35/engine.hpp new file mode 100644 index 00000000..89368e10 --- /dev/null +++ b/include/strata/qwen35/engine.hpp @@ -0,0 +1,13 @@ +// include/strata/qwen35/engine.hpp - the Qwen3.6-35B-A3B (GGUF architecture qwen35moe) engine path as a library: +// `strata` hands a qwen35moe model to it at the top of main() (the family switch), and strata-q36 is a thin wrapper +// around the same entry point. See src/qwen35/q36_engine.cu. +#pragma once + +namespace strata::qwen35 { + +/// The engine's command line (strata's own flag names where they mean the same thing: --native / --model, +/// --max-context, --prefill / --chunk, --serve, --mtp N, --pool-workers, --tokens, --max-new, --no-token-graph; the +/// family's own: --expert-vram, --expert-slots, --hybrid-rows, --cpu-threads). Returns the process exit code. +int run(int argc, char** argv); + +} // namespace strata::qwen35 diff --git a/setup.py b/setup.py index 79b1884f..ef5eae23 100644 --- a/setup.py +++ b/setup.py @@ -358,17 +358,19 @@ FAMILIES = { "sha256": {**UNSLOTH_SHARDS, **UNSLOTH_IQ4_XS_SHARDS, **UNSLOTH_BIG_SHARDS}}, } MMPROJ = "mmproj-Qwen3.8-Flash-Next-BF16.gguf" -# NEW-MODELS-PLAN.md T0: Qwen3.6-35B-A3B (GGUF architecture qwen35moe), Unsloth's GGUFs with the MTP block. Setup knows -# the family and downloads its files (pinned revision, size and SHA-256 checked: the Hub's LFS pointers), but this -# engine has no path for it yet and refuses the file with "not supported yet". Not in FAMILIES (the menu, the -# installed configs, the packs): only --family qwen36 reaches it (preview_family). +# Qwen3.6-35B-A3B (GGUF architecture qwen35moe), Unsloth's GGUFs with the MTP block: a family with an engine path of its +# own (src/qwen35; `strata` switches to it from the file's architecture). No pack, no expert profile, no separate MTP +# draft layer: the engine reads the GGUF as it is, keeps every expert it can in VRAM and computes the rest on the CPU +# (the hybrid mode), and drafts with the file's own MTP block. Not in FAMILIES (whose entries are Flash-Next files with +# packs): OWN_PATH_FAMILIES, offered in the same menu and installed by install_own_path. NVIDIA (CUDA) and AMD (HIP) +# only: the Intel Arc (SYCL) engine refuses it. QWEN36_FILES = { "Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf": (22853663008, "55983c5a75a1ab969824077b3bb3de4146e82a9234072b48ad4e8f92ad3fe9f1"), "Qwen3.6-35B-A3B-UD-Q6_K_XL.gguf": (32611711264, "35fce994cd36104a7dc1bd8a4bdf13778145664c00fdef6773aebc9246e5019c"), "Qwen3.6-35B-A3B-Q8_0.gguf": (37801097504, "c1283d8b80c3e38b2735ddbc9766d3b3126f44d6c484be419d4e101d09a76131"), "mmproj-F16.gguf": (899283584, "71f3cbc1f7cc0f30d09d41cfa924c0060827ebc33bf15ace7e86661e856f0160"), } -PREVIEW_FAMILIES = { +OWN_PATH_FAMILIES = { "qwen36": {"title": "Qwen3.6-35B-A3B", "by": "Qwen; GGUFs with the MTP layer by Unsloth", "arch": "qwen35moe", "about": "35B mixture of experts with 3B active (256 experts, top-8): a smaller cousin of " "Qwen3.8-Flash-Next with the same tokenizer", @@ -379,8 +381,14 @@ PREVIEW_FAMILIES = { "models": {"UD-Q4_K_XL": {"about": "4-bit (Unsloth Dynamic), the smallest", "ram_gb": 32}, "UD-Q6_K_XL": {"about": "6-bit (Unsloth Dynamic)", "ram_gb": 48}, "Q8_0": {"about": "8-bit, the closest to the full model", "ram_gb": 48}}, - "sha256": QWEN36_FILES}, + "sha256": QWEN36_FILES, + # the engine's KV cache per context token: 10 attention layers + the MTP block, 2 KV heads x 256, K and + # V in fp32 (strata-q36) + "kv_bytes_per_token": 11 * 2 * 256 * 2 * 4, + "mtp": 2, # drafts per step (greedy requests): measured best on the R9700 + "vision": False}, # the image encoder for this family is not wired up yet } +PREVIEW_FAMILIES = OWN_PATH_FAMILIES # the earlier name (tools and tests that import it) # EXPERIMENTAL, off by default (setup asks): a control vector shipped with the repository, see its README ESP_VECTOR = ROOT / "data" / "experimental-speed-projection" / "Qwen3.8-Flash-Next-experimental-speed-projection.gguf" # the image encoder on the GPU (~1.2 GB at 1024 image tokens) warms up before the engine starts, so the engine @@ -4119,10 +4127,25 @@ def previous_config(elsewhere_first: list, settings: dict): return next((c for c in sorted(cands, key=lambda p: p.stat().st_mtime, reverse=True) if readable_config(c)), None) +def own_path_config(cfg: dict) -> bool: + """A config for a family with its own engine path (Qwen3.6): its --mtp is a draft count, not a draft layer.""" + return cfg.get("arch") in {d["arch"] for d in OWN_PATH_FAMILIES.values()} + + def choices_from_config(cfg_path: Path) -> dict: """The setup answers a config was written with (family, size, context, KV, images, projection, network).""" cfg = json.loads(cfg_path.read_text(encoding="utf-8-sig")) tag = cfg_path.stem[len("strata-"):] + own = next((f for f, d in OWN_PATH_FAMILIES.items() if tag.startswith(d["tag"])), None) + if own is not None: # Qwen3.6: its own sizes; no KV / images / projection settings + d = OWN_PATH_FAMILIES[own] + size = next((m for m in d["models"] if m.lower() == tag[len(d["tag"]):].lower()), None) + a = cfg.get("args", []) + ctx = a[a.index("--max-context") + 1] if "--max-context" in a and a.index("--max-context") + 1 < len(a) else None + return {"family": own, "model": size, "context": int(ctx) if ctx and ctx.isdigit() else None, "kv": None, + "vision": "none", "esp": "off", "host": cfg.get("host"), "api_key": cfg.get("api_key"), + "port": cfg.get("port"), "gpu": cfg.get("gpu"), "layer_split": None, + "cuda": 12 if config_toolkit(cfg) == 12 else None, "vram_reserve_mib": None} family = next((f for f, d in FAMILIES.items() if d["tag"] and tag.startswith(d["tag"])), "qwen") model = (tag[len(FAMILIES[family]["tag"]):] if tag.startswith(FAMILIES[family]["tag"]) else tag).upper() if model not in MODELS: # (sizes have no dash except UD-Q4_K_XL: the old rule) @@ -4147,10 +4170,12 @@ def choices_from_config(cfg_path: Path) -> dict: def calibration_targets(have: list, model: str | None, family: str | None) -> list: """#2036: the installed configs `--calibrate --model X` (and/or --family) means; every config with neither.""" if not (model or family): - return list(have) + return [c for c in have if choices_from_config(c)["family"] not in OWN_PATH_FAMILIES] out = [] for c in have: ch = choices_from_config(c) + if ch["family"] in OWN_PATH_FAMILIES: # the tuning measures Flash-Next's engine settings + continue if (not model or ch["model"] == model) and (not family or ch["family"] == family): out.append(c) return out @@ -4379,7 +4404,7 @@ def update_install(have: list, a) -> int: update_installed_engine(a.prebuilt) for cfg_path in have: cfg = upgrade_config(cfg_path, json.loads(cfg_path.read_text(encoding="utf-8-sig"))) - if "--mtp" in cfg["args"][:-1]: + if "--mtp" in cfg["args"][:-1] and not own_path_config(cfg): refresh_draft_vocab(Path(cfg["args"][cfg["args"].index("--mtp") + 1]), cfg.get("draft_vocab", "cjk")) if cfg.get("backend") == "hip" and WIN: hip_runtime_beside_exe(Path(cfg["exe"]).parent) # #468 #461 @@ -4441,7 +4466,7 @@ def start(cfg_path: Path, port: int | None, gpu: int | list | None = None, open_ "api key" if k == "api_key" else ("the browser opens" if v else "no browser") if k == "open_browser" else f"{k.replace('_', ' ')} {v}" for k, v in keep.items())) cfg_path.touch() # the most recently used model - if "--mtp" in cfg["args"][:-1]: + if "--mtp" in cfg["args"][:-1] and not own_path_config(cfg): refresh_draft_vocab(Path(cfg["args"][cfg["args"].index("--mtp") + 1]), cfg.get("draft_vocab", "cjk")) cmd = [sys.executable, str(ROOT / "serve" / "server.py"), "--engine", "strata", "--config", str(cfg_path), "--port", str(port or cfg.get("port", 8080))] @@ -4929,6 +4954,182 @@ def sycl_setup(argv) -> int: return subprocess.call([sys.executable, str(script), *rest]) +def engine_step(a, gpu, hip, amd, cuda_tk, vision): + """Step 4: llama.cpp's sources and the engine (ready-made, or compiled here). Returns (llama, engine folder, its + BUILD.json, its library folders, the GPU (AMD on Windows: as the engine sees it), the image-encoder choice).""" + llama = get_llama_cpp() + ok(f"llama.cpp {LLAMA_CPP_COMMIT[:7]} (gguf-py, ggml, mtmd)") + if hip and WIN: # AMD on Windows: the ready-made HIP engine (no compiler) + eng = None if a.build else get_prebuilt_hip(a.prebuilt, gpu) + if eng is None: + fail("no ready-made AMD engine for this Strata version" + (" (--build)" if a.build else ""), + "compiling it on Windows: tools\\hip\\build_windows.bat makes strata-windows-x64-hip.zip, then run " + "START-HERE.bat --backend hip --prebuilt (docs/AMD_HIP.md)") + gpu = hip_card(eng, gpu, amd) + a.gpu = gpu["index"] if gpu["count"] > 1 else a.gpu + else: + eng = None if a.build or hip else get_prebuilt(a.prebuilt, gpu, vision, **({"toolkit": 12} if cuda_tk == 12 + else {})) + if eng is not None and not hip and json.loads((eng / "BUILD.json").read_text(encoding="utf-8")).get("source") != "local": + pip_cuda_libs(cuda_tk) + if vision != "none" and not (eng / VEXE).exists(): + warn("the ready-made engine has no image encoder: compiling it") + eng = None + else: + vision = prebuilt_vision(json.loads((eng / "BUILD.json").read_text(encoding="utf-8")), gpu, vision) + if eng is None: + eng = build_engine_hip(gpu, llama, vision) if hip else build_engine(gpu, vision, a.yes, llama, toolkit=cuda_tk) + meta = json.loads((eng / "BUILD.json").read_text(encoding="utf-8")) + if hip and WIN: # the ready-made engine's rocm/bin, first on the engine's PATH + lib_dirs = [str(d) for d in hip_lib_dirs(eng)] + else: + lib_dirs = meta.get("lib_dirs") or meta.get("cuda_dirs") or cuda_lib_dirs(cuda_tk) + return llama, eng, meta, lib_dirs, gpu, vision + + +def engine_families(eng: Path) -> set: + """The model families an engine runs (`strata --families`; an engine from before it: Flash-Next's only).""" + try: + text = subprocess.run([str(eng / EXE), "--families"], capture_output=True, text=True, timeout=60).stdout + except (OSError, subprocess.SubprocessError): + return {"qwen4exp"} + names = set(text.split()) + return names if "qwen4exp" in names else {"qwen4exp"} + + +def own_path_context(fam: dict, vram_gb: float) -> int: + """The recommended context for an own-path family: its KV cache (VRAM) beside the dense weights and the most-used + experts - 32K up to 16 GB, 64K up to 24 GB, 128K above.""" + return 32768 if vram_gb <= 16.5 else 65536 if vram_gb <= 24.5 else 131072 + + +def install_own_path(a, family, gpu, hip, amd, cuda_tk, multi, port, ram, adopted): + """Steps 2-7 for a family with its own engine path (OWN_PATH_FAMILIES: Qwen3.6-35B-A3B): the size, the context, the + engine, the GGUF (pinned revision, size and SHA-256), the tokenizer from the GGUF, the config and the start + script. The engine places the experts itself (every one in VRAM when they fit, else the most-used ones there and + the rest on the CPU), so there is no pack, profile or RAM budget to choose.""" + fam = OWN_PATH_FAMILIES[family] + say() + say(f" {fam['title']} - {fam['by']}: {fam['about']}") + ok(f"model: {fam['title']}") + if fam.get("license"): + say(f" Its license: {fam['license']}") + if multi: + warn(f"{fam['title']} runs on one GPU so far: using GPU {gpu.get('index', 0)} ({gpu_name(gpu)}) only") + names = list(fam["models"]) + if a.model and a.model not in names: + fail(f"{fam['title']} has no {a.model} model file", "choose one of: " + ", ".join(names)) + say() + for i, m in enumerate(names, 1): + d = fam["models"][m] + size = fam["sha256"][fam["file"].format(q=m)][0] + fit = "" if ram >= d["ram_gb"] else f" <- needs {d['ram_gb']} GB RAM, you have {ram:.0f}" + say(f" {i}) {m:10s} {d['about']}; download {size / 1e9:.1f} GB{fit}") + model = a.model or names[int(ask("Which size?", [str(i) for i in range(1, len(names) + 1)], "1", a.yes)) - 1] + if ram < fam["models"][model]["ram_gb"]: + confirm_risk(f"{model} needs about {fam['models'][model]['ram_gb']} GB of RAM; this PC has {ram:.0f} GB: the " + "OS may page and it may not start", bool(a.model), a.yes, + f"{model} needs about {fam['models'][model]['ram_gb']} GB of RAM", + f"choose a smaller size, or --model {model} --yes to install it anyway", " Install it anyway?") + warn(f"installing {model} with {ram:.0f} GB of RAM, as you chose") + ok(f"size: {model}") + tag = fam["tag"] + model + rec_ctx = own_path_context(fam, gpu.get("vram_gb", 0.0)) + if a.context: + ctx = a.context + else: + ctxs = [c for c in CONTEXTS if c <= 262144] # the model's trained length; no rope scaling on this path yet + say() + say(" Context length = how much text the model can see at once. Its cache takes " + f"{fam['kv_bytes_per_token'] * 32768 / 2**30:.1f} GB of VRAM per 32K tokens, room the experts would use:") + for i, c in enumerate(ctxs, 1): + say(f" {i}) {c // 1024}K tokens" + (" (recommended for your GPU)" if c == rec_ctx else "")) + ctx = ctxs[int(ask("Context?", [str(i) for i in range(1, len(ctxs) + 1)], str(ctxs.index(rec_ctx) + 1), + a.yes)) - 1] + if ctx > 262144: + warn(f"{ctx // 1024}K is past {fam['title']}'s trained 262,144 positions and this engine path has no rope " + "scaling yet: kept as you chose, but answers past 256K are untested") + ok(f"context: {ctx} tokens") + if a.vision not in (None, "no", "none"): + warn(f"images are not available with {fam['title']} yet: off") + if a.rope_scaling or a.rope_scale or a.kv or a.resident_budget_gib is not None or a.low_ram not in (None, "auto"): + warn(f"--rope-scaling / --kv / --resident-budget-gib / --low-ram are Flash-Next settings: {fam['title']} " + "does not use them") + folder = Path(a.gguf_dir) if a.gguf_dir else Path(a.models_dir) / tag + gguf = folder / fam["file"].format(q=model) + size = fam["sha256"][gguf.name][0] + part = gguf.with_name(gguf.name + ".part") + left = 0 if gguf.exists() and done(gguf) else (size - (part.stat().st_size if part.is_file() else 0)) / 1e9 + if left and free_gb(folder) < left + 1: + fail(f"not enough free disk space in {folder}: need ~{left + 1:.0f} GB", "use --models-dir on a bigger drive") + + step(3, "Python packages") + pip_install(requirement_lines() if REQUIREMENTS.exists() else PY_PACKAGES, + "numpy, jinja2, regex, pyyaml, tqdm, requests, cmake, ninja, pillow, psutil") + + step(4, "the Strata engine") + llama, eng, meta, lib_dirs, gpu, _ = engine_step(a, gpu, hip, amd, cuda_tk, "none") + if fam["arch"] not in engine_families(eng): + fail(f"this engine ({meta.get('version')}) does not run {fam['title']} yet", + "update Strata, or compile the engine with --build, and run setup again") + ok(f"engine: {eng / EXE}") + + step(5, f"downloading {fam['title']} {model}") + if gguf.exists() and done(gguf): + ok(f"{gguf.name} already downloaded") + else: + if a.gguf_dir: + fail(f"{gguf} is missing", f"put {gguf.name} in {folder}, or drop --gguf-dir to download it") + download(fam["hf"] + gguf.name, gguf) + verify_sha256(gguf, *fam["sha256"][gguf.name]) + ok(f"model file: {gguf}") + + step(6, "preparing the model for Strata") + data, _ = data_folder(a.data_dir) + pack = data / "packs" / tag.lower() # only the tokenizer: the engine reads the GGUF itself + if not (pack / "tokenizer" / "vocab.json").exists(): + run([sys.executable, str(ROOT / "tools" / "strata_tokenizer.py"), "--gguf", str(gguf), "--out", str(pack)], + env=dict(os.environ, STRATA_GGUF_PY=str(llama / "gguf-py"))) + ok(f"tokenizer: {pack / 'tokenizer'}") + + step(7, "writing the start script") + args = ["--native", str(gguf), "--max-context", str(ctx), "--prefill", "auto", "--mtp", str(fam["mtp"])] + if a.vram_reserve_mib is not None: # VRAM left free for other programs: the experts take that much less + vram = gpu.get("vram_gb", 0.0) + if vram > 0: + args += ["--expert-vram", f"{max(vram - 3.0 - a.vram_reserve_mib / 1024, 0):.1f}"] + ok(f"VRAM kept free for other programs: about {a.vram_reserve_mib} MiB (the experts' share is set lower)") + cfg = {"exe": str(eng / EXE), "args": args, "cwd": str(ROOT), "tokenizer": str(pack / "tokenizer"), + "model_name": f"{fam['name']}-{model.lower()}", "arch": fam["arch"], + "log": str(ROOT / f"strata-{tag.lower()}.log"), "lib_dirs": lib_dirs, "port": port} + if cuda_tk == 12: + cfg["cuda"] = 12 + if hip: + cfg["backend"] = "hip" + if gpu.get("count", 1) > 1 or a.gpu is not None: + cfg["gpu"] = gpu["index"] + cfg["gpus_asked"] = True + if a.host: + cfg["host"] = a.host + if a.api_key: + cfg["api_key"] = a.api_key + if a.browser is not None: + cfg["open_browser"] = a.browser + cfg["args"] = recommend_pool_workers(cfg["args"]) # --pool-workers: this engine path's CPU expert threads too + cfg_path = ROOT / f"strata-{tag.lower()}.json" + write_setup_config(cfg_path, cfg, adopted if adopted is not None and adopted.name == cfg_path.name else None) + script = write_run_script(tag, cfg_path, port, cfg.get("open_browser") is not False) + ok(f"start script: {script.name}") + say() + say("All set.") + say(f" API (OpenAI): http://127.0.0.1:{port}/v1 (any API key; model name: anything)") + say(f" API (Anthropic): http://127.0.0.1:{port}/v1/messages") + say(f" Next time: just run {'START-HERE.bat' if WIN else './setup.sh'} (or {script.name}) - it starts right away") + if a.no_start: + return 0 + return start(cfg_path, port) + + def preview_family(a) -> int: """--family qwen36: a family setup knows but the engine does not run yet (PREVIEW_FAMILIES). Downloads the chosen size (pinned revision, size and SHA-256 checked) and, with --vision, the image encoder - and says plainly that @@ -5108,8 +5309,6 @@ def main() -> int: roots = [data, *elsewhere] if a.models_dir is None: a.models_dir = str(data / "models") - if a.family in PREVIEW_FAMILIES: # a family the engine does not run yet: its files only - return preview_family(a) if a.rollback_engine: # #670 return rollback_engine(12 if a.cuda == "12" else 13) @@ -5387,8 +5586,14 @@ def main() -> int: d = FAMILIES[f] say(f" {i}) {d['title']:20s} {d['by']} - {d['about']}" + (" [experimental]" if d.get("experimental") else "") + (f" (recommended for Strix Halo: {STRIX_HALO_MODEL})" if f == rec_fam and rec_fam != fams[0] else "")) - family = fams[int(ask("Which model?", [str(i) for i in range(1, len(fams) + 1)], - str(fams.index(rec_fam) + 1), a.yes)) - 1] + for j, f in enumerate(OWN_PATH_FAMILIES, len(fams) + 1): # families with an engine path of their own + d = OWN_PATH_FAMILIES[f] + say(f" {j}) {d['title']:20s} {d['by']} - {d['about']} [new]") + allf = fams + list(OWN_PATH_FAMILIES) + family = allf[int(ask("Which model?", [str(i) for i in range(1, len(allf) + 1)], + str(allf.index(rec_fam) + 1), a.yes)) - 1] + if family in OWN_PATH_FAMILIES: # Qwen3.6: its own engine path, its own steps 2-7 + return install_own_path(a, family, gpu, hip, amd, cuda_tk, multi, port, ram, adopted) fam = FAMILIES[family] ok(f"model: {fam['title']}") if fam.get("license"): @@ -5660,33 +5865,7 @@ def main() -> int: # ---- 4. the engine step(4, "the Strata engine") - llama = get_llama_cpp() - ok(f"llama.cpp {LLAMA_CPP_COMMIT[:7]} (gguf-py, ggml, mtmd)") - if hip and WIN: # AMD on Windows: the ready-made HIP engine (no compiler) - eng = None if a.build else get_prebuilt_hip(a.prebuilt, gpu) - if eng is None: - fail("no ready-made AMD engine for this Strata version" + (" (--build)" if a.build else ""), - "compiling it on Windows: tools\\hip\\build_windows.bat makes strata-windows-x64-hip.zip, then run " - "START-HERE.bat --backend hip --prebuilt (docs/AMD_HIP.md)") - gpu = hip_card(eng, gpu, amd) - a.gpu = gpu["index"] if gpu["count"] > 1 else a.gpu - else: - eng = None if a.build or hip else get_prebuilt(a.prebuilt, gpu, vision, **({"toolkit": 12} if cuda_tk == 12 - else {})) - if eng is not None and not hip and json.loads((eng / "BUILD.json").read_text(encoding="utf-8")).get("source") != "local": - pip_cuda_libs(cuda_tk) - if vision != "none" and not (eng / VEXE).exists(): - warn("the ready-made engine has no image encoder: compiling it") - eng = None - else: - vision = prebuilt_vision(json.loads((eng / "BUILD.json").read_text(encoding="utf-8")), gpu, vision) - if eng is None: - eng = build_engine_hip(gpu, llama, vision) if hip else build_engine(gpu, vision, a.yes, llama, toolkit=cuda_tk) - meta = json.loads((eng / "BUILD.json").read_text(encoding="utf-8")) - if hip and WIN: # the ready-made engine's rocm/bin, first on the engine's PATH - lib_dirs = [str(d) for d in hip_lib_dirs(eng)] - else: - lib_dirs = meta.get("lib_dirs") or meta.get("cuda_dirs") or cuda_lib_dirs(cuda_tk) + llama, eng, meta, lib_dirs, gpu, vision = engine_step(a, gpu, hip, amd, cuda_tk, vision) engine_ver = tuple(int(x) for x in str(meta.get("version", "0")).split(".")[:4] if x.isdigit()) need_engine = MODELS[model].get("engine", UNSLOTH_ENGINE) # checked before the 94-188 GB download diff --git a/src/program/generate.cpp b/src/program/generate.cpp index 2d2290a0..5ed10cf0 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -88,6 +88,9 @@ #endif #include "strata/artifact/gguf_reader.hpp" #include "strata/core/family_layout.hpp" +#if defined(STRATA_HAVE_QWEN35) +#include "strata/qwen35/engine.hpp" +#endif #if defined(_WIN32) #include #include @@ -1791,6 +1794,15 @@ int main(int argc, char** argv) { std::printf("strata %s\n", STRATA_VERSION); return 0; } + // `strata --families`: the GGUF architectures this build runs (setup asks before it installs one) + if (std::strcmp(argv[i], "--families") == 0) { +#if defined(STRATA_HAVE_QWEN35) + std::printf("qwen4exp qwen35moe\n"); +#else + std::printf("qwen4exp\n"); +#endif + return 0; + } } #if (defined(STRATA_USE_HIP) || defined(STRATA_HIP_GFX906)) && !defined(_WIN32) // AMD, a file-backed arena (STRATA_ARENA_MMAP): ROCclr copies a pageable source of 1 MiB or more by locking its @@ -1838,6 +1850,23 @@ int main(int argc, char** argv) { #endif break; } +#if defined(STRATA_HAVE_QWEN35) + // **THE FAMILY SWITCH.** A Qwen3.6-35B-A3B file (GGUF architecture qwen35moe) runs on its own engine path + // (src/qwen35), decided here from the file's header before any of this engine's state exists; every other file + // goes on below exactly as before. Only the architecture string is read (the header of --native's shard). + for (int i = 1; i + 1 < argc; ++i) { + if (std::strcmp(argv[i], "--native") != 0 && std::strcmp(argv[i], "--model") != 0) continue; + bool qwen35 = false; + try { + const strata::GgufFile meta(strata::gguf_split_paths(argv[i + 1]).front()); + qwen35 = strata::model_family(meta) == strata::ModelFamily::Qwen35Moe; + } catch (const std::exception&) { + // not readable here: the normal path below reports it + } + if (qwen35) return strata::qwen35::run(argc, argv); + break; + } +#endif Options o; bool have_tokens = false; bool have_logits_stride = false; diff --git a/src/qwen35/q36_engine.cu b/src/qwen35/q36_engine.cu index 61154944..00035e7a 100644 --- a/src/qwen35/q36_engine.cu +++ b/src/qwen35/q36_engine.cu @@ -25,6 +25,7 @@ #include "strata/kernels/native_router.hpp" #include "strata/prefill/gemm.hpp" #include "strata/prefill/moe_mmq.hpp" +#include "strata/qwen35/engine.hpp" #if defined(STRATA_Q36_CPU_POOL) #include "strata/kernels/cpu/native_expert.hpp" #include "strata/kernels/cpu/pool.hpp" @@ -35,6 +36,7 @@ #include #include +#include #include #include #include @@ -2041,7 +2043,7 @@ int serve(Engine& E) { } // namespace -int main(int argc, char** argv) { +int strata::qwen35::run(int argc, char** argv) { std::string model, tokens, force, dump_full; int ctx = 32768, chunk = 0, n_gen = 64, bench_pp = 0, bench_tg = 0, mtp_d = 0, cpu_threads = 0, hybrid_rows = 128; double expert_vram = -1.0; @@ -2053,7 +2055,13 @@ int main(int argc, char** argv) { if (i + 1 >= argc) { std::fprintf(stderr, "strata-q36: %s needs a value\n", a.c_str()); std::exit(2); } return argv[++i]; }; + // strata's names where they mean the same thing (the family switch passes strata's command line on) if (a == "--model" || a == "--native") model = next(); + else if (a == "--max-new") n_gen = std::atoi(next().c_str()); + else if (a == "--no-token-graph") graph = false; + else if (a == "--pool-workers") cpu_threads = std::atoi(next().c_str()); + else if (a == "--gpu") (void) next(); // applied by strata before the switch (CUDA/HIP_VISIBLE_DEVICES) + else if (a == "--greedy") {} // --tokens decodes greedily here anyway else if (a == "--serve") serve_mode = true; else if (a == "--max-context" || a == "--ctx") ctx = std::atoi(next().c_str()); else if (a == "--chunk" || a == "--prefill") { const std::string v = next(); chunk = v == "auto" ? 0 : std::atoi(v.c_str()); } @@ -2064,7 +2072,13 @@ int main(int argc, char** argv) { else if (a == "--bench-pp") bench_pp = std::atoi(next().c_str()); else if (a == "--bench-tg") bench_tg = std::atoi(next().c_str()); else if (a == "--no-graph") graph = false; - else if (a == "--mtp") mtp_d = std::atoi(next().c_str()); + else if (a == "--mtp") { + // a number of drafts; Flash-Next's "--mtp " means nothing for this family + const std::string v = next(); + if (!v.empty() && std::isdigit((unsigned char) v[0])) mtp_d = std::atoi(v.c_str()); + else std::fprintf(stderr, "strata-q36: ignoring --mtp %s (this family's MTP is the GGUF's own block: --mtp N " + "drafts)\n", v.c_str()); + } else if (a == "--expert-vram") expert_vram = std::atof(next().c_str()); // GiB for the routed experts else if (a == "--cpu-threads") cpu_threads = std::atoi(next().c_str()); else if (a == "--expert-slots") expert_slots = std::atoi(next().c_str()); @@ -2086,10 +2100,12 @@ int main(int argc, char** argv) { } if (model.empty()) { std::fprintf(stderr, "strata-q36: --model is required\n"); return 2; } #if !defined(_WIN32) + setenv("CUDA_MODULE_LOADING", "EAGER", 0); // every kernel loaded with the context, not in the first prompt setenv("STRATA_Q8_PACKED", "1", 0); // the packed Q8_0 decode copy unless STRATA_Q8_PACKED is set otherwise setenv("STRATA_MMQ_KQ", "1", 0); // the K-quant MMQ prompt kernels (every expert of this family is a K-quant) #else if (std::getenv("STRATA_MMQ_KQ") == nullptr) _putenv_s("STRATA_MMQ_KQ", "1"); + if (std::getenv("CUDA_MODULE_LOADING") == nullptr) _putenv_s("CUDA_MODULE_LOADING", "EAGER"); #endif if (mtp_d < 0 || mtp_d > 7) { std::fprintf(stderr, "strata-q36: --mtp takes 0 .. 7 drafts\n"); return 2; } if (chunk < 0 || chunk > 4096 || ctx < 256) { std::fprintf(stderr, "strata-q36: bad --chunk / --max-context\n"); return 2; } diff --git a/src/qwen35/q36_main.cpp b/src/qwen35/q36_main.cpp new file mode 100644 index 00000000..63d009f8 --- /dev/null +++ b/src/qwen35/q36_main.cpp @@ -0,0 +1,5 @@ +// src/qwen35/q36_main.cpp - strata-q36: the Qwen3.6 engine path on its own (the same entry point `strata` switches +// to for a qwen35moe model). +#include "strata/qwen35/engine.hpp" + +int main(int argc, char** argv) { return strata::qwen35::run(argc, argv); } diff --git a/tools/strata_inspect.py b/tools/strata_inspect.py index d4af5e9f..5d094d80 100644 --- a/tools/strata_inspect.py +++ b/tools/strata_inspect.py @@ -89,13 +89,15 @@ def load_fingerprints(path: Path = FINGERPRINTS) -> dict: def verdict(fp: dict, table: dict) -> tuple[str, str]: - """(kind, sentence): kind is "known" (a file setup installs, under any name), "layout" (the same routed-expert + """(kind, sentence): kind is "known" (a file setup installs, under any name), "family" (another family Strata + runs on its own engine path: Qwen3.6), "layout" (the same routed-expert layout as one: a fine-tune made with the same recipe, untested), "no" (Strata cannot run it) or "untested" (naming the tensors whose quantization no file Strata runs has for them).""" known = {k: v for k, v in table.items() if not k.startswith("_")} if fp["arch"] in PREVIEW_ARCHS: - return "no", (f"{PREVIEW_ARCHS[fp['arch']]} (architecture {fp['arch']!r}): Strata recognises it, but this " - "version does not run it yet (support is in development)") + return "family", (f"{PREVIEW_ARCHS[fp['arch']]} (architecture {fp['arch']!r}): Strata runs it on its own " + "engine path in the NVIDIA (CUDA) and AMD (HIP) builds, not yet on Intel Arc (SYCL); setup " + "installs it with --family qwen36") if fp["arch"] != ARCH: return "no", f"not Qwen3.8-Flash-Next (architecture {fp['arch']!r}): Strata runs only that model" exact = [k for k, v in known.items() if v["expert_bytes"] == fp["expert_bytes"] and v["bytes"] == fp["bytes"] diff --git a/tools/test_setup_qwen36.py b/tools/test_setup_qwen36.py index adb67f82..60491325 100644 --- a/tools/test_setup_qwen36.py +++ b/tools/test_setup_qwen36.py @@ -1,5 +1,7 @@ -"""Tests for setup.py's Qwen3.6-35B-A3B entries (NEW-MODELS-PLAN.md T0): a family setup knows and downloads (pinned -revision, size and SHA-256), which the engine does not run yet. Mocked downloads - nothing is fetched. +"""Tests for setup.py's Qwen3.6-35B-A3B install (a family with its own engine path: OWN_PATH_FAMILIES): the pinned and +hashed files, the menu entry, steps 2-7 of install_own_path (size, context, the engine's --families check, the +download, the tokenizer, the config) and reading such a config back. Mocked engine, downloads and processes - +nothing is built, fetched or started. python -m unittest tools.test_setup_qwen36 """ @@ -8,6 +10,7 @@ from __future__ import annotations import argparse import contextlib import io +import json import re import sys import tempfile @@ -25,7 +28,9 @@ REPO = "unsloth/Qwen3.6-35B-A3B-MTP-GGUF" def args(**kw): - base = dict(family="qwen36", model=None, check=False, yes=True, vision=None, models_dir=None) + base = dict(family="qwen36", model=None, check=False, yes=True, vision=None, models_dir=None, gguf_dir=None, + context=None, rope_scaling=None, rope_scale=None, kv=None, resident_budget_gib=None, low_ram="auto", + vram_reserve_mib=None, host=None, api_key=None, browser=None, no_start=True, data_dir=None, gpu=None) base.update(kw) return argparse.Namespace(**base) @@ -41,7 +46,8 @@ def run(fn, *a, **kw): class Qwen36Entries(unittest.TestCase): def test_pinned_and_hashed(self): - fam = setup.PREVIEW_FAMILIES["qwen36"] + fam = setup.OWN_PATH_FAMILIES["qwen36"] + self.assertIs(setup.PREVIEW_FAMILIES, setup.OWN_PATH_FAMILIES) # the earlier name still works self.assertEqual(setup.HF_REVISIONS[REPO], "5bc3e238d916f48a861bac2f8a1990a0e9b7e98d") for key in ("hf", "mmproj_hf"): self.assertRegex(fam[key], SHA) @@ -53,71 +59,117 @@ class Qwen36Entries(unittest.TestCase): self.assertGreater(size, 20e9) self.assertRegex(sha, r"^[0-9a-f]{64}$") self.assertEqual(fam["sha256"]["Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf"][0], 22853663008) - self.assertIn(fam["mmproj"], fam["sha256"]) - def test_not_a_regular_family(self): - # the menu, the installed configs and the packs never see it: it is not in FAMILIES + def test_not_a_pack_family(self): + # FAMILIES are Flash-Next files with packs; Qwen3.6 is installed by install_own_path self.assertNotIn("qwen36", setup.FAMILIES) for m, d in setup.MODELS.items(): self.assertNotIn("qwen36", d.get("families", ())) + def test_context_recommendation(self): + fam = setup.OWN_PATH_FAMILIES["qwen36"] + self.assertEqual(setup.own_path_context(fam, 12.0), 32768) + self.assertEqual(setup.own_path_context(fam, 16.0), 32768) + self.assertEqual(setup.own_path_context(fam, 24.0), 65536) + self.assertEqual(setup.own_path_context(fam, 32.0), 131072) -class PreviewFamily(unittest.TestCase): + +class InstallOwnPath(unittest.TestCase): def setUp(self): self.tmp = tempfile.TemporaryDirectory() self.addCleanup(self.tmp.cleanup) + self.root = Path(self.tmp.name) self.calls = [] + self.families = {"qwen4exp", "qwen35moe"} + eng = self.root / "engine" + self.cfg = {} + + def engine_step(a, gpu, hip, amd, cuda_tk, vision): + self.calls.append(("engine", vision)) + return self.root / "llama", eng, {"version": "0.1.44"}, ["/libs"], gpu, vision + + def write_cfg(path, cfg, source=None): + self.cfg = cfg + self.calls.append(("config", path.name)) + patches = [mock.patch.object(setup, "download", lambda url, dst, what=None: self.calls.append(("get", url, dst))), - mock.patch.object(setup, "verify_sha256", lambda s, size, sha: self.calls.append(("sha", s.name, size, sha))), - mock.patch.object(setup, "ram_gb", lambda: 64.0), - mock.patch.object(setup, "free_gb", lambda p: 500.0)] + mock.patch.object(setup, "verify_sha256", lambda s, size, sha: self.calls.append(("sha", s.name))), + mock.patch.object(setup, "free_gb", lambda p: 500.0), + mock.patch.object(setup, "pip_install", lambda *a, **k: None), + mock.patch.object(setup, "engine_step", engine_step), + mock.patch.object(setup, "engine_families", lambda e: self.families), + mock.patch.object(setup, "run", lambda cmd, **k: self.calls.append(("run", cmd))), + mock.patch.object(setup, "data_folder", lambda d: (self.root / "data", [])), + mock.patch.object(setup, "write_setup_config", write_cfg), + mock.patch.object(setup, "write_run_script", lambda tag, p, port, o=True: self.root / f"run-{tag}.sh"), + mock.patch.object(setup, "recommend_pool_workers", lambda a: a), + mock.patch.object(setup, "ROOT", self.root)] for p in patches: p.start() self.addCleanup(p.stop) - def test_downloads_the_pinned_file_and_checks_it(self): - rc, out = run(setup.preview_family, args(model="UD-Q4_K_XL", models_dir=self.tmp.name)) - self.assertEqual(rc, 0) + def install(self, ram=64.0, vram=16.0, **kw): + gpu = {"index": 0, "count": 1, "vram_gb": vram, "name": "Test GPU"} + return run(setup.install_own_path, args(models_dir=str(self.root / "models"), **kw), "qwen36", gpu, False, [], + 13, [], 8080, ram, None) + + def test_installs_the_pinned_file_and_writes_the_config(self): + rc, out = self.install(model="UD-Q4_K_XL") + self.assertEqual(rc, 0, out) get = [c for c in self.calls if c[0] == "get"] self.assertEqual(len(get), 1) - self.assertEqual(get[0][1], setup.hf(REPO) + "Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf") - self.assertEqual(get[0][2], Path(self.tmp.name) / "qwen36-UD-Q4_K_XL" / "Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf") - self.assertIn(("sha", "Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf", 22853663008, - "55983c5a75a1ab969824077b3bb3de4146e82a9234072b48ad4e8f92ad3fe9f1"), self.calls) - self.assertIn("cannot run it yet", out) + gguf = self.root / "models" / "qwen36-UD-Q4_K_XL" / "Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf" + self.assertEqual(get[0][1], setup.hf(REPO) + gguf.name) + self.assertEqual(get[0][2], gguf) + self.assertIn(("sha", gguf.name), self.calls) + self.assertIn(("engine", "none"), self.calls) # no image encoder for this family yet + tok = [c for c in self.calls if c[0] == "run"] + self.assertTrue(tok and "strata_tokenizer.py" in str(tok[0][1])) + a = self.cfg["args"] + self.assertEqual(a[a.index("--native") + 1], str(gguf)) + self.assertEqual(a[a.index("--max-context") + 1], "32768") # 16 GB card + self.assertEqual(a[a.index("--mtp") + 1], "2") + self.assertNotIn("--pack", a) + self.assertNotIn("--expert-cache", a) + self.assertEqual(self.cfg["arch"], "qwen35moe") + self.assertEqual(self.cfg["model_name"], "qwen3.6-35b-a3b-ud-q4_k_xl") + self.assertEqual(Path(self.cfg["exe"]).parent, self.root / "engine") + self.assertIn(("config", "strata-qwen36-ud-q4_k_xl.json"), self.calls) + + def test_an_engine_without_the_family_is_refused_before_the_download(self): + self.families = {"qwen4exp"} + rc, out = self.install(model="UD-Q4_K_XL") + self.assertEqual(rc, 1) self.assertIn("does not run Qwen3.6-35B-A3B yet", out) - - def test_vision_adds_the_encoder(self): - rc, _ = run(setup.preview_family, args(model="Q8_0", vision="yes", models_dir=self.tmp.name)) - self.assertEqual(rc, 0) - names = [c[2].name for c in self.calls if c[0] == "get"] - self.assertEqual(names, ["Qwen3.6-35B-A3B-Q8_0.gguf", "mmproj-F16.gguf"]) - - def test_check_lists_without_downloading(self): - rc, out = run(setup.preview_family, args(check=True, models_dir=self.tmp.name)) - self.assertEqual(rc, 0) - self.assertEqual(self.calls, []) - self.assertIn("UD-Q6_K_XL", out) - self.assertIn("32.6 GB", out) + self.assertEqual([c for c in self.calls if c[0] == "get"], []) def test_a_flash_next_size_is_refused(self): - rc, out = run(setup.preview_family, args(model="IQ3_XXS", models_dir=self.tmp.name)) + rc, out = self.install(model="IQ3_XXS") self.assertEqual(rc, 1) self.assertIn("has no IQ3_XXS", out) self.assertEqual(self.calls, []) def test_too_little_disk(self): with mock.patch.object(setup, "free_gb", lambda p: 10.0): - rc, out = run(setup.preview_family, args(model="Q8_0", models_dir=self.tmp.name)) + rc, out = self.install(model="Q8_0") self.assertEqual(rc, 1) self.assertIn("not enough free disk space", out) - def test_a_qwen36_size_without_the_family(self): - err = io.StringIO() - with mock.patch.object(sys, "argv", ["setup.py", "--model", "Q8_0"]), contextlib.redirect_stderr(err): - rc, _ = run(setup.main) - self.assertEqual(rc, 2) - self.assertIn("--family qwen36", err.getvalue()) + def test_bigger_card_bigger_context_and_vision_said_off(self): + rc, out = self.install(model="UD-Q4_K_XL", vram=32.0, vision="yes") + self.assertEqual(rc, 0, out) + a = self.cfg["args"] + self.assertEqual(a[a.index("--max-context") + 1], "131072") + self.assertIn("images are not available", out) + + def test_config_read_back(self): + self.install(model="UD-Q6_K_XL", context=65536) + p = self.root / "strata-qwen36-ud-q6_k_xl.json" + p.write_text(json.dumps(self.cfg), encoding="utf-8") + ch = setup.choices_from_config(p) + self.assertEqual((ch["family"], ch["model"], ch["context"]), ("qwen36", "UD-Q6_K_XL", 65536)) + self.assertTrue(setup.own_path_config(self.cfg)) + self.assertEqual(setup.calibration_targets([p], None, None), []) # the tuning is Flash-Next's if __name__ == "__main__": diff --git a/tools/test_strata_inspect.py b/tools/test_strata_inspect.py index 39b76947..247e46de 100644 --- a/tools/test_strata_inspect.py +++ b/tools/test_strata_inspect.py @@ -42,13 +42,13 @@ class Verdict(unittest.TestCase): fp["arch"] = "qwen3moe" self.assertEqual(SI.verdict(fp, self.table)[0], "no") - def test_qwen36_is_recognised_not_run_yet(self): + def test_qwen36_runs_on_its_own_path(self): fp = self.fp("qwen/Q2_0") fp["arch"] = "qwen35moe" kind, sentence = SI.verdict(fp, self.table) - self.assertEqual(kind, "no") + self.assertEqual(kind, "family") self.assertIn("Qwen3.6-35B-A3B", sentence) - self.assertIn("does not run it yet", sentence) + self.assertIn("--family qwen36", sentence) def test_expert_type_without_kernel(self): fp = self.fp("qwen/IQ3_S")