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

[hybrid fix] fix sharding save offload #40477

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -900,11 +900,12 @@ def save_persistables(exe, dirname, main_program, filename=None):

def is_opt_vars(var):
# NOTE(JZ-LIANG): The checks should be updated when add new compatible optimizer
# now only Momentum and adam are compatible with sharding
# support EMA optimizer
# now only Momentum and adam are compatible with sharding,
# support EMA optimizer with '_ema_0',
# support offload with '@offload_0' and '.cast_fp16'
checks = [
"_moment1_0", "_moment2_0", "_beta1_pow_acc_0", "_beta2_pow_acc_0",
"_velocity_0", "_ema_0"
"_velocity_0", "_ema_0", "@offload_0", ".cast_fp16"
]
for check in checks:
if var.name.endswith(check) and var.persistable:
Expand Down