Skip to content

Fix FlashAttention 2 detection when only FlashAttention 4 is installed - #269

Merged
lfengad merged 1 commit into
NVIDIA:mainfrom
rahul-steiger-nv:fix/flash2-missing-distribution
Sep 22, 2026
Merged

lfengad merged 1 commit into
NVIDIA:mainfrom
rahul-steiger-nv:fix/flash2-missing-distribution

Conversation

@rahul-steiger-nv

Copy link
Copy Markdown
Contributor

Fixes a crash in flash2_supported() when FlashAttention 4 provides the flash_attn namespace but the FlashAttention 2 distribution is not installed. The metadata lookup previously raised PackageNotFoundError, breaking Cosmos Framework imports.

The check now returns False when FA2 metadata is missing, allowing optional backend detection to continue.

Validation: six tests pass, including a regression test confirmed to fail before the fix. Lint and formatting checks pass. The full GPU suite was not run.

Signed-off-by: Rahul Steiger <rsteiger@nvidia.com>
@lfengad
lfengad merged commit 0460be8 into NVIDIA:main Sep 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants