okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
aff3a132f
main
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 : 16key :str # file name of the golden 17title :str 18os :str # "windows" | "linux" | "macos" 19machine :str # "x86_64" | "aarch64" | "arm64" 20backend :str # engine family: cuda | hip | sycl | metal 21archs :tuple [str , ...]# what drafting.detect_hardware() answers for the cards 22card :str # the card's name as the hardware report gives it 23vendor :str # nvidia | amd | intel | apple 24vram_gb :float # the card's own memory (0 for a unified-memory chip) 25ram_gb :float 26arch_field :object = None # the "arch" of the report's card (the app reads an integer for NVIDIA, "gfx..." for AMD) 27unified :bool = False 28cards :int = 1 29 30@property 31def vram_mib (self )-> float : 32return float (int (self .vram_gb * 1024 ))if self .vram_gb else 0.0 33 34 35MACHINES :tuple [Machine , ...]= ( 36Machine ("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 ), 38Machine ("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 ), 40Machine ("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 ), 42Machine ("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 ), 44Machine ("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" ), 46Machine ("arc_a750" ,"Intel Arc A750 (SYCL)" ,"linux" ,"x86_64" ,"sycl" , ("arc_a" ,), 47"Intel(R) Arc(TM) A750 Graphics" ,"intel" ,8.0 ,32.0 ), 48Machine ("mac_small" ,"Mac M-series, small memory (16 GB)" ,"macos" ,"arm64" ,"metal" , (), 49"Apple M4" ,"apple" ,0.0 ,16.0 ,unified = True ), 50Machine ("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 : 57key :str 58family :str # setup.py's --family 59model :str # setup.py's --model 60model_name :str # the run config's model_name 61shards :tuple [str , ...] 62 63 64MODEL_SETS :tuple [ModelSet , ...]= ( 65ModelSet ("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" )), 67ModelSet ("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" )), 70ModelSet ("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 : 87return next (m for m in MACHINES if m .key == key ) 88 89 90def model_set (key :str )-> ModelSet : 91return next (s for s in MODEL_SETS if s .key == key )