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

[LLM] Update sequence parallel linear import #8706

Merged
merged 6 commits into from
Jul 11, 2024

Conversation

DrownFish19
Copy link
Collaborator

@DrownFish19 DrownFish19 commented Jul 3, 2024

PR types

Function optimization

PR changes

Models

Description

  1. All models imports ColumnSequenceParallelLinear and RowSequenceParallelLinear from linear_utils, where ColumnSequenceParallelLinear and RowSequenceParallelLinear are defined for different deivces including gpu, npu and xpu.
  2. nn.Linear is replace by linear_utils.Linear. When device is gpu or npu, nn.Linear is equal to linear_utils.Linear. When device is 'xpu', linear_utils.Linear is designed for xpu based on nn.Linear, which can achieve better performance.

Copy link

paddle-bot bot commented Jul 3, 2024

Thanks for your contribution!

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 66.14173% with 43 lines in your changes missing coverage. Please review.

Project coverage is 55.70%. Comparing base (fbe613b) to head (76be848).
Report is 3 commits behind head on develop.

Files Patch % Lines
paddlenlp/transformers/gemma/modeling.py 68.42% 6 Missing ⚠️
paddlenlp/transformers/linear_utils.py 0.00% 6 Missing ⚠️
paddlenlp/transformers/qwen2/modeling.py 73.91% 6 Missing ⚠️
paddlenlp/transformers/qwen2_moe/modeling.py 53.84% 6 Missing ⚠️
paddlenlp/peft/lora/lora_layers.py 28.57% 5 Missing ⚠️
paddlenlp/transformers/gpt/modeling.py 76.19% 5 Missing ⚠️
paddlenlp/peft/lora/lora_model.py 55.55% 4 Missing ⚠️
paddlenlp/transformers/mixtral/modeling.py 81.81% 4 Missing ⚠️
paddlenlp/transformers/qwen/modeling.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8706      +/-   ##
===========================================
- Coverage    55.70%   55.70%   -0.01%     
===========================================
  Files          623      623              
  Lines        97399    97424      +25     
===========================================
+ Hits         54255    54268      +13     
- Misses       43144    43156      +12     

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

gongel
gongel previously approved these changes Jul 3, 2024
gongel pushed a commit that referenced this pull request Jul 9, 2024
* Update sequence parallel linear import

* update lora models

* update lora sequence parallel layer

* update import
@ZHUI ZHUI merged commit e336e78 into PaddlePaddle:develop Jul 11, 2024
8 of 12 checks passed
@DrownFish19 DrownFish19 deleted the dev_fix_qwen2_import branch July 11, 2024 07:00
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