[Bugfix] Record non-ImportError attention backend probe failures instead of crashing engine init (#51703)

Signed-off-by: Eoin <eoin@turintech.ai>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eoin-Houstoun
2026-08-20 02:36:00 -07:00
committed by GitHub
co-authored by Claude Fable 5
parent 6b68db441e
commit 30e2394c83
2 changed files with 114 additions and 4 deletions
+10 -4
View File
@@ -386,8 +386,11 @@ class CudaPlatformBase(Platform):
device_capability=device_capability,
**attn_selector_config._asdict(),
)
except ImportError:
invalid_reasons_i = ["ImportError"]
except (ImportError, OSError) as e:
logger.debug(
"Attention backend %s is unavailable", backend.name, exc_info=True
)
invalid_reasons_i = [f"{type(e).__name__}: {e}"]
if invalid_reasons_i:
invalid_reasons[backend] = (priority, invalid_reasons_i)
else:
@@ -415,8 +418,11 @@ class CudaPlatformBase(Platform):
device_capability=device_capability,
**attn_selector_config._asdict(),
)
except ImportError:
invalid_reasons = ["ImportError"]
except (ImportError, OSError) as e:
raise ValueError(
f"Selected backend {selected_backend} is not valid for "
f"this configuration. Reason: [{type(e).__name__}: {e}]"
) from e
if invalid_reasons:
raise ValueError(
f"Selected backend {selected_backend} is not valid for "