okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-ds-out ac306afb2 into f-own-intaff3a132f

main
4.5 KiB91 linesraw
1"""The matrix of the config snapshot: simulated computers, model sets, entry points.
2
3Nothing here touches hardware.  A machine class is a table of what the probes would answer (the same answers the unit tests mock one by one),
4a model set is the names setup.py and the catalog give it.  Add a class or a set here and the golden files get a new row; nothing else changes.
5"""
6
7from __future__ import annotations
8
9from dataclasses import dataclass, field
10
11GIB = 1 << 30
12
13
14@dataclass(frozen=True)
15class Machine:
16    key: str                      # file name of the golden
17    title: str
18    os: str                       # "windows" | "linux" | "macos"
19    machine: str                  # "x86_64" | "aarch64" | "arm64"
20    backend: str                  # engine family: cuda | hip | sycl | metal
21    archs: tuple[str, ...]        # what drafting.detect_hardware() answers for the cards
22    card: str                     # the card's name as the hardware report gives it
23    vendor: str                   # nvidia | amd | intel | apple
24    vram_gb: float                # the card's own memory (0 for a unified-memory chip)
25    ram_gb: float
26    arch_field: object = None     # the "arch" of the report's card (the app reads an integer for NVIDIA, "gfx..." for AMD)
27    unified: bool = False
28    cards: int = 1
29
30    @property
31    def vram_mib(self) -> float:
32        return float(int(self.vram_gb * 1024)) if self.vram_gb else 0.0
33
34
35MACHINES: tuple[Machine, ...] = (
36    Machine("nv_resident", "NVIDIA all-resident (RTX PRO 5000 class, 72 GB)", "linux", "x86_64", "cuda", ("sm_120",),
37            "NVIDIA RTX PRO 5000 Blackwell", "nvidia", 72.0, 256.0, arch_field=120),
38    Machine("nv_12gb_streaming", "NVIDIA 12 GB streaming (RTX 3060)", "linux", "x86_64", "cuda", ("sm_86",),
39            "NVIDIA GeForce RTX 3060", "nvidia", 12.0, 64.0, arch_field=86),
40    Machine("dgx_spark", "DGX Spark (linux-aarch64, GB10)", "linux", "aarch64", "cuda", ("sm_121",),
41            "NVIDIA GB10", "nvidia", 0.0, 128.0, arch_field=121, unified=True),
42    Machine("strix_halo_win", "Strix Halo Windows (gfx1151)", "windows", "x86_64", "hip", ("gfx1151",),
43            "AMD Radeon(TM) 8060S Graphics", "amd", 0.0, 128.0, arch_field="gfx1151", unified=True),
44    Machine("r9700_linux", "Radeon AI PRO R9700 (gfx1201, Linux)", "linux", "x86_64", "hip", ("gfx1201",),
45            "AMD Radeon AI PRO R9700", "amd", 32.0, 128.0, arch_field="gfx1201"),
46    Machine("arc_a750", "Intel Arc A750 (SYCL)", "linux", "x86_64", "sycl", ("arc_a",),
47            "Intel(R) Arc(TM) A750 Graphics", "intel", 8.0, 32.0),
48    Machine("mac_small", "Mac M-series, small memory (16 GB)", "macos", "arm64", "metal", (),
49            "Apple M4", "apple", 0.0, 16.0, unified=True),
50    Machine("mac_large", "Mac M-series, large memory (128 GB)", "macos", "arm64", "metal", (),
51            "Apple M4 Max", "apple", 0.0, 128.0, unified=True),
52)
53
54
55@dataclass(frozen=True)
56class ModelSet:
57    key: str
58    family: str                   # setup.py's --family
59    model: str                    # setup.py's --model
60    model_name: str               # the run config's model_name
61    shards: tuple[str, ...]
62
63
64MODEL_SETS: tuple[ModelSet, ...] = (
65    ModelSet("iq3_s", "qwen", "IQ3_S", "qwen3.8-flash-next-iq3_s",
66             ("Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf", "Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf")),
67    ModelSet("ud_q4_k_xl", "unsloth", "UD-Q4_K_XL", "qwen3.8-flash-next-unsloth-ud-q4_k_xl",
68             ("Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00003.gguf", "Qwen3.8-Flash-Next-UD-Q4_K_XL-00002-of-00003.gguf",
69              "Qwen3.8-Flash-Next-UD-Q4_K_XL-00003-of-00003.gguf")),
70    ModelSet("ud_iq4_xs_v31", "unsloth", "UD-IQ4_XS-v31", "qwen3.8-flash-next-unsloth-ud-iq4_xs-v31",
71             ("Qwen3.8-Flash-Next-UD-IQ4_XS-00001-of-00004.gguf", "Qwen3.8-Flash-Next-UD-IQ4_XS-00002-of-00004.gguf",
72              "Qwen3.8-Flash-Next-UD-IQ4_XS-00003-of-00004.gguf", "Qwen3.8-Flash-Next-UD-IQ4_XS-00004-of-00004.gguf")),
73)
74
75#: setup is listed so the table has its row; see driver.drive_setup for why it is not driven today.
76ENTRY_POINTS = ("setup", "launch", "app_plain", "app_models")
77
78ENTRY_TITLES = {
79    "setup": "strata setup / setup.py config generation",
80    "launch": "strata launch (Terminal)",
81    "app_plain": "the app's plain Load (no Drafting choice)",
82    "app_models": "the app's Models-screen Load (Drafting: Auto)",
83}
84
85
86def machine(key: str) -> Machine:
87    return next(m for m in MACHINES if m.key == key)
88
89
90def model_set(key: str) -> ModelSet:
91    return next(s for s in MODEL_SETS if s.key == key)