Skip to content

Commit 11d5032

Browse files
authored
am: tiny cleanups (tinygrad#8958)
* am: start cleanups * am
1 parent cfd2851 commit 11d5032

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

extra/amdpci/am_smi.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import time, mmap, sys, shutil, os, glob, subprocess
24
from tinygrad.helpers import to_mv, DEBUG, colored, ansilen
35
from tinygrad.runtime.autogen import libc

tinygrad/runtime/support/am/amdev.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def _ip_module(self, prefix:str, hwip):
376376
for ver in [version, version[:2]+[0], version[:1]+[0, 0]]:
377377
try: return __import__(f"tinygrad.runtime.autogen.am.{prefix}_{ver[0]}_{ver[1]}_{ver[2]}", fromlist=[f"{prefix}_{ver[0]}_{ver[1]}_{ver[2]}"])
378378
except ImportError: pass
379-
assert False, f"am {self.devfmt}: failed to load {prefix} module with version {version}"
379+
raise ImportError(f"am {self.devfmt}: failed to load {prefix} module with version {version}")
380380

381381
def _build_regs(self):
382382
mods = [("MP0", self._ip_module("mp", am.MP0_HWIP)), ("NBIO", self._ip_module("nbio", am.NBIO_HWIP)), ("GC", self._ip_module("gc", am.GC_HWIP)),

0 commit comments

Comments
 (0)