未验证 提交 67ed7e12 编写于 作者: Y Yuang Liu 提交者: GitHub

[hybrid] [npu] fit npu nan/inf check (#35171)

上级 6e638d72
...@@ -5323,7 +5323,13 @@ class PipelineOptimizer(object): ...@@ -5323,7 +5323,13 @@ class PipelineOptimizer(object):
"copy_data": False, "copy_data": False,
"use_align": True, "use_align": True,
"dtype": grads[0].dtype, "dtype": grads[0].dtype,
self._op_role_key: self._op_role.Backward self._op_role_key: self._op_role.Backward,
# On npu, the nan/inf check login is different with gpu.
# If there are some not initialized sections in the fused var,
# and the value in those sections are nan/inf, it will trigger the nan/inf check.
# To avoid these problematic triggers, set constant is needed for npu
"set_constant": core.is_compiled_with_npu(),
"constant": float(0.0),
}) })
offset += 1 offset += 1
# For the gradient_merged_fused_var, given a init value during the coalesce op # For the gradient_merged_fused_var, given a init value during the coalesce op
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册