Skip to content

Commit

Permalink
cherry-pick Remove the deprecated implement of Bitmain NPU
Browse files Browse the repository at this point in the history
  • Loading branch information
csy0225 committed Oct 26, 2022
1 parent fe57749 commit a9793bb
Show file tree
Hide file tree
Showing 79 changed files with 6 additions and 5,359 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ lite_option(LITE_WITH_ARM "Enable ARM in lite mode"
lite_option(LITE_WITH_SW "Enable SW in lite mode" OFF)
lite_option(LITE_WITH_NNADAPTER "Enable NNAdapter in lite mode" OFF)
lite_option(LITE_WITH_XPU "Enable XPU in lite mode" OFF)
lite_option(LITE_WITH_BM "Enable BM in lite mode" OFF)
lite_option(LITE_WITH_TRAIN "Enable training operators and kernels in lite" OFF)
lite_option(LITE_WITH_OPENMP "Enable OpenMP in lite framework" ON)
lite_option(LITE_WITH_OPENCL "Enable OpenCL support in lite" OFF)
Expand Down
4 changes: 0 additions & 4 deletions cmake/backends/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ if(LITE_WITH_CUDA)
include(cuda)
endif()

if(LITE_WITH_BM)
include(bm)
endif()

include(backends/x86)

# Add dependencies
Expand Down
75 changes: 0 additions & 75 deletions cmake/bm.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions cmake/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ if (LITE_WITH_INTEL_FPGA)
add_definitions("-DLITE_WITH_INTEL_FPGA")
endif()

if (LITE_WITH_BM)
add_definitions("-DLITE_WITH_BM")
endif()

if (LITE_WITH_NNADAPTER)
add_definitions(-DLITE_WITH_NNADAPTER)
# The following macros are only for unit test
Expand Down
6 changes: 0 additions & 6 deletions cmake/lite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ function (lite_deps TARGET)
endforeach(var)
endif()

if (LITE_WITH_BM)
foreach(var ${lite_deps_BM_DEPS})
set(deps ${deps} ${var})
endforeach(var)
endif()

if (LITE_WITH_NNADAPTER)
foreach(var ${lite_deps_NNADAPTER_DEPS})
set(deps ${deps} ${var})
Expand Down
23 changes: 0 additions & 23 deletions lite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ message(STATUS "LITE_WITH_METAL:\t${LITE_WITH_METAL}")
message(STATUS "LITE_WITH_XPU:\t${LITE_WITH_XPU}")
message(STATUS "LITE_WITH_FPGA:\t${LITE_WITH_FPGA}")
message(STATUS "LITE_WITH_INTEL_FPGA:\t${LITE_WITH_INTEL_FPGA}")
message(STATUS "LITE_WITH_BM:\t${LITE_WITH_BM}")
message(STATUS "LITE_WITH_NNADAPTER:\t${LITE_WITH_NNADAPTER}")
message(STATUS "LITE_WITH_PROFILE:\t${LITE_WITH_PROFILE}")
message(STATUS "LITE_WITH_CV:\t${LITE_WITH_CV}")
Expand Down Expand Up @@ -196,9 +195,6 @@ if (LITE_WITH_ARM)
if (LITE_WITH_FPGA)
set(INFER_LITE_PUBLISH_ROOT "${INFER_LITE_PUBLISH_ROOT}.fpga")
endif(LITE_WITH_FPGA)
if (LITE_WITH_BM)
set(INFER_LITE_PUBLISH_ROOT "${INFER_LITE_PUBLISH_ROOT}.bm")
endif(LITE_WITH_BM)
if (LITE_WITH_INTEL_FPGA)
set(INFER_LITE_PUBLISH_ROOT "${INFER_LITE_PUBLISH_ROOT}.intel_fpga")
endif(LITE_WITH_INTEL_FPGA)
Expand Down Expand Up @@ -700,25 +696,6 @@ if (ARM_TARGET_OS STREQUAL "armlinux")
add_dependencies(publish_inference publish_inference_armlinux_cxx_demos)
endif()

if (LITE_WITH_BM)
add_custom_target(publish_inference_bm_cxx_demos ${TARGET}
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/demo/cxx"
COMMAND cp "${PADDLE_SOURCE_DIR}/lite/demo/cxx/bm_demo/*" "${INFER_LITE_PUBLISH_ROOT}/demo/cxx/"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/cxx"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/cxx/lib"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/cxx/lib/third_party"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/cxx/include"
COMMAND cp "${PADDLE_BINARY_DIR}/lite/api/libpaddle_full_api_shared.so" "${INFER_LITE_PUBLISH_ROOT}/cxx/lib/"
COMMAND cp "${BM_SDK_ROOT}/lib/bmcompiler/*" "${INFER_LITE_PUBLISH_ROOT}/cxx/lib/third_party/"
COMMAND cp "${BM_SDK_ROOT}/lib/bmnn/pcie/*" "${INFER_LITE_PUBLISH_ROOT}/cxx/lib/third_party/"
COMMAND cp "${PADDLE_SOURCE_DIR}/lite/api/paddle_*.h" "${INFER_LITE_PUBLISH_ROOT}/cxx/include/"
COMMAND cp "${PADDLE_BINARY_DIR}/lite/api/paddle_use_kernels.h" "${INFER_LITE_PUBLISH_ROOT}/cxx/include"
COMMAND cp "${PADDLE_BINARY_DIR}/lite/api/paddle_use_ops.h" "${INFER_LITE_PUBLISH_ROOT}/cxx/include"
)
add_dependencies(publish_inference_bm_cxx_demos paddle_full_api_shared)
add_dependencies(publish_inference publish_inference_bm_cxx_demos)
endif()

if(LITE_WITH_NNADAPTER)
# Build the NNAdapter runtime library, copy the header files and library file to the publish directory
add_custom_target(publish_inference_nnadapter_runtime_header_files
Expand Down
3 changes: 0 additions & 3 deletions lite/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ endif()
if(LITE_WITH_FPGA)
set(external_libs_DEPS ${external_libs_DEPS} ${fpga_deps})
endif()
if(LITE_WITH_BM)
set(external_libs_DEPS ${external_libs_DEPS} ${bm_deps})
endif()
if(LITE_WITH_INTEL_FPGA)
set(external_libs_DEPS ${external_libs_DEPS} ${intel_fpga_deps})
endif()
Expand Down
9 changes: 0 additions & 9 deletions lite/api/cxx_api_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,6 @@ void CxxPaddleApiImpl::Init(const lite_api::CxxConfig &config) {
}
#endif

#ifdef LITE_WITH_BM
Env<TARGET(kBM)>::Init();
int device_id = 0;
if (const char *c_id = getenv("BM_VISIBLE_DEVICES")) {
device_id = static_cast<int>(*c_id) - 48;
}
TargetWrapper<TARGET(kBM)>::SetDevice(device_id);
#endif // LITE_WITH_BM

#if defined(LITE_ON_MODEL_OPTIMIZE_TOOL) || defined(LITE_WITH_PYTHON) || \
defined(LITE_WITH_NNADAPTER)
// Use scope to store the model-level configuration for the subgraph kernel
Expand Down
6 changes: 0 additions & 6 deletions lite/api/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ if(WITH_TESTING)
ARGS --model_dir=${LITE_MODEL_DIR}/step_rnn)
add_dependencies(test_step_rnn_lite_x86 extern_lite_download_step_rnn_tar_gz)
endif()
if(LITE_WITH_BM)
lite_cc_test(test_classify_lite_bm SRCS test_classify_lite_bm.cc
ARGS --model_dir=${LITE_MODEL_DIR}/classify)
lite_cc_test(test_yolov3_lite_bm SRCS test_yolov3_lite_bm.cc
ARGS --model_dir=${LITE_MODEL_DIR}/yolov3)
endif()
endif()
endif()

Expand Down
112 changes: 0 additions & 112 deletions lite/api/test/test_classify_lite_bm.cc

This file was deleted.

Loading

0 comments on commit a9793bb

Please sign in to comment.