[hybrid] Support tensor parallel and cache structure for fused attention op.#40101
Merged
wangxicoding merged 10 commits intoPaddlePaddle:developfrom Mar 11, 2022
Merged
Conversation
|
Thanks for your contribution! |
wangxicoding
reviewed
Mar 4, 2022
e89ce26 to
ab370ad
Compare
bf2cb02 to
a8db839
Compare
81ca93e to
c750011
Compare
ce9d167 to
5b878bf
Compare
cache structure support for fuse attention
5b878bf to
e088d36
Compare
XieYunshen
approved these changes
Mar 11, 2022
Contributor
XieYunshen
left a comment
There was a problem hiding this comment.
LGTM for
set_tests_properties(test_static_model_parallel_fused_attention PROPERTIES TIMEOUT 120)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
Others
PR changes
Others
Describe
fuse_attention_op 修改如下:
增加了
CacheKVinput(optional),用作生成模型while当中的上一轮cache的值使用。增加了
CacheKVOutoutput,作为生成模型while当中的本轮更新过后的cache的值使用。修改 attribute,新增
ring_id属性(optional,默认值-1),作为分布式训练tensor parallel的通讯组标识使用。Update fused_attention op support tensor model parallel and cache structure.

For tensor model parallel, first column parallel linear, then row parallel linear, then we will get partial out, we can use allreduce to get the final output.