-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fused linear for the LLAMA MLP block and multi-head attention block #6425
Conversation
Thanks for your contribution! |
gather_output=False, | ||
) | ||
if self.fuse_attn_qkv: | ||
self.qkv_proj = mpu.ColumnParallelLinear( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
预训练参数加载转换,看看能不能根据fuse 搞成自动的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请问大佬,具体是啥意思呀
a460685
to
3672383
Compare
…improved readability and consistency.
3672383
to
178e63b
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6425 +/- ##
===========================================
- Coverage 63.18% 63.14% -0.05%
===========================================
Files 529 529
Lines 77214 77315 +101
===========================================
+ Hits 48789 48817 +28
- Misses 28425 28498 +73
|
9495473
to
32c36cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看ok.
@ZHUI 看下呢?
…he fused linear implementation.
32c36cb
to
6412892
Compare
gather_output=False, | ||
has_bias=False, | ||
) | ||
# 为了减少张量并行的通信量,将两个linear合并成一个 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文注释 删掉
has_bias=False, | ||
) | ||
# 为了减少张量并行的通信量,将两个linear合并成一个 | ||
if config.fuse_mlp_linear: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 fuse_mlp_linear
是不是换个名字更好?
fuse_gate_up_proj
? 或者其他?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的好的
e1e2083
to
7927e54
Compare
7927e54
to
394608f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for the fuse
…ck (PaddlePaddle#6425) * Add fused linear for the LLAMA MLP block and multi-head attention block * Refactor the config name 'fuse_attn_qkv' to 'fuse_attention_qkv' for improved readability and consistency. * Added a switch for fuse_mlp_linear and improved the organization of the fused linear implementation. * add tensor parallel mappings for fused linears
PR types
New features
PR changes
Models
Description
Add fused linear operation for MLP and multi-head attention in LLAMA.