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

Support Sharding Overlap #8473

Merged
merged 3 commits into from
May 24, 2024
Merged

Conversation

iosmers
Copy link
Contributor

@iosmers iosmers commented May 21, 2024

PR types

Performance optimization

PR changes

Models

Description

1.支持sharding overlap

Copy link

paddle-bot bot commented May 21, 2024

Thanks for your contribution!

if self.config.use_flash_attention and get_env_device() != "gcu":
is_casual = is_casual_mask(attention_mask)
Copy link
Collaborator

Choose a reason for hiding this comment

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

不要删除这个。if hasattr(self.config, "casual_mask")

@@ -1908,6 +1907,13 @@ def get_expected_keys(inputs, keys):
self.optimizer = mix_precision_utils.MixPrecisionOptimizer(self.optimizer)
self.optimizer = fleet.distributed_optimizer(self.optimizer)

if in_sharding_parallel_mode:
sharding_parallel_config = set(self.args.sharding_parallel_config.split(" "))
Copy link
Collaborator

Choose a reason for hiding this comment

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

training_args 文件里面处理好,就别在这里split了

@@ -223,6 +223,10 @@ class ModelArguments:
default=None,
metadata={"help": "num_hidden_layers."},
)
casual_mask: Optional[bool] = field(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
casual_mask: Optional[bool] = field(
use_casual_mask: Optional[bool] = field(

Copy link

codecov bot commented May 21, 2024

Codecov Report

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

Project coverage is 54.25%. Comparing base (87e4c4f) to head (594a050).
Report is 3 commits behind head on develop.

Files Patch % Lines
paddlenlp/trainer/trainer.py 0.00% 6 Missing ⚠️
paddlenlp/transformers/llama/modeling.py 66.66% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8473      +/-   ##
===========================================
- Coverage    54.29%   54.25%   -0.05%     
===========================================
  Files          617      617              
  Lines        96339    96368      +29     
===========================================
- Hits         52312    52288      -24     
- Misses       44027    44080      +53     

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

ZHUI
ZHUI previously approved these changes May 22, 2024
@@ -1908,6 +1907,12 @@ def get_expected_keys(inputs, keys):
self.optimizer = mix_precision_utils.MixPrecisionOptimizer(self.optimizer)
self.optimizer = fleet.distributed_optimizer(self.optimizer)

if in_sharding_parallel_mode:
if "split_param" in self.args.sharding_parallel_config:
self.optimizer._set_all_gather_overlap_forward(True, model)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个接口需要考虑版本兼容不?

ZHUI
ZHUI previously approved these changes May 22, 2024
Copy link
Collaborator

@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

@CLAassistant
Copy link

CLAassistant commented May 23, 2024

CLA assistant check
All committers have signed the CLA.

sneaxiy
sneaxiy previously approved these changes May 23, 2024
ZHUI
ZHUI previously approved these changes May 23, 2024
Copy link
Collaborator

@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

Copy link
Collaborator

@wawltor wawltor left a comment

Choose a reason for hiding this comment

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

LGTM

@wawltor wawltor merged commit 7aaa788 into PaddlePaddle:develop May 24, 2024
8 of 12 checks passed
SylarTiaNII added a commit to SylarTiaNII/PaddleNLP that referenced this pull request May 24, 2024
wawltor pushed a commit that referenced this pull request May 24, 2024
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

5 participants