Skip to content

[Bugfix] Replace BaseException with specific exceptions in FLA utils#31590

Merged
vllm-bot merged 1 commit intovllm-project:mainfrom
c0de128:fix/fla-utils-baseexception
Jan 2, 2026
Merged

[Bugfix] Replace BaseException with specific exceptions in FLA utils#31590
vllm-bot merged 1 commit intovllm-project:mainfrom
c0de128:fix/fla-utils-baseexception

Conversation

@c0de128
Copy link
Copy Markdown
Contributor

@c0de128 c0de128 commented Dec 31, 2025

Summary

Change except BaseException: to except (RuntimeError, AttributeError): in get_available_device() function.

Details

BaseException catches SystemExit, KeyboardInterrupt, and GeneratorExit which should propagate normally. 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.

Test plan

  • Code review confirms change is safe
  • Existing tests pass
  • Hardware verification (will post results)

🤖 Generated with Claude Code

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>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @co63oc

@njhill njhill added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 31, 2025
@njhill njhill enabled auto-merge (squash) December 31, 2025 21:07
@c0de128
Copy link
Copy Markdown
Contributor Author

c0de128 commented Dec 31, 2025

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:

  • GPU: AMD Instinct MI300X VF (192GB)
  • vLLM: 0.7.4.dev (Docker rocm/vllm-dev:main)
  • ROCm: 6.3

FLA utils import and device detection working correctly with the fix.

@vllm-bot vllm-bot merged commit 5fff440 into vllm-project:main Jan 2, 2026
48 of 51 checks passed
LucasWilkinson pushed a commit to neuralmagic/vllm that referenced this pull request Jan 6, 2026
yugong333 pushed a commit to yugong333/vllm that referenced this pull request Jan 9, 2026
akh64bit pushed a commit to akh64bit/vllm that referenced this pull request Jan 16, 2026
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>
@c0de128 c0de128 deleted the fix/fla-utils-baseexception branch January 27, 2026 17:56
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants