未验证 提交 9029fde7 编写于 作者: Q Qi Li 提交者: GitHub

[IPU] fix ipu and add python infer api, test=develop (#42724)

* [IPU] fix ipu and add python infer api, test=develop

* [IPU] add paddlepaddle-ipu package name, test=develop
上级 9840fb70
......@@ -164,7 +164,6 @@ if(WITH_IPU)
pass_library(infer_shape_pass base DIR ipu)
pass_library(delete_scale_op_pass base DIR ipu)
pass_library(avg_shard_pass base DIR ipu)
pass_library(transfer_cast_op_pass base DIR ipu)
endif()
cc_library(fuse_bn_act_pass SRCS fuse_bn_act_pass.cc DEPS pass graph_pattern_detector )
......
......@@ -601,6 +601,14 @@ void BindAnalysisConfig(py::module *m) {
.def("set_xpu_device_id", &AnalysisConfig::SetXpuDeviceId,
py::arg("device_id") = 0)
.def("enable_npu", &AnalysisConfig::EnableNpu, py::arg("device_id") = 0)
.def("enable_ipu", &AnalysisConfig::EnableIpu,
py::arg("ipu_device_num") = 1, py::arg("ipu_micro_batch_size") = 1,
py::arg("ipu_enable_pipelining") = false,
py::arg("ipu_batches_per_step") = 1)
.def("set_ipu_config", &AnalysisConfig::SetIpuConfig,
py::arg("ipu_enable_fp16") = false, py::arg("ipu_replica_num") = 1,
py::arg("ipu_available_memory_proportion") = 1.0,
py::arg("ipu_enable_half_partial") = false)
.def("disable_gpu", &AnalysisConfig::DisableGpu)
.def("enable_onnxruntime", &AnalysisConfig::EnableONNXRuntime)
.def("disable_onnxruntime", &AnalysisConfig::DisableONNXRuntime)
......
......@@ -14,6 +14,8 @@ elseif(WITH_ASCEND_CL)
SET(PACKAGE_NAME "paddlepaddle-npu")
elseif(WITH_XPU)
SET(PACKAGE_NAME "paddlepaddle-xpu")
elseif(WITH_IPU)
SET(PACKAGE_NAME "paddlepaddle-ipu")
else()
SET(PACKAGE_NAME "paddlepaddle")
endif()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册