diff --git a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc index 8cd2683a5a7..66c5812ca42 100644 --- a/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc +++ b/mindspore/ccsrc/plugin/device/ascend/kernel/tbe/tbe_utils.cc @@ -131,7 +131,7 @@ std::string GetOpDebugLevel() { } nlohmann::json TbeUtils::GenSocInfo() { - static nlohmann::json soc_info_json; + static nlohmann::json soc_info_json = nlohmann::json(); if (!soc_info_json.empty()) { return soc_info_json; } diff --git a/mindspore/ccsrc/plugin/device/ascend/optimizer/mindir/neighbor_exchange_v2_unify_mindir.cc b/mindspore/ccsrc/plugin/device/ascend/optimizer/mindir/neighbor_exchange_v2_unify_mindir.cc index 68c52620d59..345c5be4d18 100644 --- a/mindspore/ccsrc/plugin/device/ascend/optimizer/mindir/neighbor_exchange_v2_unify_mindir.cc +++ b/mindspore/ccsrc/plugin/device/ascend/optimizer/mindir/neighbor_exchange_v2_unify_mindir.cc @@ -127,7 +127,6 @@ CNodePtr CreateSplitNode(const FuncGraphPtr &graph, const std::vector(split_dim), split_v); + common::AnfAlgo::SetNodeAttr(kAttrSplitDim, MakeValue(SizeToLong(split_dim)), split_v); common::AnfAlgo::SetNodeAttr(kAttrNumSplit, MakeValue(*num_split), split_v); common::AnfAlgo::SetNodeAttr(kAttrSizeSplits, MakeValue>(size_splits), split_v); common::AnfAlgo::SetNodeAttr("is_backend_insert", MakeValue(true), split_v); @@ -562,9 +561,9 @@ CNodePtr NeighborExchangeV2UnifyMindIR::CreateLeftRightConcat(const FuncGraphPtr all_to_all_v_outputs.begin() + input_num + AllToAllRealIds(1, recv_rank_ids)); } - std::vector concat_output_dtype = { - common::AnfAlgo::GetOutputInferDataType(all_to_all_v_outputs[AllToAllRealIds(middle_ids, recv_rank_ids)], 0)}; - auto concat = CreateConcatNode(graph, concat_input, kHDim, input_num); + std::vector concat_output_dtype = {common::AnfAlgo::GetOutputInferDataType( + all_to_all_v_outputs[LongToSize(AllToAllRealIds(middle_ids, recv_rank_ids))], 0)}; + auto concat = CreateConcatNode(graph, concat_input, SizeToLong(kHDim), input_num); if (is_dynamic) { ShapeVector shape; std::transform(single_shape.begin(), single_shape.end(), std::back_inserter(shape), SizeToLong); @@ -614,7 +613,7 @@ CNodePtr NeighborExchangeV2UnifyMindIR::CreateMiddleConcat( (void)concat_input_all.insert(concat_input_all.end(), all_to_all_v_outputs.begin(), all_to_all_v_outputs.begin() + 1); } else { - int64_t bottom_num = AllToAllRealIds(4, recv_rank_ids); + int64_t bottom_num = AllToAllRealIds(kRankIdFour, recv_rank_ids); (void)concat_input_all.insert(concat_input_all.end(), all_to_all_v_outputs.begin() + bottom_num, all_to_all_v_outputs.begin() + bottom_num + 1); }