Browse Source

!535 Fix code check

From: @dong-duo
Reviewed-by: @xchu42,@wqtshg
Signed-off-by: @wqtshg
tags/v1.2.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
0e17f86580
13 changed files with 23 additions and 23 deletions
  1. +1
    -1
      ge/client/ge_api.cc
  2. +1
    -1
      ge/graph/load/new_model_manager/davinci_model.cc
  3. +1
    -1
      ge/graph/load/new_model_manager/model_manager.cc
  4. +1
    -1
      ge/graph/optimize/mem_rw_conflict_optimize.cc
  5. +4
    -2
      ge/host_kernels/strided_slice_kernel.cc
  6. +3
    -3
      ge/hybrid/model/hybrid_model_builder.cc
  7. +1
    -1
      ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc
  8. +1
    -3
      ge/hybrid/node_executor/task_context.cc
  9. +1
    -1
      tests/depends/error_manager/src/error_manager_stub.cc
  10. +5
    -5
      tests/depends/hccl/src/hccl_stub.cc
  11. +1
    -1
      tests/depends/runtime/src/runtime_stub.cc
  12. +2
    -2
      tests/ut/ge/graph/build/logical_stream_allocator_unittest.cc
  13. +1
    -1
      tests/ut/ge/graph/load/new_op_test_utils.h

+ 1
- 1
ge/client/ge_api.cc View File

