未验证 提交 f4193eac 编写于 作者: 王明冬 提交者: GitHub

[NPU] fix CI error in new executor. (#45432)

上级 efab2eb4
...@@ -566,6 +566,9 @@ void InterpreterCore::RunInstruction(const Instruction& instr_node) { ...@@ -566,6 +566,9 @@ void InterpreterCore::RunInstruction(const Instruction& instr_node) {
: var_scope_.GetMutableScope(); : var_scope_.GetMutableScope();
#ifdef PADDLE_WITH_ASCEND_CL #ifdef PADDLE_WITH_ASCEND_CL
if (platform::is_npu_place(place)) {
auto dev_id = place.device;
platform::SetNPUDeviceId(dev_id);
// NOTE(wangxi): nan/inf cannot be detected on NPU by checking the variable // NOTE(wangxi): nan/inf cannot be detected on NPU by checking the variable
// values, but only through special `float_status` to checks whether // values, but only through special `float_status` to checks whether
// the operation is overflow. More about `float_status`, see: // the operation is overflow. More about `float_status`, see:
...@@ -573,6 +576,7 @@ void InterpreterCore::RunInstruction(const Instruction& instr_node) { ...@@ -573,6 +576,7 @@ void InterpreterCore::RunInstruction(const Instruction& instr_node) {
if (FLAGS_check_nan_inf) { if (FLAGS_check_nan_inf) {
framework::details::NPUAllocAndClearFloatStatus(*op, *local_scope, place); framework::details::NPUAllocAndClearFloatStatus(*op, *local_scope, place);
} }
}
#endif #endif
auto op_with_kernel = dynamic_cast<const framework::OperatorWithKernel*>(op); auto op_with_kernel = dynamic_cast<const framework::OperatorWithKernel*>(op);
......
...@@ -6,8 +6,7 @@ string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}") ...@@ -6,8 +6,7 @@ string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
if(WITH_ASCEND_CL) if(WITH_ASCEND_CL)
foreach(TEST_OP ${TEST_OPS}) foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS py_test_modules(${TEST_OP} MODULES ${TEST_OP})
FLAGS_USE_STANDALONE_EXECUTOR=0)
endforeach() endforeach()
# NOTE: NPU `get_float_status` read the value from register, During the test, # NOTE: NPU `get_float_status` read the value from register, During the test,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册