okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
f31abf7bd
main
1"""0.2.10: UD-Q4_K_XL on a Strix Halo is warned about (warn only). Remove with the stall fix.""" 2 3from __future__import annotations 4 5import tempfile 6import unittest 7from pathlib import Path 8from unittest import mock 9 10from strata_control import gpu_fit 11 12NV = {"vendor" :"nvidia" ,"name" :"NVIDIA GeForce RTX 5060" ,"vram_gb" :8.0 ,"usable" :True ,"index" :0 } 13 14 15class StrixQ4 (unittest .TestCase ): 16STRIX = {"vendor" :"amd" ,"name" :"AMD Radeon 8060S" ,"arch" :"gfx1151" ,"vram_gb" :96.0 } 17 18def test_warns_for_the_one_model_on_the_one_chip_and_never_otherwise (self ): 19note = gpu_fit .strix_q4_stall_note ("ud-q4_k_xl" , [self .STRIX ]) 20self .assertIn ("7 of 30" ,note ) 21self .assertIn ("UD-IQ4_XS" ,note ) 22self .assertIsNone (gpu_fit .strix_q4_stall_note ("UD-IQ4_XS" , [self .STRIX ])) 23self .assertIsNone (gpu_fit .strix_q4_stall_note ("UD-Q4_K_XL" , [NV ])) 24self .assertIsNone (gpu_fit .strix_q4_stall_note (None ,None )) 25 26def test_the_launch_notice (self ): 27from strata_cli .launch import cmd ,settings as S 28from tests .terminal .launch_support import HW_12 ,Home ,catalog 29with Home (): 30cat = catalog ({** HW_12 ,"gpus" : [self .STRIX ]}) 31s ,notes = cmd .apply_defaults (S .LaunchSettings (family = "qwen" ,model = "UD-Q4_K_XL" ),cat ) 32self .assertTrue ([n for n in notes if "7 of 30" in n .text ], [n .text for n in notes ]) 33self .assertTrue (all (n .level == "warn" for n in notes if "7 of 30" in n .text )) 34 35 36if __name__ == "__main__" : 37unittest .main ()