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 npu] fix npu found_finite in hybrid (#35134) #35291

Merged
merged 1 commit into from
Aug 31, 2021
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 @@ -369,8 +369,11 @@ def _adapt_amp_clip_without_sharding(self):
# FIXME(wangxi): mp should prune duplicated param_grads when calc
# amp inf_var & clip global_norm_var

FP16Utils.sync_amp_check_nan_inf(main_block,
[self.mp_ring_id, self.pp_ring_id])
rings = [self.mp_ring_id, self.pp_ring_id]
# FIXME(wangxi): some problem with NPU found_finite, need sync with DP
if core.is_compiled_with_npu():
rings += [self.dp_ring_id]
FP16Utils.sync_amp_check_nan_inf(main_block, rings)

gradientclip_helper = GradientClipHelper(None)
gradientclip_helper.sync_global_norm(
Expand Down