未验证 提交 b0a2f005 编写于 作者: L Leo Chen 提交者: GitHub

enable amp unsupported_fp16_list for npu (#34314)

上级 85e531a9
...@@ -78,7 +78,6 @@ limitations under the License. */ ...@@ -78,7 +78,6 @@ limitations under the License. */
#include "paddle/fluid/pybind/box_helper_py.h" #include "paddle/fluid/pybind/box_helper_py.h"
#include "paddle/fluid/pybind/compatible.h" #include "paddle/fluid/pybind/compatible.h"
#include "paddle/fluid/pybind/const_value.h" #include "paddle/fluid/pybind/const_value.h"
#include "paddle/fluid/pybind/cuda_streams_py.h"
#include "paddle/fluid/pybind/data_set_py.h" #include "paddle/fluid/pybind/data_set_py.h"
#include "paddle/fluid/pybind/exception.h" #include "paddle/fluid/pybind/exception.h"
#include "paddle/fluid/pybind/fleet_wrapper_py.h" #include "paddle/fluid/pybind/fleet_wrapper_py.h"
...@@ -240,6 +239,7 @@ OpSupportedInfos(const std::string &place, ...@@ -240,6 +239,7 @@ OpSupportedInfos(const std::string &place,
{"GPU", &platform::is_gpu_place}, {"GPU", &platform::is_gpu_place},
{"CPU", &platform::is_cpu_place}, {"CPU", &platform::is_cpu_place},
{"XPU", &platform::is_xpu_place}, {"XPU", &platform::is_xpu_place},
{"NPU", &platform::is_npu_place},
}; };
PADDLE_ENFORCE_NE( PADDLE_ENFORCE_NE(
is_target_place.count(query_place), 0, is_target_place.count(query_place), 0,
......
...@@ -158,6 +158,9 @@ _sys_unsupported_fp16_list = [] ...@@ -158,6 +158,9 @@ _sys_unsupported_fp16_list = []
if core.is_compiled_with_xpu(): if core.is_compiled_with_xpu():
_, _, _sys_unsupported_fp16_list = core.op_supported_infos( _, _, _sys_unsupported_fp16_list = core.op_supported_infos(
'XPU', core.VarDesc.VarType.FP16) 'XPU', core.VarDesc.VarType.FP16)
elif core.is_compiled_with_npu():
_, _, _sys_unsupported_fp16_list = core.op_supported_infos(
'NPU', core.VarDesc.VarType.FP16)
else: else:
_, _, _sys_unsupported_fp16_list = core.op_supported_infos( _, _, _sys_unsupported_fp16_list = core.op_supported_infos(
'GPU', core.VarDesc.VarType.FP16) 'GPU', core.VarDesc.VarType.FP16)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册