change cmake option for kunlunxin xpu from 'xpu' to 'kunlun'; fix bug after merging distributed infrastructure

This commit is contained in:
whjthu 2023-09-26 14:10:22 +08:00
parent 8c985bf752
commit 4e481e72a5
2 changed files with 9 additions and 5 deletions

View File

@ -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)

View File

@ -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;
};