From 4e481e72a54ea09a34a8176887116f862eddd32c Mon Sep 17 00:00:00 2001 From: whjthu Date: Tue, 26 Sep 2023 14:10:22 +0800 Subject: [PATCH] change cmake option for kunlunxin xpu from 'xpu' to 'kunlun'; fix bug after merging distributed infrastructure --- CMakeLists.txt | 10 +++++----- include/xpu/xpu_runtime.h | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 228772fa..edb4dd16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ project(InfiniTensor C CXX) # Do not change these options in this file. Use cmake.config, cmake -DOPTION=VALUE, or ccmake to specify them. option(USE_CUDA "Support CUDA GPU" OFF) option(USE_BANG "Support BANG MLU" OFF) -option(USE_XPU "Support KUNLUN MLU" ON) +option(USE_KUNLUN "Support KUNLUN MLU" ON) option(USE_INTELCPU "Support INTELCPU" OFF) option(USE_BACKTRACE "Print backtrace on exception and segmentation fault" OFF) option(USE_PROTOBUF "Serialize and deserialize tensors" OFF) @@ -129,7 +129,7 @@ if(USE_BANG) list (APPEND SRC ${SRC_BANG}) endif() -if(USE_XPU) +if(USE_KUNLUN) file(GLOB_RECURSE SRC_XPU src/xpu/*.cc src/kernels/xpu/*.cc ) list (APPEND SRC ${SRC_XPU}) endif() @@ -249,8 +249,8 @@ if(USE_BANG) target_link_libraries(InfiniTensor ${CAMBRICON_CNNL} ${CAMBRICON_CNRT} ${CAMBRICON_CNDRV} stdc++) endif() -if(USE_XPU) - add_compile_definitions(USE_XPU=1) +if(USE_KUNLUN) + add_compile_definitions(USE_KUNLUN=1) include_directories(src/kernels/xpu/include) if ((NOT DEFINED XPU_HOME) AND (NOT DEFINED ENV{XPU_HOME})) message(FATAL_ERROR "XPU_HOME is not defined from cmake or env") @@ -310,7 +310,7 @@ if(BUILD_TEST) if (USE_BANG) build_test(test/kernels/bang/*.cc) endif() - if (USE_XPU) + if (USE_KUNLUN) build_test(test/kernels/xpu/*.cc) endif() if (USE_INTELCPU) diff --git a/include/xpu/xpu_runtime.h b/include/xpu/xpu_runtime.h index f1fdd74d..8d1be9a2 100644 --- a/include/xpu/xpu_runtime.h +++ b/include/xpu/xpu_runtime.h @@ -62,6 +62,10 @@ class XPURuntimeObj : public RuntimeObj { XPUMemcpyKind::XPU_DEVICE_TO_DEVICE); } + void initComm(const string &, int, int) override { IT_TODO_HALT(); } + + CommunicatorObj &getCommunicator() const override { IT_TODO_HALT(); } + private: void runWithoutSync(const Graph &graph, bool tune, bool profiling) const; };