[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:
co-authored by
Claude Fable 5
parent
6b68db441e
commit
30e2394c83
+10
-4
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user