From 6869c459bef780c050c83839d9bee75b3a97eec4 Mon Sep 17 00:00:00 2001 From: c0de128 Date: Wed, 31 Dec 2025 14:02:39 -0600 Subject: [PATCH] [Bugfix] Replace BaseException with specific exceptions in FLA utils Change `except BaseException:` to `except (RuntimeError, AttributeError):` in get_available_device() function. BaseException catches SystemExit, KeyboardInterrupt, and GeneratorExit which should propagate. The triton driver access can raise: - RuntimeError: If triton backend is not available - AttributeError: If driver/target attributes don't exist This prevents masking critical system exceptions during device detection. Signed-off-by: c0de128 --- vllm/model_executor/layers/fla/ops/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/model_executor/layers/fla/ops/utils.py b/vllm/model_executor/layers/fla/ops/utils.py index 5a48e56a5fbb..18e17a5110c1 100644 --- a/vllm/model_executor/layers/fla/ops/utils.py +++ b/vllm/model_executor/layers/fla/ops/utils.py @@ -119,7 +119,7 @@ def wrapper(*args, **kwargs): def get_available_device() -> str: try: return triton.runtime.driver.active.get_current_target().backend - except BaseException: + except (RuntimeError, AttributeError): return "cpu"