@@ -134,7 +134,7 @@ Status GEInitialize(const std::map<string, string> &options) {

Status GEInitialize(const std::map<AscendString, AscendString> &options) {
std::map<std::string, std::string> str_options;
for (auto & option : options) {
for (auto &option : options) {
if (option.first.GetString() == nullptr || option.second.GetString() == nullptr) {
GELOGE(FAILED, "GEInitialize options is nullptr.");
return FAILED;


+ 1
- 1
ge/graph/load/new_model_manager/davinci_model.cc View File

@@ -2676,7 +2676,7 @@ Status DavinciModel::ReturnResult(uint32_t data_id, const bool rslt_flg, const b
cur_dynamic_dims_.clear();
cur_dynamic_dims_.resize(shape_of_cur_dynamic_dims_);
GE_CHK_RT_RET(rtMemcpy(cur_dynamic_dims_.data(), shape_of_cur_dynamic_dims_ * sizeof(int64_t),
netoutput_last_input_addr_, netoutput_last_input_size_, RT_MEMCPY_DEVICE_TO_HOST));
netoutput_last_input_addr_, netoutput_last_input_size_, RT_MEMCPY_DEVICE_TO_HOST));
}
GELOGD("Cur dynamic dims is %s.", formats::JoinToString(cur_dynamic_dims_).c_str());
if (GenOutputTensorInfo(op_desc, data_index, output_data, outputs) != SUCCESS) {


+ 1
- 1
ge/graph/load/new_model_manager/model_manager.cc View File

@@ -1055,7 +1055,7 @@ Status ModelManager::GenSessionId(uint64_t &session_id) {
Status ModelManager::LoadModelOffline(uint32_t &model_id, const ModelData &model, shared_ptr<ModelListener> listener,
void *dev_ptr, size_t mem_size, void *weight_ptr, size_t weight_size) {
GE_CHK_BOOL_RET_STATUS(model.key.empty() || mmAccess2(model.key.c_str(), M_F_OK) == EN_OK,
ACL_ERROR_GE_PARAM_INVALID,
ACL_ERROR_GE_PARAM_INVALID,
"input key file path %s is invalid, %s", model.key.c_str(), strerror(errno));
GenModelId(&model_id);



+ 1
- 1
ge/graph/optimize/mem_rw_conflict_optimize.cc View File

@@ -643,7 +643,7 @@ Status HandleAllreduceDuplicateInput(ComputeGraphPtr &compute_graph) {
auto ret = GraphUtils::InsertNodeBetweenDataAnchors(pre_out_anchor, in_data_anchor, identity_node);
GE_CHK_STATUS_RET(ret, "Fail to insert identity.");
GELOGI("InsertNode %s between %s and %s successfully.", identity_node->GetName().c_str(),
pre_node->GetName().c_str(), node->GetName().c_str());
pre_node->GetName().c_str(), node->GetName().c_str());
}
}
}


+ 4
- 2
ge/host_kernels/strided_slice_kernel.cc View File

@@ -284,8 +284,10 @@ void StridedSliceKernel::ExpandDimsWithNewAxis(const ConstGeTensorPtr &begin_ten
}

void StridedSliceKernel::ExpandStrideWithEllipsisMask(const size_t x_dims_num,
const vector<int64_t> &x_dims, vector<int64_t> &orig_begin_vec,
vector<int64_t> &orig_end_vec, vector<int64_t> &orig_stride_vec) {
const vector<int64_t> &x_dims,
vector<int64_t> &orig_begin_vec,
vector<int64_t> &orig_end_vec,
vector<int64_t> &orig_stride_vec) {
if (attr_value_map_.at(STRIDE_SLICE_ATTR_ELLIPSIS_MASK) != 0) {
auto end_mask = attr_value_map_.at(STRIDE_SLICE_ATTR_END_MASK);


+ 3
- 3
ge/hybrid/model/hybrid_model_builder.cc View File

@@ -313,9 +313,9 @@ Status HybridModelBuilder::ParseDependentForFusedSubgraph(NodeItem &node_item) {
uint32_t parent_index = 0;
if (!AttrUtils::GetInt(*op_desc, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) {
GELOGE(INTERNAL_ERROR,
"[%s] Failed to get attr [%s]",
op_desc->GetName().c_str(),
ATTR_NAME_PARENT_NODE_INDEX.c_str());
"[%s] Failed to get attr [%s]",
op_desc->GetName().c_str(),
ATTR_NAME_PARENT_NODE_INDEX.c_str());
return INTERNAL_ERROR;
}



+ 1
- 1
ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc View File

@@ -724,7 +724,7 @@ Status AicpuNodeTask::UpdateIoAddr(TaskContext &context) {
auto io_addr = args_.get() + sizeof(aicpu::AicpuParamHead);
// if has input and output, need copy to ioaddr
int cpy_ret = memcpy_s(io_addr, args_size_ - sizeof(aicpu::AicpuParamHead),
&io_addrs[0], sizeof(uint64_t) * io_addrs.size());
&io_addrs[0], sizeof(uint64_t) * io_addrs.size());
GE_CHK_BOOL_RET_STATUS(cpy_ret == 0, INTERNAL_ERROR,
"Node[%s] memcpy io addr to AicpuParamHead failed, ret=%d, args_size=%u, io nums=%zu.",
node_name_.c_str(), cpy_ret, args_size_, io_addrs.size());


+ 1
- 3
ge/hybrid/node_executor/task_context.cc View File

@@ -233,9 +233,7 @@ Status TaskContext::AllocateOutput(int index,
} else {
GE_CHK_STATUS_RET_NOLOG(AllocateTensor(tensor_desc, outputs_start_[index], attr));
GELOGD("Allocating output successfully. node: %s. index = %d, size = %zu",
node_item_->NodeName().c_str(),
index,
outputs_start_[index].GetSize());
node_item_->NodeName().c_str(), index, outputs_start_[index].GetSize());
}
}
}


+ 1
- 1
tests/depends/error_manager/src/error_manager_stub.cc View File

@@ -58,7 +58,7 @@
/// @param [in] value: vector parameter value
///
void ErrorManager::ATCReportErrMessage(std::string error_code, const std::vector<std::string> &key,
const std::vector<std::string> &value) {
const std::vector<std::string> &value) {
}

///


+ 5
- 5
tests/depends/hccl/src/hccl_stub.cc View File

@@ -19,26 +19,26 @@
#include "hccl/hcom.h"

HcclResult hcom_all_gather(const char *tag, void *input_count_ptr, void *output_ptr, u64 input_count,
HcclDataType data_type, const char *group, rtStream_t stream) {
HcclDataType data_type, const char *group, rtStream_t stream) {
return HCCL_SUCCESS;
}

HcclResult hcom_broadcast(const char *tag, void *ptr, u64 count, HcclDataType data_type, u32 root,
const char *group, rtStream_t stream) {
const char *group, rtStream_t stream) {
return HCCL_SUCCESS;
}

HcclResult hcom_all_reduce(const char *tag, void *input_ptr, void *output_ptr, u64 count, HcclDataType data_type,
HcclReduceOp op, const char *group, rtStream_t stream) {
HcclReduceOp op, const char *group, rtStream_t stream) {
return HCCL_SUCCESS;
}

HcclResult hcom_get_split_strategy(const char *group, const struct model_feature *feature, u32 max_segment_num,
u32 *segment_num, u32 *segment_idx) {
u32 *segment_num, u32 *segment_idx) {
return HCCL_SUCCESS;
}

HcclResult hcom_reduce_scatter(const char *tag, void *input_ptr, void *output_ptr, u64 count,
HcclDataType data_type, HcclReduceOp op, const char *group, rtStream_t stream) {
HcclDataType data_type, HcclReduceOp op, const char *group, rtStream_t stream) {
return HCCL_SUCCESS;
}

+ 1
- 1
tests/depends/runtime/src/runtime_stub.cc View File

@@ -325,7 +325,7 @@ rtError_t rtSetTaskFailCallback(rtTaskFailCallback callback)
}

rtError_t rtMallocHostSharedMemory(rtMallocHostSharedMemoryIn *in,
rtMallocHostSharedMemoryOut *out)
rtMallocHostSharedMemoryOut *out)
{
out->ptr = new uint8_t[in->size];
out->devPtr = new uint8_t[in->size];


+ 2
- 2
tests/ut/ge/graph/build/logical_stream_allocator_unittest.cc View File

@@ -306,8 +306,8 @@ class UtestLogicalStreamAllocator : public testing::Test {
max_parallel_num["aicpu"] = parallel_num;

Status status = AssignLogicalStreams({const1, const2, get_next, genmask1, genmask2, domask, subgraph4, subgraph5,
subgraph6, allreduce1, allreduce2, apply1, apply2},
confs, max_parallel_num);
subgraph6, allreduce1, allreduce2, apply1, apply2},
confs, max_parallel_num);
EXPECT_EQ(status, ge::SUCCESS);

EXPECT_EQ(GetStream(get_next), 0);


+ 1
- 1
tests/ut/ge/graph/load/new_op_test_utils.h View File

@@ -154,7 +154,7 @@ class OmeTestOpUtils {
if (model->HasAttr(MODEL_ATTR_TASKS)) {
ge::Buffer task_buffer;
GE_CHK_BOOL_RET_STATUS(ge::AttrUtils::GetZeroCopyBytes(model, MODEL_ATTR_TASKS, task_buffer), FAILED,
"Get bytes failed.");
"Get bytes failed.");
std::shared_ptr<ModelTaskDef> task = ge::MakeShared<ModelTaskDef>();
GE_CHECK_NOTNULL(task);
GE_IF_BOOL_EXEC(task_buffer.GetData() == nullptr, GELOGE(FAILED, "Get data fail"); return FAILED);


Loading…
Cancel
Save