Skip to content

Conversation

kircle888
Copy link
Contributor

@kircle888 kircle888 commented Jun 24, 2024

PR Category

Performance Optimization

PR Types

New features

Description

Pcard-70459
重命名 flash_attention_with_sparse_maskflashmask_attention, 重命名参数并支持更复杂的mask
跳过masked block的计算以改善性能

Copy link

paddle-bot bot commented Jun 24, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link

paddle-ci-bot bot commented Jul 5, 2024

Sorry to inform you that 9c65da5's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Copy link

paddle-ci-bot bot commented Jul 16, 2024

Sorry to inform you that efc5ce0's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

GuoxiaWang
GuoxiaWang previously approved these changes Aug 16, 2024
):
is_unpad = False
else:
is_unpad = bool(
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, 当 flashmask 识别到是 varlen 的模式时,启用 varlen 的方式执行。

"""

if window_size is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM,当设置了 window_size 时,用 flashmask 直接构造 startend_row_indices,而不需要用户自己去构造。

zyfncg
zyfncg previously approved these changes Aug 16, 2024
Copy link
Contributor

@zyfncg zyfncg left a comment

Choose a reason for hiding this comment

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

LGTM for yaml

SigureMo
SigureMo previously approved these changes Aug 16, 2024
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

Comment on lines 1099 to 1114
def flashmask_attention(
query,
key,
value,
startend_row_indices=None,
*,
dropout=0.0,
causal=False,
window_size=None,
return_softmax_lse=False,
return_seed_offset=False,
fixed_seed_offset=None,
rng_name="",
training=True,
name=None,
):
Copy link
Member

Choose a reason for hiding this comment

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

后续 PR 记得恢复并补齐新增参数的类型提示

wanghuancoder
wanghuancoder previously approved these changes Aug 19, 2024
SigureMo
SigureMo previously approved these changes Aug 19, 2024
wanghuancoder
wanghuancoder previously approved these changes Aug 20, 2024
Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

zyfncg
zyfncg previously approved these changes Aug 20, 2024
Copy link
Contributor

@zyfncg zyfncg left a comment

Choose a reason for hiding this comment

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

LGTM for yaml

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@GuoxiaWang GuoxiaWang merged commit f947b35 into PaddlePaddle:develop Aug 26, 2024
28 of 29 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.