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

Optimize llm/GPT3 performance #8172

Merged
merged 16 commits into from Apr 11, 2024
Merged

Conversation

MarioLulab
Copy link
Contributor

@MarioLulab MarioLulab commented Mar 22, 2024

PR types

Performance optimization

PR changes

Others

Description

将 model_zoo/gpt-3 中的优化策略迁移至 llm/gpt-3 中

  • Fast Layer Norm op
    开启方法:运行 run_pretrain.py 时设置 --use_fast_layer_norm true

  • Fused Linear
    开启方法:运行 run_pretrain.py 时设置 --use_fused_linear true

  • Fused Dropout + Add Residual
    开启方法:运行 run_pretrain.py 时设置 --use_fused_dropout_add true

  • enable_linear_fused_grad_add
    开启方法:版本要求:paddlenlp >= a5d87f5。运行 run_pretrain.py 时设置 --enable_linear_fused_grad_add true

  • use SPInnerOverlap
    开启方法:版本要求:paddlenlp >= a092775, paddle >= cfaa001,运行 run_pretrain.py 时设置 --tensor_parallel_config enable_mp_async_allreduce enable_fused_linear_param_grad_add 并且训练开启 sp

  • disable transmission attention_mask while pp
    开启方法:默认在 pp 时不传输 attention_mask

Copy link

paddle-bot bot commented Mar 22, 2024

Thanks for your contribution!

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 55.16%. Comparing base (d577e19) to head (9a6696f).
Report is 9 commits behind head on develop.

Files Patch % Lines
paddlenlp/transformers/gpt/modeling.py 85.00% 3 Missing ⚠️
paddlenlp/transformers/gpt/modeling_pp.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8172      +/-   ##
===========================================
- Coverage    55.41%   55.16%   -0.26%     
===========================================
  Files          597      601       +4     
  Lines        91593    91780     +187     
===========================================
- Hits         50754    50628     -126     
- Misses       40839    41152     +313     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MarioLulab MarioLulab changed the title Part-1 Optimize llm/GPT3 performance Optimize llm/GPT3 performance Mar 26, 2024
Copy link
Contributor

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

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

LGTM

@ZHUI ZHUI merged commit 2900f78 into PaddlePaddle:develop Apr 11, 2024
8 of 10 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.

None yet

3 participants