Skip to content

[Cherry-pick] add comm buffer size (#8963) #9031

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

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions paddlenlp/trainer/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@
)
},
)
sharding_comm_buffer_size_MB: int = field(
default=-1,
metadata={"help": ("Sharding fused comm buffer size in communication between sharding ranks. ")},
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

save_sharded_model: bool = field(
default=False,
metadata={
Expand Down Expand Up @@ -1293,6 +1298,11 @@
)

try:
if self.sharding_comm_buffer_size_MB > 0:
strategy.hybrid_configs["sharding_configs"].comm_buffer_size_MB = int(

Check warning on line 1302 in paddlenlp/trainer/training_args.py

View check run for this annotation

Codecov / codecov/patch

paddlenlp/trainer/training_args.py#L1301-L1302

Added lines #L1301 - L1302 were not covered by tests
self.sharding_comm_buffer_size_MB
)

if "split_param" in sharding_parallel_config:
strategy.hybrid_configs["sharding_configs"].split_param = True

Expand Down
Loading