[Backend] Add KunlunXin XPU deploy support (#894)

Revert "Revert "[Backend] Add KunlunXin XPU deploy support" (#893)"

This reverts commit 0990ab9b50.
This commit is contained in:
Jason
2022-12-16 11:22:30 +08:00
committed by GitHub
parent 0990ab9b50
commit 2d998223ac
39 changed files with 870 additions and 58 deletions

17
fastdeploy/pybind/runtime.cc Normal file → Executable file
View File

@@ -23,6 +23,7 @@ void BindRuntime(pybind11::module& m) {
.def("use_gpu", &RuntimeOption::UseGpu)
.def("use_cpu", &RuntimeOption::UseCpu)
.def("use_rknpu2", &RuntimeOption::UseRKNPU2)
.def("use_xpu", &RuntimeOption::UseXpu)
.def("set_external_stream", &RuntimeOption::SetExternalStream)
.def("set_cpu_thread_num", &RuntimeOption::SetCpuThreadNum)
.def("use_paddle_backend", &RuntimeOption::UsePaddleBackend)
@@ -100,7 +101,21 @@ void BindRuntime(pybind11::module& m) {
.def_readwrite("ipu_available_memory_proportion",
&RuntimeOption::ipu_available_memory_proportion)
.def_readwrite("ipu_enable_half_partial",
&RuntimeOption::ipu_enable_half_partial);
&RuntimeOption::ipu_enable_half_partial)
.def_readwrite("xpu_l3_workspace_size",
&RuntimeOption::xpu_l3_workspace_size)
.def_readwrite("xpu_locked",
&RuntimeOption::xpu_locked)
.def_readwrite("xpu_autotune",
&RuntimeOption::xpu_autotune)
.def_readwrite("xpu_autotune_file",
&RuntimeOption::xpu_autotune_file)
.def_readwrite("xpu_precision",
&RuntimeOption::xpu_precision)
.def_readwrite("xpu_adaptive_seqlen",
&RuntimeOption::xpu_adaptive_seqlen)
.def_readwrite("xpu_enable_multi_stream",
&RuntimeOption::xpu_enable_multi_stream);
pybind11::class_<TensorInfo>(m, "TensorInfo")
.def_readwrite("name", &TensorInfo::name)