am: tiny cleanups (#8958)

* am: start cleanups

* am
This commit is contained in:
nimlgen
2025-02-07 23:44:43 +03:00
committed by GitHub
parent cfd28517df
commit 11d50324d8
2 changed files with 3 additions and 1 deletions

2
extra/amdpci/am_smi.py Normal file → Executable file
View File

@@ -1,3 +1,5 @@
#!/usr/bin/env python3
import time, mmap, sys, shutil, os, glob, subprocess
from tinygrad.helpers import to_mv, DEBUG, colored, ansilen
from tinygrad.runtime.autogen import libc

View File

@@ -376,7 +376,7 @@ class AMDev:
for ver in [version, version[:2]+[0], version[:1]+[0, 0]]:
try: return __import__(f"tinygrad.runtime.autogen.am.{prefix}_{ver[0]}_{ver[1]}_{ver[2]}", fromlist=[f"{prefix}_{ver[0]}_{ver[1]}_{ver[2]}"])
except ImportError: pass
assert False, f"am {self.devfmt}: failed to load {prefix} module with version {version}"
raise ImportError(f"am {self.devfmt}: failed to load {prefix} module with version {version}")
def _build_regs(self):
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)),