[Bugfix] Replace BaseException with specific exceptions in FLA utils#31590
Merged
vllm-bot merged 1 commit intovllm-project:mainfrom Jan 2, 2026
Merged
[Bugfix] Replace BaseException with specific exceptions in FLA utils#31590vllm-bot merged 1 commit intovllm-project:mainfrom
vllm-bot merged 1 commit intovllm-project:mainfrom
Conversation
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 <kevin.mckay@outlook.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request correctly replaces a broad except BaseException: with the more specific except (RuntimeError, AttributeError): in the get_available_device function. This is a crucial improvement for robustness, as it prevents the accidental suppression of system-level exceptions like SystemExit and KeyboardInterrupt. The change is well-targeted and follows best practices for exception handling. The implementation is correct.
njhill
approved these changes
Dec 31, 2025
Contributor
Author
Hardware Verification (MI300X VF)Verified the BaseException fix on MI300X: # Branch verified
git checkout fix/fla-utils-baseexception
# Commit: 6869c459b [Bugfix] Replace BaseException with specific exceptions in FLA utils
# Fix confirmed in place
grep -n 'except (RuntimeError, AttributeError)' vllm/model_executor/layers/fla/ops/utils.py
122: except (RuntimeError, AttributeError):
# Module loads correctly
>>> from vllm.model_executor.layers.fla.ops.utils import get_available_device, device_platform
>>> get_available_device()
'hip'
>>> device_platform
'amd'Test environment:
FLA utils import and device detection working correctly with the fix. |
5 tasks
LucasWilkinson
pushed a commit
to neuralmagic/vllm
that referenced
this pull request
Jan 6, 2026
…llm-project#31590) Signed-off-by: c0de128 <kevin.mckay@outlook.com>
yugong333
pushed a commit
to yugong333/vllm
that referenced
this pull request
Jan 9, 2026
…llm-project#31590) Signed-off-by: c0de128 <kevin.mckay@outlook.com>
akh64bit
pushed a commit
to akh64bit/vllm
that referenced
this pull request
Jan 16, 2026
…llm-project#31590) Signed-off-by: c0de128 <kevin.mckay@outlook.com>
dsuhinin
pushed a commit
to dsuhinin/vllm
that referenced
this pull request
Jan 21, 2026
…llm-project#31590) Signed-off-by: c0de128 <kevin.mckay@outlook.com> Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
ItzDEXX
pushed a commit
to ItzDEXX/vllm
that referenced
this pull request
Feb 19, 2026
…llm-project#31590) Signed-off-by: c0de128 <kevin.mckay@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Change
except BaseException:toexcept (RuntimeError, AttributeError):inget_available_device()function.Details
BaseExceptioncatchesSystemExit,KeyboardInterrupt, andGeneratorExitwhich should propagate normally. The triton driver access can raise:RuntimeError: If triton backend is not availableAttributeError: If driver/target attributes don't existThis prevents masking critical system exceptions during device detection.
Test plan
🤖 Generated with Claude Code