diff --git a/ge/common/auth/file_saver.cc b/ge/common/auth/file_saver.cc index e708653a..12999e54 100755 --- a/ge/common/auth/file_saver.cc +++ b/ge/common/auth/file_saver.cc @@ -62,7 +62,7 @@ Status FileSaver::WriteData(const void *data, uint32_t size, int32_t fd) { while (size > size_1g) { write_count = mmWrite(fd, reinterpret_cast(seek), size_1g); if (write_count == EN_INVALID_PARAM || write_count == EN_ERROR) { - GELOGE(FAILED, "Write data failed. mmpa_errorno = %d, %s", write_count, strerror(errno)); + GELOGE(FAILED, "Write data failed. mmpa_errorno = %ld, %s", write_count, strerror(errno)); return FAILED; } size -= size_1g; @@ -75,7 +75,7 @@ Status FileSaver::WriteData(const void *data, uint32_t size, int32_t fd) { // -1: Failed to write to file; - 2: Illegal parameter if (write_count == EN_INVALID_PARAM || write_count == EN_ERROR) { - GELOGE(FAILED, "Write data failed. mmpa_errorno = %d, %s", write_count, strerror(errno)); + GELOGE(FAILED, "Write data failed. mmpa_errorno = %ld, %s", write_count, strerror(errno)); return FAILED; } @@ -133,7 +133,7 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi WriteData(static_cast(&model_partition_table), table_size, fd) != SUCCESS, ret = FAILED; break); // Write partition data for (const auto &partitionData : partition_datas) { - GELOGI("GC:size[%zu]", partitionData.size); + GELOGI("GC:size[%u]", partitionData.size); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( WriteData(static_cast(partitionData.data), partitionData.size, fd) != SUCCESS, ret = FAILED; break); @@ -305,7 +305,7 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi // Write partition data auto &cur_partition_datas = all_partition_datas[index]; for (const auto &partition_data : cur_partition_datas) { - GELOGI("GC:size[%zu]", partition_data.size); + GELOGI("GC:size[%u]", partition_data.size); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( WriteData(static_cast(partition_data.data), partition_data.size, fd) != SUCCESS, ret = FAILED; break); diff --git a/ge/common/helper/model_cache_helper.cc b/ge/common/helper/model_cache_helper.cc index 7ec8cc0f..bf8c3ce0 100755 --- a/ge/common/helper/model_cache_helper.cc +++ b/ge/common/helper/model_cache_helper.cc @@ -1000,8 +1000,8 @@ Status ModelCacheHelper::RecoverVarAddrAndTensorDesc(const Json &json) const { auto offset = (tensor_addr_mgr.offset); // Check logic address and offset if (logic_address - offset != VarManager::Instance(session_id_)->GetVarMemLogicBase()) { - GELOGW("Check logic_address[%u] and offset [%u] of %s failed, var mem logic base is %u, abandon", logic_address, - offset, iter.first.c_str(), VarManager::Instance(session_id_)->GetVarMemLogicBase()); + GELOGW("Check logic_address[%lu] and offset [%lu] of %s failed, var mem logic base is %lu, abandon", + logic_address, offset, iter.first.c_str(), VarManager::Instance(session_id_)->GetVarMemLogicBase()); return PARAM_INVALID; } // Offset is needed by SaveVarVddr instead of logic address diff --git a/ge/common/helper/model_helper.cc b/ge/common/helper/model_helper.cc index 92f279be..05914b22 100644 --- a/ge/common/helper/model_helper.cc +++ b/ge/common/helper/model_helper.cc @@ -537,7 +537,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadRootMod //model verison 1.0 file header does not have model_num member is_unknown_shape_model_ = file_header_->version >= ge::MODEL_VERSION && file_header_->model_num > kStatiOmFileModelNum; - GELOGD("cur om model is ge root model or no %d, model version %zu", is_unknown_shape_model_, file_header_->version); + GELOGD("cur om model is ge root model or no %d, model version %u", is_unknown_shape_model_, file_header_->version); OmFileLoadHelper om_load_helper; if (is_unknown_shape_model_) { @@ -746,7 +746,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadTask(Om GELOGE(INTERNAL_ERROR, "ReadProtoFromArray failed."); return INTERNAL_ERROR; } - GELOGD("TASK_INFO op_size:%zu, stream_num:%u", task->op().size(), task->stream_num()); + GELOGD("TASK_INFO op_size:%d, stream_num:%u", task->op().size(), task->stream_num()); } cur_model->SetModelTaskDef(task); return SUCCESS; diff --git a/ge/common/helper/om_file_helper.cc b/ge/common/helper/om_file_helper.cc index d1c52b13..b42aa759 100644 --- a/ge/common/helper/om_file_helper.cc +++ b/ge/common/helper/om_file_helper.cc @@ -203,7 +203,7 @@ Status OmFileLoadHelper::LoadModelPartitionTable(uint8_t *model_data, uint32_t m auto partition_table = reinterpret_cast(model_data + cur_offset); size_t partition_table_size = SIZE_OF_MODEL_PARTITION_TABLE(*partition_table); cur_offset += partition_table_size; - GELOGD("Cur model index %zu: ModelPartitionTable num :%u, " + GELOGD("Cur model index %u: ModelPartitionTable num :%u, " "ModelFileHeader length :%zu, ModelPartitionTable length :%zu", index, partition_table->num, sizeof(ModelFileHeader), partition_table_size); if (model_data_size <= cur_offset) { @@ -219,7 +219,7 @@ Status OmFileLoadHelper::LoadModelPartitionTable(uint8_t *model_data, uint32_t m partition.type = partition_table->partition[i].type; if (index >= model_contexts_.size()) { if (index != model_contexts_.size()) { - GELOGE(FAILED, "cur index is %zu make model_contexts_ overflow", index); + GELOGE(FAILED, "cur index is %u make model_contexts_ overflow", index); return FAILED; } @@ -231,16 +231,16 @@ Status OmFileLoadHelper::LoadModelPartitionTable(uint8_t *model_data, uint32_t m } if (partition.size > model_data_size || cur_offset > model_data_size - partition.size) { - GELOGE(GE_EXEC_MODEL_DATA_SIZE_INVALID, "The partition size %zu is greater than the model data size %u.", + GELOGE(GE_EXEC_MODEL_DATA_SIZE_INVALID, "The partition size %u is greater than the model data size %u.", partition.size + cur_offset, model_data_size); return GE_EXEC_MODEL_DATA_SIZE_INVALID; } cur_offset += partition.size; - GELOGD("Partition, type:%d, size:%u, model_index:%zu", static_cast(partition.type), partition.size, index); + GELOGD("Partition, type:%d, size:%u, model_index:%u", static_cast(partition.type), partition.size, index); } } if (cur_offset != model_data_size) { - GELOGE(FAILED, "do not get the complete model, read end offset:%zu, all size:%zu", cur_offset, model_data_size); + GELOGE(FAILED, "do not get the complete model, read end offset:%u, all size:%u", cur_offset, model_data_size); return FAILED; } return SUCCESS; diff --git a/ge/common/kernel_store.cc b/ge/common/kernel_store.cc index 0fad096a..d746fd10 100755 --- a/ge/common/kernel_store.cc +++ b/ge/common/kernel_store.cc @@ -51,7 +51,7 @@ bool KernelStore::Build() { kernel_head.name_len = static_cast(kernel->GetName().length()); kernel_head.bin_len = static_cast(kernel->GetBinDataSize()); - GELOGD("get kernel bin name %s, addr %p, size %u", + GELOGD("get kernel bin name %s, addr %p, size %zu", kernel->GetName().c_str(), kernel->GetBinData(), kernel->GetBinDataSize()); mem_ret = memcpy_s(next_buffer, remain_len, &kernel_head, sizeof(kernel_head)); GE_CHK_BOOL_EXEC_NOLOG(mem_ret == EOK, return false); diff --git a/ge/common/math/math_util.h b/ge/common/math/math_util.h index 3255e3c1..e077f4b5 100755 --- a/ge/common/math/math_util.h +++ b/ge/common/math/math_util.h @@ -878,11 +878,11 @@ inline Status CheckInt32DivOverflow(int32_t a, int32_t b) { return INTERNAL_ERROR; \ } -#define FMK_INT64_UINT32_MULCHECK(a, b) \ - if (ge::CheckInt64Uint32MulOverflow((a), (b)) != SUCCESS) { \ - GELOGW("Int64 %ld and UINT32 %u multiplication can result in overflow!", static_cast(a), \ - static_cast(b)); \ - return INTERNAL_ERROR; \ +#define FMK_INT64_UINT32_MULCHECK(a, b) \ + if (ge::CheckInt64Uint32MulOverflow((a), (b)) != SUCCESS) { \ + GELOGW("Int64 %ld and Uint32 %u multiplication can result in overflow!", static_cast(a), \ + static_cast(b)); \ + return INTERNAL_ERROR; \ } #define FMK_FP16_ZEROCHECK(a) \ diff --git a/ge/executor/ge_executor.cc b/ge/executor/ge_executor.cc index b71a8be4..63cff228 100755 --- a/ge/executor/ge_executor.cc +++ b/ge/executor/ge_executor.cc @@ -454,7 +454,7 @@ Status GeExecutor::GetCurDynamicDims(uint32_t model_id, const vector & if (all_data_dims[i] < 0) { cur_dynamic_dims.push_back(dynamic_dims[i]); } else if (static_cast(all_data_dims[i]) != dynamic_dims[i]) { - GELOGE(ACL_ERROR_GE_DYNAMIC_INPUT_LENGTH_INVALID, "Static dims should be same, index: %zu value: %d should be %d", + GELOGE(ACL_ERROR_GE_DYNAMIC_INPUT_LENGTH_INVALID, "Static dims should be same, index: %zu value: %lu should be %ld", i, dynamic_dims[i], all_data_dims[i]); return ACL_ERROR_GE_DYNAMIC_INPUT_LENGTH_INVALID; } diff --git a/ge/ge_local_engine/engine/host_cpu_engine.cc b/ge/ge_local_engine/engine/host_cpu_engine.cc index 06dc2b96..4aebffb4 100755 --- a/ge/ge_local_engine/engine/host_cpu_engine.cc +++ b/ge/ge_local_engine/engine/host_cpu_engine.cc @@ -33,7 +33,7 @@ namespace { uint64_t size = data_num * sizeof(TYPE); \ ge_tensor = MakeShared(out_desc, size); \ GE_CHECK_NOTNULL(ge_tensor); \ - GELOGD("node:%s allocate output %zu success, size=%lld", op_desc->GetName().c_str(), i, size); \ + GELOGD("node:%s allocate output %zu success, size=%ld", op_desc->GetName().c_str(), i, size); \ ge_tensor->MutableTensorDesc().SetDataType(out_desc.GetDataType()); \ ge_tensor->MutableTensorDesc().SetShape(out_desc.GetShape()); \ } else { \ @@ -72,7 +72,7 @@ Status GetDataNumber(const GeTensorDesc &out_desc, uint64_t &data_num) { num_size = max_range_size; } if (num_size < 0) { - GELOGE(INTERNAL_ERROR, "Get negative size, num_size=%lld.", num_size); + GELOGE(INTERNAL_ERROR, "Get negative size, num_size=%ld.", num_size); return INTERNAL_ERROR; } data_num = static_cast(num_size); diff --git a/ge/graph/build/graph_builder.cc b/ge/graph/build/graph_builder.cc index 7b09cbc6..b13781f8 100644 --- a/ge/graph/build/graph_builder.cc +++ b/ge/graph/build/graph_builder.cc @@ -741,7 +741,7 @@ Status GraphBuilder::AddOutputMemTypeForNode(const NodePtr &node) { if (!AttrUtils::GetInt(op_desc, ATTR_INPUT_MEMORY_TYPE, mem_type)) { return SUCCESS; } - GELOGD("[%s] has attr input_memory_type %ld", op_desc->GetName().c_str(), mem_type); + GELOGD("[%s] has attr input_memory_type %u", op_desc->GetName().c_str(), mem_type); for (const auto &in_data_anchor : node->GetAllInDataAnchors()) { const auto &peer_out_anchor = in_data_anchor->GetPeerOutAnchor(); GE_IF_BOOL_EXEC(peer_out_anchor == nullptr, continue); @@ -751,7 +751,7 @@ Status GraphBuilder::AddOutputMemTypeForNode(const NodePtr &node) { while (true) { const auto &src_desc = src_node->GetOpDesc(); GE_IF_BOOL_EXEC(src_desc == nullptr, continue); - GELOGD("[%s:%u] set attr output_memory_type %ld", src_desc->GetName().c_str(), src_out_anchor->GetIdx(), + GELOGD("[%s:%u] set attr output_memory_type %d", src_desc->GetName().c_str(), src_out_anchor->GetIdx(), mem_type); if (!AttrUtils::SetInt(src_desc->MutableOutputDesc(src_out_anchor->GetIdx()), ATTR_OUTPUT_MEMORY_TYPE, mem_type)) { diff --git a/ge/graph/build/memory/graph_mem_assigner.cc b/ge/graph/build/memory/graph_mem_assigner.cc index 98d073d4..fe4c59d2 100755 --- a/ge/graph/build/memory/graph_mem_assigner.cc +++ b/ge/graph/build/memory/graph_mem_assigner.cc @@ -1535,8 +1535,8 @@ ge::Status GraphMemoryAssigner::UpdateOpInputOffset(const NodePtr &node, vector< GE_CHK_STATUS(TensorUtils::GetDataOffset(tensor_desc, input_offset)); } - GELOGD("%s node[%s] input[%d] is set from node[%s] out index[%lu] offset[%ld]", - has_mem_type_attr == true ? "Fusion" : "", + GELOGD("%s node[%s] input[%ld] is set from node[%s] out index[%lu] offset[%ld]", + has_mem_type_attr ? "Fusion" : "", tmp_op_desc->GetName().c_str(), valid_input_index, peer_out_anchor->GetOwnerNode()->GetOpDesc()->GetName().c_str(), diff --git a/ge/graph/build/task_generator.cc b/ge/graph/build/task_generator.cc index 04c1a36f..2edc830d 100755 --- a/ge/graph/build/task_generator.cc +++ b/ge/graph/build/task_generator.cc @@ -466,11 +466,10 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info task_def_ptr->set_ops_kernel_store_ptr(reinterpret_cast(ops_kernel_info_store_ptr)); } - GELOGI( - "Fusion: Call %s to generate fusion_node:[fusion_node_name:%s(%s), id:%ld, stream_id:%ld]" - " task finished, generate %u task(s).", - op_kernel_lib_name.c_str(), fusion_node_name.c_str(), fusion_node_type.c_str(), op_id, stream_id, - task_list_size_after - task_list_size_before); + GELOGI("Fusion: Call %s to generate fusion_node:[fusion_node_name:%s(%s), id:%ld, stream_id:%ld]" + " task finished, generate %zu task(s).", + op_kernel_lib_name.c_str(), fusion_node_name.c_str(), fusion_node_type.c_str(), op_id, stream_id, + task_list_size_after - task_list_size_before); // record nodes which have call generate task successfully fusion_nodes_seen.insert(fusion_node.get()); diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 58fb791e..136a041c 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -1876,7 +1876,7 @@ Status DavinciModel::InitAippType(uint32_t index, const OpDescPtr &op_desc, cons (void)AttrUtils::GetStr(op_desc, ATTR_DATA_AIPP_DATA_NAME_MAP, releated_name); for (const auto item : data_list) { if (item.second->GetName() == releated_name) { - GELOGI("Find aipp_data [%s] index %zu from index %u", releated_name.c_str(), item.first, index); + GELOGI("Find aipp_data [%s] index %u from index %u", releated_name.c_str(), item.first, index); aipp_index = item.first; } } diff --git a/ge/graph/load/model_manager/model_manager.cc b/ge/graph/load/model_manager/model_manager.cc index 8be8b60f..c424a60b 100755 --- a/ge/graph/load/model_manager/model_manager.cc +++ b/ge/graph/load/model_manager/model_manager.cc @@ -1704,7 +1704,7 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op for (uint32_t i = 0; i < res_op_nums; i++) { ReturnCode ret_code = res_ret_code_list.at(i); SysOpInfo aicpu_info = res_aicpu_op_info_list.at(i); - GELOGI("Not support aicpu op type: %lu, kernel_type:%d, opLen:%d, ret_code:%d", aicpu_info.opType, + GELOGI("Not support aicpu op type: %lu, kernel_type:%d, opLen:%lu, ret_code:%d", aicpu_info.opType, aicpu_info.kernelsType, aicpu_info.opLen, ret_code); std::vector op_name; op_name.clear(); diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index 159f14a4..55e26cf9 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -2777,7 +2777,7 @@ Status GraphManager::ParseInputsDimsForGetNexNosinkAndData(const vector } GetLocalOmgContext().user_real_input_dims.emplace_back(input_tensor.at(index).dims); - GELOGI("Shape dims of %d data is %s.", index, formats::JoinToString(input_tensor.at(index).dims).c_str()); + GELOGI("Shape dims of %zu data is %s.", index, formats::JoinToString(input_tensor.at(index).dims).c_str()); } return SUCCESS; } diff --git a/ge/graph/manager/graph_var_manager.cc b/ge/graph/manager/graph_var_manager.cc index e7dce824..d0292885 100755 --- a/ge/graph/manager/graph_var_manager.cc +++ b/ge/graph/manager/graph_var_manager.cc @@ -299,12 +299,12 @@ Status HbmMemResource::AssignVarMem(const std::string &var_name, uint64_t size, Status RdmaMemResource::AssignVarMem(const std::string &var_name, uint64_t size, uint64_t session_id, size_t &address) { uint8_t *buffer = MemManager::Instance().RdmaPoolInstance(RT_MEMORY_HBM).Malloc(size); if (buffer == nullptr) { - GELOGE(MEMALLOC_FAILED, "Failed to malloc rdma memory for node %s, size = %llu", var_name.c_str(), size); + GELOGE(MEMALLOC_FAILED, "Failed to malloc rdma memory for node %s, size = %lu", var_name.c_str(), size); return MEMALLOC_FAILED; } address = static_cast(reinterpret_cast(buffer)); var_mem_size_ += size; - GELOGI("[IMAS]AssignVarMem Set session_%llu name[%s] output[%d] addr to [%p] size[%llu].", + GELOGI("[IMAS]AssignVarMem Set session_%lu name[%s] output[%d] addr to [%p] size[%lu].", session_id, var_name.c_str(), 0, buffer, size); return SUCCESS; } diff --git a/ge/graph/passes/cond_remove_pass.cc b/ge/graph/passes/cond_remove_pass.cc index ce5ff7c0..9ecc79a6 100644 --- a/ge/graph/passes/cond_remove_pass.cc +++ b/ge/graph/passes/cond_remove_pass.cc @@ -203,7 +203,7 @@ bool CondRemovePass::CheckIfCondConstInput(const OutDataAnchorPtr &cond_out_anch // Get weights from peer node auto weights = OpDescUtils::GetWeights(out_node); if (weights.size() <= static_cast(cond_out_anchor->GetIdx())) { - GELOGI("Get weights of node %s out index %d, weight size %u is not fit for data index %d.", + GELOGI("Get weights of node %s out index %d, weight size %zu is not fit for data index %d.", out_node->GetName().c_str(), cond_out_anchor->GetIdx(), weights.size(), cond_out_anchor->GetIdx()); return false; } @@ -241,7 +241,7 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c for (const auto &peerout_anchor : input_anchor->GetPeerAnchors()) { if (GraphUtils::AddEdge(peerout_anchor, partitioncall_node->GetInAnchor( input_anchor->GetIdx() - kConditionIndexNum)) != ge::GRAPH_SUCCESS) { - GELOGE(FAILED, "Add edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%d, output num:%d", + GELOGE(FAILED, "Add edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", peerout_anchor->GetOwnerNode()->GetName().c_str(), peerout_anchor->GetIdx(), partitioncall_node->GetName().c_str(), input_anchor->GetIdx(), input_desc_size, output_desc_size); @@ -254,14 +254,14 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c for (const auto &output_anchor : node->GetAllOutAnchors()) { for (const auto &peerin_anchor : output_anchor->GetPeerAnchors()) { if (GraphUtils::RemoveEdge(node->GetOutAnchor(output_anchor->GetIdx()), peerin_anchor) != ge::GRAPH_SUCCESS) { - GELOGE(FAILED, "Remove edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%d, output num:%d", + GELOGE(FAILED, "Remove edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", node->GetName().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), peerin_anchor->GetIdx(), input_desc_size, output_desc_size); return FAILED; } if (GraphUtils::AddEdge(partitioncall_node->GetOutAnchor(output_anchor->GetIdx()), peerin_anchor) != ge::GRAPH_SUCCESS) { - GELOGE(FAILED, "Add edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%d, output num:%d", + GELOGE(FAILED, "Add edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", partitioncall_node->GetName().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), peerin_anchor->GetIdx(), input_desc_size, output_desc_size); diff --git a/ge/graph/passes/for_pass.cc b/ge/graph/passes/for_pass.cc index 31dee390..3b7a0886 100644 --- a/ge/graph/passes/for_pass.cc +++ b/ge/graph/passes/for_pass.cc @@ -469,7 +469,7 @@ Status ForPass::BuildWhileLink(const WhileInfo &while_info) { continue; } GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(peer_out_anchor, in_data_anchor), - "Add data-edge %s:%d->%s:%d failed.", + "Add data-edge %s:%d->%s:%zu failed.", peer_out_anchor->GetOwnerNode()->GetName().c_str(), peer_out_anchor->GetIdx(), while_node->GetName().c_str(), i); } @@ -480,7 +480,7 @@ Status ForPass::BuildWhileLink(const WhileInfo &while_info) { GE_CHECK_NOTNULL(out_data_anchor); for (auto &peer_in_anchor : while_info.data_outputs[i]) { GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(out_data_anchor, peer_in_anchor), - "Add data-edge %s:%d->%s:%d failed.", + "Add data-edge %s:%zu->%s:%d failed.", while_node->GetName().c_str(), i + kWhileOutputIndex, peer_in_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetIdx()); } diff --git a/ge/graph/passes/multi_batch_clone_pass.cc b/ge/graph/passes/multi_batch_clone_pass.cc index b7efa070..17a1e3bb 100755 --- a/ge/graph/passes/multi_batch_clone_pass.cc +++ b/ge/graph/passes/multi_batch_clone_pass.cc @@ -928,7 +928,7 @@ Status MultiBatchClonePass::CreateOriGraph(const ComputeGraphPtr &graph) { auto out_data_anchor = node->GetOutDataAnchor(out_index); GE_IF_BOOL_EXEC(out_data_anchor == nullptr, continue); NodePtr data_node = CreateDataNode(graph, out_data_anchor, data_index); - GE_IF_BOOL_EXEC(data_node == nullptr, GELOGE(INTERNAL_ERROR, "Create %zu data node failed.", + GE_IF_BOOL_EXEC(data_node == nullptr, GELOGE(INTERNAL_ERROR, "Create %d data node failed.", out_data_anchor->GetIdx()); return INTERNAL_ERROR); for (auto &in_anchor : out_data_anchor->GetPeerInDataAnchors()) { GE_IF_BOOL_EXEC(in_anchor == nullptr, continue); diff --git a/ge/graph/passes/remove_same_const_pass.cc b/ge/graph/passes/remove_same_const_pass.cc index e75a4553..3d18a92d 100644 --- a/ge/graph/passes/remove_same_const_pass.cc +++ b/ge/graph/passes/remove_same_const_pass.cc @@ -85,7 +85,7 @@ Status RemoveSameConstPass::Run(ComputeGraphPtr graph) { ret = GraphUtils::ReplaceNodeAnchors(iter->second, node, {}, output_map); if (ret != GRAPH_SUCCESS) { - GELOGE(INTERNAL_ERROR, "Failed to replace node %s by node %s", node->GetName().c_str(), + GELOGE(INTERNAL_ERROR, "Failed to replace node %s by node %s, ret=%u", node->GetName().c_str(), iter->second->GetName().c_str(), ret); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/subgraph_pass.cc b/ge/graph/passes/subgraph_pass.cc index dc6269ac..3d83c301 100755 --- a/ge/graph/passes/subgraph_pass.cc +++ b/ge/graph/passes/subgraph_pass.cc @@ -311,7 +311,7 @@ Status SubgraphPass::InsertInputMemcpy(const ComputeGraphPtr &graph, const std:: Status SubgraphPass::InsertOutputMemcpy(const ComputeGraphPtr &graph, const NodePtr &output_node, const std::set &bypass_index) { if (output_node->GetAllInDataAnchorsSize() == bypass_index.size()) { - GELOGD("No need to insert output memcpy node in while_body %s, output_size=%zu, bypass_num=%zu.", + GELOGD("No need to insert output memcpy node in while_body %s, output_size=%u, bypass_num=%zu.", graph->GetName().c_str(), output_node->GetAllInDataAnchorsSize(), bypass_index.size()); return SUCCESS; } diff --git a/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc b/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc index 3b37003f..7b0ffc02 100755 --- a/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc +++ b/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc @@ -644,7 +644,7 @@ Status InsertNewOpUtil::RecordAIPPInfoToData(const ComputeGraphPtr &graph) { std::vector aipps; GE_RETURN_IF_ERROR(GetAllAipps(data_node, *aipps_or_switchs_or_case.begin(), aipps)); - GELOGI("RecordAIPPInfoToData: Data: name[%s], type[%s], batch size[%u]", data_node->GetName().c_str(), + GELOGI("RecordAIPPInfoToData: Data: name[%s], type[%s], batch size[%zu]", data_node->GetName().c_str(), data_node->GetType().c_str(), aipps.size()); for (auto aipp_it : aipps) { diff --git a/ge/graph/preprocess/multi_batch_copy_graph.cc b/ge/graph/preprocess/multi_batch_copy_graph.cc index 5506435e..e43c5dd2 100644 --- a/ge/graph/preprocess/multi_batch_copy_graph.cc +++ b/ge/graph/preprocess/multi_batch_copy_graph.cc @@ -371,7 +371,7 @@ Status MultiBatchGraphCopyer::GetEnterNodesGroupByFrame(mapGetName().c_str()); + GELOGE(FAILED, "Get attr frame_name of enter[%s] failed.", node->GetName().c_str()); return FAILED; } frame_enter[frame_name].emplace_back(node); @@ -850,19 +850,19 @@ NodePtr MultiBatchGraphCopyer::FindSwitchnNodeForDataEdge(const OutDataAnchorPtr if (is_getnext_sink_data) { auto output_idx = data_out_anchor->GetIdx(); size_t referenced_index = 0; - GELOGI("The output idx %zu has %zu referenced nums.", output_idx, data_out_anchor->GetPeerInDataAnchors().size()); + GELOGI("The output idx %d has %zu referenced nums.", output_idx, data_out_anchor->GetPeerInDataAnchors().size()); for (const auto &peer_in_anchor : data_out_anchor->GetPeerInDataAnchors()) { if (peer_in_anchor->GetOwnerNode()->GetOpDesc() == nullptr) { GELOGE(INTERNAL_ERROR, "Op desc should not be nullptr."); return nullptr; } if (getnext_nodes_to_switchn_.at(output_idx).empty()) { - GELOGI("Output idx %zu of %s is static output.", output_idx, data_node->GetName().c_str()); + GELOGI("Output idx %d of %s is static output.", output_idx, data_node->GetName().c_str()); return nullptr; } if (output_idx >= static_cast(getnext_nodes_to_switchn_.size()) || referenced_index >= getnext_nodes_to_switchn_.at(output_idx).size()) { - GELOGE(INTERNAL_ERROR, "Output idx is %zu, referenced index is %zu", output_idx, referenced_index); + GELOGE(INTERNAL_ERROR, "Output idx is %d, referenced index is %zu", output_idx, referenced_index); return nullptr; } if (peer_in_anchor->GetOwnerNode()->GetOpDesc()->GetName() == origin_node->GetName()) { @@ -1203,7 +1203,7 @@ Status MultiBatchGraphCopyer::InsertSwitchNAndUpdateMaxShape(const NodePtr &node for (size_t i = 0; i < getnext_sink_dynamic_out_mapping_.size(); ++i) { if(UpdateMaxShapeToData(node, i) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to update max shape of %zu out anchor", node->GetName().c_str(), i); + GELOGE(PARAM_INVALID, "Failed to update %s max shape of %zu out anchor", node->GetName().c_str(), i); return PARAM_INVALID; } } diff --git a/ge/graph/preprocess/multi_batch_options.cc b/ge/graph/preprocess/multi_batch_options.cc index 8aab0981..84f38fa6 100644 --- a/ge/graph/preprocess/multi_batch_options.cc +++ b/ge/graph/preprocess/multi_batch_options.cc @@ -435,7 +435,7 @@ Status CheckDynamicParams(const vector> &shapes) { "E10035", {"shapesize", "minshapesize"}, {std::to_string(shapes.size()), std::to_string(kMinShapesCount - 1)}); GELOGE(PARAM_INVALID, "Input parameter[--dynamic_batch_size, --dynamic_image_size or --dynamic_dims]'s " - "value size [%zu] must be greater than [%zu].", + "value size [%zu] must be greater than [%d].", shapes.size(), kMinShapesCount - 1); return PARAM_INVALID; } @@ -444,7 +444,7 @@ Status CheckDynamicParams(const vector> &shapes) { "E10036", {"shapesize", "maxshapesize"}, {std::to_string(shapes.size()), std::to_string(kMaxShapesCount + 1)}); GELOGE(PARAM_INVALID, "Input parameter[--dynamic_batch_size, --dynamic_image_size or --dynamic_dims]'s " - "value size [%zu] must be less than [%zu].", + "value size [%zu] must be less than [%d].", shapes.size(), kMaxShapesCount + 1); return PARAM_INVALID; } diff --git a/ge/host_kernels/dynamic_stitch_kernel.cc b/ge/host_kernels/dynamic_stitch_kernel.cc index 32611b03..3037934e 100644 --- a/ge/host_kernels/dynamic_stitch_kernel.cc +++ b/ge/host_kernels/dynamic_stitch_kernel.cc @@ -126,10 +126,10 @@ void DynamicStitchKernel::ComputeMergedShape(const vector &inp vector merged_dim_vec = {merged_first_dim + 1}; if (step > 0) { merged_dim_vec.emplace_back(step); - GELOGD("merged_shape is [ %ld, %ld].", merged_first_dim, step); + GELOGD("merged_shape is [ %d, %ld].", merged_first_dim, step); } merged_shape = GeShape(merged_dim_vec); - GELOGD("merged_shape is [ %ld ].", merged_first_dim); + GELOGD("merged_shape is [ %d ].", merged_first_dim); } Status DynamicStitchKernel::GenData(const vector &input, GeTensorPtr &output_ptr) { @@ -196,14 +196,14 @@ Status DynamicStitchKernel::StitchDataFollowIndices(int64_t data_unit, const vec // if index repeated, need new data replace old data , so give more allowance if (indices_set.find(input_indices[j]) != indices_set.end()) { if (ge::CheckInt64AddOverflow(input_indices[j], data_unit) != SUCCESS) { - GELOGW("Check int64 mul overflow failed. Indices is %ld, data_unit is %ld.", input_indices[j], data_unit); + GELOGW("Check int64 mul overflow failed. Indices is %d, data_unit is %ld.", input_indices[j], data_unit); return NOT_CHANGED; } allowance += data_unit; } indices_set.insert(input_indices[j]); if (!CheckInt64MulOverflow(input_indices[j], data_unit)) { - GELOGW("Check int64 mul overflow failed. Indices is %ld, data_unit is %ld.", input_indices[j], data_unit); + GELOGW("Check int64 mul overflow failed. Indices is %d, data_unit is %ld.", input_indices[j], data_unit); return NOT_CHANGED; } dst_offset = input_indices[j] * data_unit; diff --git a/ge/host_kernels/pack_kernel.cc b/ge/host_kernels/pack_kernel.cc index 476005ef..bf7a2a1f 100644 --- a/ge/host_kernels/pack_kernel.cc +++ b/ge/host_kernels/pack_kernel.cc @@ -124,7 +124,7 @@ Status PackKernel::ValidateInputs(const ge::OpDescPtr &op_desc_ptr, const std::v int64_t num = 1; for (auto dim : dst_shape.GetDims()) { if (dim < 0) { - GELOGW("Invalid dim ld% in the shape %s", dim, formats::ShapeToString(shape).c_str()); + GELOGW("Invalid dim %ld in the shape %s", dim, formats::ShapeToString(shape).c_str()); return NOT_CHANGED; } num *= dim; diff --git a/ge/host_kernels/rank_kernel.cc b/ge/host_kernels/rank_kernel.cc index 1de9478c..b246b976 100755 --- a/ge/host_kernels/rank_kernel.cc +++ b/ge/host_kernels/rank_kernel.cc @@ -42,7 +42,7 @@ Status RankKernel::Compute(const NodePtr &node, std::vector &v_outp GE_CHECK_NOTNULL(op_desc); size_t input_node_size = op_desc->GetInputsSize(); if (input_node_size != kRankInputSize) { - GELOGW("input node size must be %d", kRankInputSize); + GELOGW("input node size must be %zu", kRankInputSize); return NOT_CHANGED; } diff --git a/ge/host_kernels/strided_slice_kernel.cc b/ge/host_kernels/strided_slice_kernel.cc index b1bfb10a..c7e4b2c8 100644 --- a/ge/host_kernels/strided_slice_kernel.cc +++ b/ge/host_kernels/strided_slice_kernel.cc @@ -250,16 +250,16 @@ Status StridedSliceKernel::InitParamWithAttrs(const std::vectorsecond.emplace_back(index); } else { diff --git a/ge/single_op/task/op_task.cc b/ge/single_op/task/op_task.cc index 1772ca88..82303894 100755 --- a/ge/single_op/task/op_task.cc +++ b/ge/single_op/task/op_task.cc @@ -507,7 +507,7 @@ Status AiCpuBaseTask::UpdateIoAddr(const vector &inputs, const vecto if (input_index < input_is_const_.size() && input_is_const_[input_index]) { // const input no need update addr GE_CHECK_NOTNULL(arg_base); - GELOGD("AICpuTask input[%zu] addr = %u", input_index, *arg_base); + GELOGD("AICpuTask input[%zu] addr = %lu", input_index, *arg_base); arg_base++; continue; } @@ -710,7 +710,7 @@ Status AiCpuTask::UpdateShapeAndDataByResultSummary(vector &output Status AiCpuTask::InitForSummaryAndCopy() { if (unknown_type_ != DEPEND_COMPUTE || num_outputs_ == 0) { - GELOGI("Unknown_type is %d, output num is %d.", unknown_type_, num_outputs_); + GELOGI("Unknown_type is %d, output num is %zu.", unknown_type_, num_outputs_); return SUCCESS; } diff --git a/tests/depends/omg/src/omg_stub.cc b/tests/depends/omg/src/omg_stub.cc index a6221570..13ddf8bb 100644 --- a/tests/depends/omg/src/omg_stub.cc +++ b/tests/depends/omg/src/omg_stub.cc @@ -315,7 +315,7 @@ long GetFileLength(const std::string &input_file) { GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(mmGetFileSize(input_file.c_str(), &file_length) != EN_OK, return -1, "open file failed."); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG((file_length <= 0), return -1, "file length <= 0, not valid."); - GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(file_length > MAX_FILE_SIZE_LIMIT, return -1, "file size %ld is out of limit: %d.", + GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(file_length > MAX_FILE_SIZE_LIMIT, return -1, "file size %llu is out of limit: %d.", file_length, MAX_FILE_SIZE_LIMIT); return file_length; } diff --git a/tests/ut/ge/graph/passes/variable_op_pass_unittest.cc b/tests/ut/ge/graph/passes/variable_op_pass_unittest.cc index b51908e2..d6af6de9 100644 --- a/tests/ut/ge/graph/passes/variable_op_pass_unittest.cc +++ b/tests/ut/ge/graph/passes/variable_op_pass_unittest.cc @@ -849,7 +849,7 @@ class VariableOpPassSimulator { if (variable_ref_node_format != FORMAT_NC1HWC0 || variable_ref_node_data_type != DT_FLOAT || variable_ref_node_shape.size() != 5) { GELOGI("wanted data format is (%d,%d,%u)", FORMAT_NC1HWC0, DT_FLOAT, 5); - GELOGI("variable_ref_node_format is (%d,%d,%u)", variable_ref_node_format, variable_ref_node_data_type, + GELOGI("variable_ref_node_format is (%d,%d,%zu)", variable_ref_node_format, variable_ref_node_data_type, variable_ref_node_shape.size()); std::cout << "var ref format not changed !" << std::endl; @@ -918,7 +918,7 @@ class VariableOpPassSimulator { if (variable_ref_node_format != FORMAT_NCHW || variable_ref_node_data_type != DT_INT32 || variable_ref_node_shape.size() != 4) { GELOGI("wanted data format is (%d,%d,%u)", FORMAT_NCHW, DT_INT32, 4); - GELOGI("variable_ref_node_format is (%d,%d,%u)", variable_ref_node_format, variable_ref_node_data_type, + GELOGI("variable_ref_node_format is (%d,%d,%zu)", variable_ref_node_format, variable_ref_node_data_type, variable_ref_node_shape.size()); std::cout << "var ref format not changed !" << std::endl;