Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10312,7 +10312,7 @@ def main() -> int:
else:
table = hipblaslt_table(gpu["arch"], lib_dirs, meta.get("hipblaslt_version"), [eng / "tuning"])
if table:
cfg["env"] = {"STRATA_HIPBLASLT_TUNING": str(table)}
cfg.setdefault("env", {})["STRATA_HIPBLASLT_TUNING"] = str(table)
if GFX1103_OPT_IN and gfx_arch_is(gpu["arch"], "gfx1103") and not WIN:
# the 780M's KFD queues are evicted (a GPU reset) while transparent huge pages move the pinned expert arena
cfg.setdefault("env", {})["STRATA_NO_ARENA_THP"] = "1"
Expand Down
16 changes: 16 additions & 0 deletions tools/test_setup_unsloth.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,22 @@ def test_amd_is_not_asked(self):
self.assertNotIn("has not been run on AMD cards yet", out)
self.assertIn("RAM budget: 40 GiB of UD-Q4_K_XL's experts", out)

def test_hip_keeps_the_env_of_an_all_ram_install(self):
"""The hipBLASLt table joined setup's env instead of replacing it: an Unsloth install whose experts all stay
in RAM lost STRATA_ROUTE_TAIL_SKIP=0, and the skip costs these files KL (docs/QUANTS.md)."""
r9700 = [{"index": 0, "name": "AMD Radeon AI PRO R9700", "vram_gb": 31.9, "arch": "gfx1201",
"driver": "amdgpu"}]
table = self.t / "tools" / "hip" / "gfx1201-hipblaslt-100401.txt"
with mock.patch.object(setup, "get_prebuilt_hip", lambda *a, **k: self.t / "engine"), \
mock.patch.object(setup, "build_engine_hip", lambda *a, **k: self.t / "engine"), \
mock.patch.object(setup, "hipblaslt_table", lambda *a, **k: table):
code, out, cfg = self.main(["--context", "8192", "--backend", "hip", "--vision", "no"],
amd=r9700, ram=95.8)
self.assertEqual(code, 0, out)
self.assertNotIn("--resident-budget-gib", cfg["args"]) # 96 GB holds every expert: no budget, the skip is off
self.assertEqual(cfg["env"]["STRATA_HIPBLASLT_TUNING"], str(table))
self.assertEqual(cfg["env"]["STRATA_ROUTE_TAIL_SKIP"], "0")

def test_resumed_download_needs_room_for_the_rest_only(self):
"""#425: the disk check counts the finished shards and .part files already there (sizes scaled down: a
2 MB "model" with 1.5 MB on the disk, 8 GB of other room needed, 8.001 GB free)."""
Expand Down
Loading