Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Trainer] Update assert to warning #9332

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Changes from all commits
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
3 changes: 2 additions & 1 deletion paddlenlp/trainer/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,8 @@
)

if "split_param" in sharding_parallel_config:
assert self.sharding == [ShardingOption.SHARD_OP], "Only sharding stage1 support split_param."
if ShardingOption.SHARD_OP not in self.sharding:
logger.warning("Only sharding stage1 support split_param.")

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

View check run for this annotation

Codecov / codecov/patch

paddlenlp/trainer/training_args.py#L1406-L1407

Added lines #L1406 - L1407 were not covered by tests
assert (
self.amp_master_grad
), "If `split_param` in sharding_parallel_config, `amp_master_grad` must be True."
Expand Down
Loading