diff --git a/aiter/ops/flydsl/utils.py b/aiter/ops/flydsl/utils.py index ba6a60b00e..c8660fc115 100644 --- a/aiter/ops/flydsl/utils.py +++ b/aiter/ops/flydsl/utils.py @@ -68,5 +68,15 @@ def get_shared_memory_per_block(device=None, fallback_gfx: str = "") -> int: return _get_shared_memory_per_block_cached(device, fallback_gfx) +@lru_cache(maxsize=1) def is_flydsl_available() -> bool: - return importlib.util.find_spec("flydsl") is not None + if importlib.util.find_spec("flydsl") is None: + return False + # flydsl only ships kernels for the architectures in its SMEM_CAPACITY_MAP. + # On other archs (e.g. gfx1100 / RDNA3) importing the kernel modules crashes + # during config registration, so report flydsl as unavailable there instead + # of failing the import. + from flydsl.runtime.device import get_rocm_arch + from flydsl.utils.smem_allocator import SMEM_CAPACITY_MAP + + return get_rocm_arch() in SMEM_CAPACITY_MAP