Skip to content

Conversation

kzawora-intel
Copy link
Contributor

This PR adds a guard preventing non-FlashAttention backends from crashing when inheriting from MLACommonImpl - in such scenarios, flash_attn_varlen_func is undefined and construction will fail on NameError: name 'flash_attn_varlen_func' is not defined, which wasn't the case in V0 MLACommonImpl.

Copy link
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 aims to fix a NameError that occurs in the MLACommonImpl constructor when vllm_flash_attn is not available. The proposed change from else to elif is_vllm_fa correctly addresses this issue for some platforms. However, my review identifies a critical issue where this change inadvertently breaks FlashAttention support for ROCm platforms. I've provided a suggestion to correct the condition to ensure it works across all intended platforms by checking for the availability of the flash_attn_varlen_func function directly.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Konrad Zawora <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant