From 40cec53c272d38d22d9aa3a8fb2642c119bf1d95 Mon Sep 17 00:00:00 2001 From: DefTruth <31974251+DefTruth@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:48:15 +0800 Subject: [PATCH] [XPU] Update Lite XPU lib & add l3 cache benchmark option (#1503) * [XPU] Update Lite XPU lib & add l3 cache benchmark option * Update build_linux_x86_64_cpp_xpu_with_benchmark.sh * Update kunlunxin.cmake * Update build_linux_x86_64_cpp_xpu_with_benchmark.sh --- benchmark/cpp/config.txt | 1 + benchmark/cpp/option.h | 3 ++- cmake/kunlunxin.cmake | 10 ++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/benchmark/cpp/config.txt b/benchmark/cpp/config.txt index 142774e02..95080875d 100755 --- a/benchmark/cpp/config.txt +++ b/benchmark/cpp/config.txt @@ -10,4 +10,5 @@ use_fp16: false collect_memory_info: false sampling_interval: 1 precision_compare: false +xpu_l3_cache: 0 result_path: benchmark_cpu.txt diff --git a/benchmark/cpp/option.h b/benchmark/cpp/option.h index ba6182ce1..b04dcafda 100755 --- a/benchmark/cpp/option.h +++ b/benchmark/cpp/option.h @@ -76,7 +76,8 @@ static bool CreateRuntimeOption(fastdeploy::RuntimeOption* option, return false; } } else if (config_info["device"] == "xpu") { - option->UseKunlunXin(std::stoi(config_info["device_id"])); + option->UseKunlunXin(std::stoi(config_info["device_id"]), + std::stoi(config_info["xpu_l3_cache"])); if (config_info["backend"] == "ort") { option->UseOrtBackend(); } else if (config_info["backend"] == "paddle") { diff --git a/cmake/kunlunxin.cmake b/cmake/kunlunxin.cmake index 5a12526f9..e3fba52cb 100644 --- a/cmake/kunlunxin.cmake +++ b/cmake/kunlunxin.cmake @@ -7,6 +7,12 @@ if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64") message(FATAL_ERROR "KunlunXin XPU is only supported on Linux x64 platform") endif() +option(WITH_LITE_XPU_LOG "" ON) if(NOT PADDLELITE_URL) - set(PADDLELITE_URL "https://bj.bcebos.com/fastdeploy/third_libs/lite-linux-x64-xpu-20221215.tgz") -endif() \ No newline at end of file + if (WITH_LITE_XPU_LOG) + set(PADDLELITE_URL "https://bj.bcebos.com/fastdeploy/third_libs/lite-linux-x64-xpu-20221215.tgz") + # set(PADDLELITE_URL "https://bj.bcebos.com/fastdeploy/third_libs/lite-linux-x64-xpu-20230303.tgz") + else() + set(PADDLELITE_URL "https://bj.bcebos.com/fastdeploy/third_libs/lite-linux-x64-xpu-without-log-20230303.tgz") + endif() +endif()