mirror of
https://github.com/Niko1221/Strata.git
synced 2026-11-07 14:21:06 -10:00
Tests for the RX 7000 DeepSeek package: each card gets its family's package, an unnamed card is not guessed, the not-tested line in the Terminal and setup
This commit is contained in:
1 parent
c14eb72d1c
commit
d12b0508a5
3 files changed
+90
No files matched your search
@@ -333,5 +333,65 @@ class HipCards(unittest.TestCase):
|
||||
self.assertEqual(dsv41_engine.package_archs(folder / EXE), ("gfx1200", "gfx1201"))
|
||||
|
||||
|
||||
class HipTwoFamilies(HipCards):
|
||||
"""The feed holds a DeepSeek package per card family on Linux AMD, as the Qwen engine does: rx9070 (gfx1200, gfx1201) and rx7900 (gfx1100, gfx1101,
|
||||
gfx1102; built, not run on a real RX 7000 card). Each card gets its own; a card nothing could name gets neither by guess."""
|
||||
# (HipCards' own tests are not repeated)
|
||||
test_a_card_nothing_could_name_gets_the_package_and_one_plain_line = None
|
||||
test_a_7900_xtx_is_told_which_cards_the_package_is_for_and_nothing_is_installed = None
|
||||
test_a_card_the_package_holds_code_for_hears_nothing_about_cards = None
|
||||
test_a_hand_installed_package_is_checked_against_the_cards_when_they_are_known = None
|
||||
test_the_package_names_its_cards = None
|
||||
|
||||
def package_of(self, variant, archs):
|
||||
src = self.root / f"src-{variant}"
|
||||
src.mkdir()
|
||||
(src / EXE).write_bytes(b"stub strata-dsv41 hip " + variant.encode())
|
||||
(src / "libamdhip64.so.7").write_bytes(b"a runtime library " * 50)
|
||||
with mock.patch("strata_control.hipblaslt_tuning.check_stage", return_value=[]):
|
||||
folder = package_engine.build(src, "hip", "0.1.55", components.host_platform(), self.root / "built", entry=EXE, archs=archs,
|
||||
build_id=f"dsv41-hip-{variant}", variant=variant)
|
||||
feed_tool.sign_package(folder, self.key)
|
||||
return folder
|
||||
|
||||
def publish_both(self):
|
||||
(self.release / "dsv41").mkdir(parents=True)
|
||||
for variant, archs in (("rx9070", ("gfx1200", "gfx1201")), ("rx7900", ("gfx1100", "gfx1101", "gfx1102"))):
|
||||
feed_tool.pack_engine(self.package_of(variant, archs), self.release / "dsv41", url_prefix="dsv41/")
|
||||
feed_tool.build_feed(self.release, key=self.key, sequence=1, dsv41_dir=self.release / "dsv41")
|
||||
|
||||
def test_each_card_gets_the_package_of_its_family(self):
|
||||
self.publish_both()
|
||||
for gfx, variant in (("gfx1100", "rx7900"), ("gfx1101", "rx7900"), ("gfx1102", "rx7900"), ("gfx1200", "rx9070"), ("gfx1201", "rx9070")):
|
||||
lines = []
|
||||
dest = self.root / f"data-{gfx}"
|
||||
exe = dsv41_engine.install(dest / "engine-dsv41", self.server.url + "/strata-feed.json", hardware=self.hw([gfx]), emit=lines.append)
|
||||
self.assertIsNotNone(exe, (gfx, lines))
|
||||
self.assertTrue(exe.parent.name.endswith("-hip-" + variant), (gfx, exe))
|
||||
self.assertEqual(dsv41_engine.package_archs(exe), {"rx7900": ("gfx1100", "gfx1101", "gfx1102"), "rx9070": ("gfx1200", "gfx1201")}[variant])
|
||||
self.assertNotIn("recognised", " ".join(lines))
|
||||
|
||||
def test_a_pc_with_a_card_of_each_family_gets_one_of_them_without_a_refusal(self):
|
||||
self.publish_both()
|
||||
lines = []
|
||||
self.assertIsNotNone(dsv41_engine.install(self.root / "data" / "engine-dsv41", self.server.url + "/strata-feed.json",
|
||||
hardware=self.hw(["gfx1100", "gfx1201"]), emit=lines.append), lines)
|
||||
|
||||
def test_a_card_nothing_could_name_is_not_guessed_when_two_families_fit(self):
|
||||
self.publish_both()
|
||||
lines = []
|
||||
self.assertIsNone(self.install([], lines))
|
||||
self.assertIn("cannot tell which AMD build", " ".join(lines))
|
||||
self.assertFalse((self.root / "data" / "engine-dsv41").exists() and any((self.root / "data" / "engine-dsv41").iterdir()))
|
||||
|
||||
def test_a_card_neither_family_covers_is_told_both(self):
|
||||
self.publish_both()
|
||||
lines = []
|
||||
self.assertIsNone(self.install(["gfx1030"], lines))
|
||||
text = " ".join(lines)
|
||||
self.assertIn("RX 7000 and RX 9000", text)
|
||||
self.assertIn("gfx1030", text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -413,6 +413,26 @@ class SetupArgs(unittest.TestCase):
|
||||
self.assertIn("--vision off", nxt)
|
||||
self.assertIn("github.com/Niko1221/Strata/issues", nxt)
|
||||
|
||||
def test_deepseek_on_an_rx_7000_card_says_once_that_it_is_untested(self):
|
||||
"""The 0.2.9 update adds a DeepSeek package for gfx1100-1102; it was built and never run on a real RX 7000 card, and the Terminal and the app say so
|
||||
the way they say it for an Arc B-series card (one warn line, how to report)."""
|
||||
from strata_cli.launch import cmd
|
||||
from strata_cli.launch.catalog import Computer
|
||||
line = "DeepSeek has not been tested on RX 7000 cards yet; please report how it runs."
|
||||
cases = (("AMD Radeon RX 7900 XTX", "gfx1100", "deepseek41", True), ("AMD Radeon RX 7800 XT", "gfx1101", "deepseek41", True),
|
||||
("AMD Radeon RX 7600", "gfx1102", "deepseek41", True), ("AMD Radeon RX 7900 XTX", "", "deepseek41", True),
|
||||
("AMD Radeon RX 7900 XTX", "gfx1100", "qwen", False), ("AMD Radeon AI PRO R9700", "gfx1201", "deepseek41", False),
|
||||
("AMD Radeon RX 6800 XT", "gfx1030", "deepseek41", False))
|
||||
for name, arch, family, expect in cases:
|
||||
card = {"index": 0, "name": name, "vendor": "amd", "vram_gb": 24.0, "usable": True, **({"arch": arch} if arch else {})}
|
||||
hw = {"ram_gb": 64.0, "os": "Linux", "cpu": {"avx2": True, "name": "x"}, "gpus": [card]}
|
||||
comp = Computer(ram_gb=64.0, gpus=hw["gpus"], disk_free_gb=500.0, os="Linux", avx2=True, raw=hw, engine_vendor="amd")
|
||||
notes = [n for n in cmd.gpu_notices(S.LaunchSettings(family=family), comp) if n.text == line]
|
||||
self.assertEqual(len(notes), 1 if expect else 0, (name, arch, family))
|
||||
if expect:
|
||||
self.assertEqual(notes[0].level, "warn")
|
||||
self.assertIn("github.com/Niko1221/Strata/issues", notes[0].next)
|
||||
|
||||
def test_a_mac_defaults_pictures_to_the_metal_reader_whatever_its_memory(self):
|
||||
for gb in (16.0, 32.0, 128.0):
|
||||
hw = {"ram_gb": gb, "os": "Darwin", "cpu": {"avx2": None, "name": "Apple M4"},
|
||||
|
||||
@@ -1263,6 +1263,16 @@ class CardGate(Install):
|
||||
self.assertEqual(rc, 0, out)
|
||||
self.assertIn("your graphics card wasn't recognised", out)
|
||||
|
||||
def test_an_rx_7000_card_with_its_package_hears_only_that_it_is_untested(self):
|
||||
(self.root / "engine").mkdir(parents=True)
|
||||
(self.root / "engine" / "BUILD.json").write_text(json.dumps({"archs": ["gfx1100", "gfx1101", "gfx1102"]}))
|
||||
for arch in ("gfx1100", "gfx1101", "gfx1102"):
|
||||
card = {**R9700, "name": "AMD Radeon RX 7900 XTX", "index": 0, "arch": arch}
|
||||
rc, out = self.install(cards=[card], model="UD-Q8_K_XL")
|
||||
self.assertEqual(rc, 0, out)
|
||||
self.assertEqual(out.count("DeepSeek has not been tested on RX 7000 cards yet; please report how it runs."), 1, arch)
|
||||
self.assertNotIn("will not start on this card", out)
|
||||
|
||||
def test_a_covered_card_hears_nothing(self):
|
||||
(self.root / "engine").mkdir(parents=True)
|
||||
(self.root / "engine" / "BUILD.json").write_text(json.dumps({"archs": ["gfx1200", "gfx1201"]}))
|
||||
|
||||
Reference in new issue
Block a user