Repository navigation
fix(CP, FA): the conditional logic in the FA version contains a vulnerability when processing the output of Flash Attn forward pass - #2825
Conversation
Greptile SummaryThis PR fixes a conditional logic bug in Confidence Score: 5/5Safe to merge — the fix is minimal, correct, and applied symmetrically at all three affected call sites. The change is a clean, targeted bug fix with no new logic introduced. All three hunks follow the same pattern: adding No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[flash_attn_fwd called] --> B{use_flash_attn_3?}
B -- Yes --> E[else branch\nout = fa_outputs 0\nlse = fa_outputs 1\nrng_state = None]
B -- No --> C{fa_utils.v2_7_0_plus?}
C -- Yes --> E
C -- No --> D[if branch\nout = fa_outputs 4\nlse = fa_outputs 5\nrng_state = fa_outputs 7]
style D fill:#d4edda
style E fill:#d4edda
Reviews (3): Last reviewed commit: "Merge branch 'main' into CP_FA_fix" | Re-trigger Greptile |
|
@cyanguwa Can you take a look at this PR, please? |
|
@zhujian19891203 Thank you for the contribution. Could you sign your commits? Please see this for the instructions on how to do it. |
…he conditional logic in the FA version contains a vulnerability, fix it Signed-off-by: zhujian <[email protected]>
e915db4 to
aaa3504
Compare
Thanks for your review. I have signed my commits by following your link. |
|
/te-ci torch |
…rability when processing the output of Flash Attn forward pass (NVIDIA#2825) fix(CP, FA): when processing the output of Flash Attn forward pass, the conditional logic in the FA version contains a vulnerability, fix it Signed-off-by: zhujian <[email protected]>
Description
The conditional logic in the FA version contains a vulnerability when processing the output of Flash Attn forward pass, this maybe caused accidentally.
For example, when I only install FA3, and FA2 is totally not installed, something is wrong.

Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: