Browse Source

enable compile gpu in akg

tags/v0.7.0-beta
lingyunli63 5 years ago
parent
commit
42017a19e6
5 changed files with 7 additions and 7 deletions
  1. +1
    -1
      CMakeLists.txt
  2. +1
    -1
      akg
  3. +3
    -3
      build.sh
  4. +1
    -1
      cmake/package.cmake
  5. +1
    -1
      mindspore/ccsrc/backend/kernel_compiler/common_utils.h

+ 1
- 1
CMakeLists.txt View File

@@ -42,7 +42,7 @@ if (NOT Patch_FOUND)
endif () endif ()
message(PATCH_EXECUTABLE = ${Patch_EXECUTABLE}) message(PATCH_EXECUTABLE = ${Patch_EXECUTABLE})


if (ENABLE_AKG AND ENABLE_D)
if (ENABLE_AKG AND (ENABLE_D OR ENABLE_GPU))
add_subdirectory("${CMAKE_SOURCE_DIR}/akg") add_subdirectory("${CMAKE_SOURCE_DIR}/akg")
endif() endif()




+ 1
- 1
akg

@@ -1 +1 @@
Subproject commit f60af9df4220bf3db5de2b224418953c0dc1f625
Subproject commit 5237a9a08bfa03cc4c6be912a43d5efc0f4f153d

+ 3
- 3
build.sh View File

@@ -276,7 +276,7 @@ checkopts "$@"
echo "---------------- MindSpore: build start ----------------" echo "---------------- MindSpore: build start ----------------"
mkdir -pv "${BUILD_PATH}/package/mindspore/lib" mkdir -pv "${BUILD_PATH}/package/mindspore/lib"
git submodule update --init graphengine git submodule update --init graphengine
if [[ "X$ENABLE_AKG" = "Xon" ]] && [[ "X$ENABLE_D" = "Xon" ]]; then
if [[ "X$ENABLE_AKG" = "Xon" ]] && [[ "X$ENABLE_D" = "Xon" || "X$ENABLE_GPU" = "Xon" ]]; then
git submodule update --init --recursive akg git submodule update --init --recursive akg
fi fi


@@ -331,7 +331,7 @@ build_mindspore()
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_D=ON" CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_D=ON"
fi fi
if [[ "X$ENABLE_GPU" = "Xon" ]]; then if [[ "X$ENABLE_GPU" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GPU=ON -DCUDA_PATH=$CUDA_PATH -DCUDNN_PATH=$CUDNN_PATH -DMS_REQUIRE_CUDA_VERSION=${CUDA_VERSION}"
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GPU=ON -DUSE_CUDA=ON -DUSE_CUDNN=ON -DCUDA_PATH=$CUDA_PATH -DCUDNN_PATH=$CUDNN_PATH -DMS_REQUIRE_CUDA_VERSION=${CUDA_VERSION}"
fi fi
if [[ "X$ENABLE_CPU" = "Xon" ]]; then if [[ "X$ENABLE_CPU" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_CPU=ON" CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_CPU=ON"
@@ -342,7 +342,7 @@ build_mindspore()
if [[ "X$USE_GLOG" = "Xon" ]]; then if [[ "X$USE_GLOG" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DUSE_GLOG=ON" CMAKE_ARGS="${CMAKE_ARGS} -DUSE_GLOG=ON"
fi fi
if [[ "X$ENABLE_AKG" = "Xon" ]] && [[ "X$ENABLE_D" = "Xon" ]]; then
if [[ "X$ENABLE_AKG" = "Xon" ]] && [[ "X$ENABLE_D" = "Xon" || "X$ENABLE_GPU" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_AKG=ON" CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_AKG=ON"
fi fi
if [[ "X$ENABLE_SERVING" = "Xon" ]]; then if [[ "X$ENABLE_SERVING" = "Xon" ]]; then


+ 1
- 1
cmake/package.cmake View File

@@ -243,7 +243,7 @@ if (ENABLE_GPU)
endif () endif ()
endif () endif ()


if (ENABLE_D AND ENABLE_AKG)
if (ENABLE_AKG AND (ENABLE_D OR ENABLE_GPU))
set (AKG_PATH ${CMAKE_SOURCE_DIR}/build/mindspore/akg) set (AKG_PATH ${CMAKE_SOURCE_DIR}/build/mindspore/akg)
install( install(
DIRECTORY DIRECTORY


+ 1
- 1
mindspore/ccsrc/backend/kernel_compiler/common_utils.h View File

@@ -40,7 +40,7 @@ constexpr auto kProcessorCuda = "cuda";
constexpr auto kJsonSuffix = ".json"; constexpr auto kJsonSuffix = ".json";
constexpr auto kInfoSuffix = ".info"; constexpr auto kInfoSuffix = ".info";
constexpr unsigned int AUTODIFF_COMPILE_OVERTIME = 600; constexpr unsigned int AUTODIFF_COMPILE_OVERTIME = 600;
constexpr auto kAkgModule = "_akg";
constexpr auto kAkgModule = "akg.ms";
constexpr auto kArgDataformat = "data_format"; constexpr auto kArgDataformat = "data_format";


const std::vector<std::string> support_devices = {"aicore", "aicpu", "cuda"}; const std::vector<std::string> support_devices = {"aicore", "aicpu", "cuda"};


Loading…
Cancel
Save