Skip to content
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

[cherry-pick-2.2.1]fix fused_transformer_encoder_layer bug #37229

Merged

Conversation

zkh2016
Copy link
Contributor

@zkh2016 zkh2016 commented Nov 16, 2021

PR types

Bug fixes

PR changes

APIs

Describe

修复了fused_transformer_encoder_layer fine-tune过程发现的一些问题:

  1. fused_attention_op添加attn_mask=None的支持:PR
  2. pre_layer_norm处理问题:PR
  3. 参数处理,计算错误的问题:PR
  4. add_bias计算错误问题:PR
  5. 添加pure fp16的支持:PR

limin2021 and others added 4 commits November 16, 2021 02:32
…addlePaddle#36951)

目前的fused_attention_op不支持attn_mask=None的输入,本PR对此进行了补充,并补充了相应的单测逻辑。
…le#36972)

* fix bug:
1. atten: set the default value of attn_dropout_rate to None
2. ffn: add activation parameter
fused_attention_op的实现中,使用了bias_add,且其实现是通过使用kernel primitive来实现的,之后kernel primitive的WriteData api接口及函数内部实现发生了更改,将判断越界的逻辑移到了template的参数中,使得调用的分支有错误,产生了越界赋值操作,污染了别的显存空间的内容。具体表现为:test_fused_attention_op_api.py 单次执行基本上不会报错,多次循环执行不同shape的输入,结果计算不对,具有偶发性,bug不易察觉。
limin2021
limin2021 previously approved these changes Nov 16, 2021
xingfeng01
xingfeng01 previously approved these changes Nov 16, 2021
lanxianghit
lanxianghit previously approved these changes Nov 16, 2021
Add pure fp16 support for fused transformer.
Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

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

LGTM

@zkh2016 zkh2016 changed the title [cherry-pick-2.2.1]fix fused_transformer_encoder_layer bug [cherry-pick-2.2.1]fix fused_transformer_encoder_layer bug Nov 16, 2021
@lanxianghit lanxianghit merged commit 36dd295 into PaddlePaddle:release/2.2 Nov 16, 2021
@zkh2016 zkh2016 deleted the release/2.2-cherry-pick-fixbug branch August 19, 2022 04:02
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.

5 participants