Browse Source

fix gpu init fail

tags/v0.2.0-alpha
chenjianping 5 years ago
parent
commit
b6493af6b7
2 changed files with 3 additions and 2 deletions
  1. +1
    -0
      cmake/options.cmake
  2. +2
    -2
      mindspore/ccsrc/pipeline/init.cc

+ 1
- 0
cmake/options.cmake View File

@@ -64,6 +64,7 @@ endif()

if (ENABLE_GPU)
set(ENABLE_GPUQUE ON)
add_compile_definitions(ENABLE_GPU_COLLECTIVE)
endif()

if (ENABLE_GE)


+ 2
- 2
mindspore/ccsrc/pipeline/init.cc View File

@@ -29,7 +29,7 @@
#include "parallel/context.h"
#include "parallel/device_manager.h"
#include "parallel/costmodel_context.h"
#ifdef ENABLE_GPUQUE
#ifdef ENABLE_GPU_COLLECTIVE
#include "device/gpu/distribution/collective_init.h"
#else
#include "device/gpu/distribution/collective_fake_init.h"
@@ -300,7 +300,7 @@ PYBIND11_MODULE(_c_expression, m) {
(void)py::class_<OpLib, std::shared_ptr<OpLib>>(m, "Oplib")
.def(py::init())
.def("reg_op", &OpLib::RegOp, "Register op info.");
#ifdef ENABLE_GPUQUE
#ifdef ENABLE_GPU_COLLECTIVE
(void)m.def("init_gpu_collective", &mindspore::device::gpu::CollectiveInitializer::InitCollective,
"Init gpu collective communication mode.");
(void)m.def("finalize_gpu_collective", &mindspore::device::gpu::CollectiveInitializer::FinalizeCollective,


Loading…
Cancel
Save