Browse Source

codedex

tags/v1.5.0-rc1
ttudu 4 years ago
parent
commit
c8f24a18f7
6 changed files with 13 additions and 11 deletions
  1. +1
    -1
      mindspore/ccsrc/backend/kernel_compiler/hccl/hcom_all_to_all.h
  2. +8
    -6
      mindspore/ccsrc/cxx_api/model/model_converter_utils/multi_process.cc
  3. +2
    -2
      mindspore/ccsrc/cxx_api/types.cc
  4. +1
    -0
      mindspore/ccsrc/runtime/device/ascend/ge_runtime/task/label_manager.cc
  5. +0
    -1
      mindspore/ccsrc/utils/comm_manager.cc
  6. +1
    -1
      mindspore/ccsrc/utils/context/context_extends.cc

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

@@ -34,7 +34,7 @@ class HcomAllToAllKernel : public HcclKernel {
const std::vector<AddressPtr> &outputs, uint32_t stream_id) override;

private:
HcclDataType data_type_;
HcclDataType data_type_ = {};
};
} // namespace mindspore::kernel
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_HCCL_HCOM_ALL_TO_ALL_H_

+ 8
- 6
mindspore/ccsrc/cxx_api/model/model_converter_utils/multi_process.cc View File

@@ -26,7 +26,9 @@
namespace mindspore {
namespace {
constexpr uint64_t kSharedMemorySize = 100ull << 20; // 100 MB
}
constexpr int kOneMillisecond = 1000; // 1ms
constexpr int kOneHundredMilliseconds = 100000; // 100ms
} // namespace

MultiProcess::MultiProcess() = default;

@@ -63,7 +65,7 @@ Status MultiProcess::MainProcess(const ProcessFuncCall &parent_process, const Pr
shmat_data_addr_ = shmat_addr_ + sizeof(MessageFlag) * kMsgStructNum;
shmat_data_max_size_ =
memory_size_ - (reinterpret_cast<uintptr_t>(shmat_data_addr_) - reinterpret_cast<uintptr_t>(shmat_addr_));
MS_LOG_INFO << "Shm addr " << (uint64_t)shmat_addr_;
MS_LOG_INFO << "Shm addr " << (uintptr_t)shmat_addr_;
if (pid == 0) {
ChildProcess(child_process);
shared_memory.Detach();
@@ -134,7 +136,7 @@ void MultiProcess::ChildProcess(const ProcessFuncCall &child_process) {
MS_LOG_ERROR << "Catch child process runtime error: " << ex.what();
}
stopped_ = true;
send_msg_->stop = true;
send_msg_->stop = 1;
heartbeat_thread.join();
}

@@ -162,7 +164,7 @@ Status MultiProcess::SendMsg(const void *buffer, uint64_t msg_len) {
send_msg_->read_ready_flag = 1;
MS_LOG_INFO << "Send start " << cur_offset << ", msg len " << sub_msg_len << ", total len " << msg_len;
while (!send_msg_->read_finish_flag && !peer_stopped_) {
(void)usleep(1000); // 1ms
(void)usleep(kOneMillisecond); // 1ms
}
if (peer_stopped_) {
if (!send_msg_->read_finish_flag) {
@@ -183,7 +185,7 @@ Status MultiProcess::ReceiveMsg(const CreateBufferCall &create_buffer_call) {
do {
MS_LOG_INFO << "Receive start from " << cur_offset;
while (!receive_msg_->read_ready_flag && !peer_stopped_) {
(void)usleep(1000); // 1ms
(void)usleep(kOneMillisecond); // 1ms
}
if (peer_stopped_) {
return kMEFailed;
@@ -230,7 +232,7 @@ void MultiProcess::HeartbeatThreadFuncInner() {
}
}
send_msg_->heartbeat += 1;
(void)usleep(100000); // sleep 100 ms
(void)usleep(kOneHundredMilliseconds); // sleep 100 ms
}
}
} // namespace mindspore

+ 2
- 2
mindspore/ccsrc/cxx_api/types.cc View File

@@ -220,7 +220,7 @@ MSTensor *MSTensor::CreateImageTensor(const std::vector<char> &image_file) noexc
return nullptr;
}

size_t size = ifs.tellg();
size_t size = static_cast<size_t>(ifs.tellg());
MSTensor *ret =
new MSTensor(file, mindspore::DataType::kNumberTypeUInt8, {static_cast<int64_t>(size)}, nullptr, size);

@@ -231,7 +231,7 @@ MSTensor *MSTensor::CreateImageTensor(const std::vector<char> &image_file) noexc
return nullptr;
}

auto &io_read = ifs.read(reinterpret_cast<char *>(ret->MutableData()), size);
auto &io_read = ifs.read(reinterpret_cast<char *>(ret->MutableData()), static_cast<std::streamsize>(size));
if (!io_read.good() || io_read.fail() || io_read.bad()) {
ifs.close();
MS_LOG(ERROR) << "Failed to read file: " + file;


+ 1
- 0
mindspore/ccsrc/runtime/device/ascend/ge_runtime/task/label_manager.cc View File

@@ -106,6 +106,7 @@ std::shared_ptr<LabelGuard> LabelManager::GetLabelInfo(rtModel_t model, const st
rt_ret = rtLabelListCpy(label_list.data(), label_list.size(), label_info, label_info_size);
if (rt_ret != RT_ERROR_NONE) {
MS_LOG(ERROR) << "Call rt api rtLabelListCpy failed, ret: " << rt_ret;
rtFree(label_info);
return nullptr;
}



+ 0
- 1
mindspore/ccsrc/utils/comm_manager.cc View File

@@ -24,7 +24,6 @@
#include "runtime/hccl_adapter/hccl_adapter.h"
#include "hccl/hcom.h"
#include "runtime/device/ascend/distribute/ascend_collective.h"
using HcclCollectiveGroup = mindspore::device::ascend::collective::HcclCollectiveGroup;
#endif

#if defined(ENABLE_GPU)


+ 1
- 1
mindspore/ccsrc/utils/context/context_extends.cc View File

@@ -376,7 +376,7 @@ struct DeviceTypeSetRegister {
#endif
});
}
DeviceTypeSetRegister(DeviceTypeSetRegister &) = delete;
DeviceTypeSetRegister(const DeviceTypeSetRegister &) = delete;
DeviceTypeSetRegister &operator=(const DeviceTypeSetRegister &) = delete;
~DeviceTypeSetRegister() = default;
} device_type_set_regsiter;


Loading…
Cancel
Save