change log level

This commit is contained in:
lby 2022-04-06 09:35:21 +08:00
parent a3d391ae70
commit 519e78bd4c
3 changed files with 16 additions and 12 deletions

View File

@ -553,6 +553,7 @@ constexpr auto kAttrInterProcessEdgeName = "inter_process_edge_name";
constexpr auto kAttrForwardOpOutputId = "forward_op_output_id";
constexpr auto kAttrGroupRankIds = "group_rank_ids";
constexpr auto kAttrReuseCommunication = "reuse_communication_node";
constexpr auto kAttrPrecisionFlag = "precision_flag";
// TODO(dsj): for ms_function running in graph_mode. should be delete later
constexpr auto kAttrMSFunction = "ms_function_graph";

View File

@ -803,6 +803,14 @@ void PrintNotMatchMessage(const std::vector<std::shared_ptr<kernel::KernelBuildI
}
}
void SetRaiseOrReduceFlag(const CNodePtr &kernel_node, KernelSelectStatus status) {
if (status == kStatusRaisePrecision) {
common::AnfAlgo::SetNodeAttr(kAttrPrecisionFlag, MakeValue("raise"), kernel_node);
} else if (status == kStatusReducePrecision) {
common::AnfAlgo::SetNodeAttr(kAttrPrecisionFlag, MakeValue("reduce"), kernel_node);
}
}
KernelSelectStatus SelectKernelInfo(const CNodePtr &kernel_node, KernelType kernel_type) {
std::vector<std::shared_ptr<kernel::KernelBuildInfo>> kernel_info_list;
std::vector<std::shared_ptr<kernel::KernelBuildInfo>> aicpu_kernel_info_list;
@ -851,6 +859,7 @@ KernelSelectStatus SelectKernelInfo(const CNodePtr &kernel_node, KernelType kern
GatherInputAndOutputInferType(aicpu_in_out_info, kernel_node);
PrintNotMatchMessage(kernel_info_list, aicpu_kernel_info_list, aicore_in_out_info, aicpu_in_out_info, kernel_node);
}
SetRaiseOrReduceFlag(kernel_node, select_status);
return select_status;
}

View File

@ -336,10 +336,6 @@ std::vector<T> PaddingShapeTo5dDefault(const std::vector<T> &shape, const AnfNod
if (shape.size() >= kDim5) {
return shape;
}
if (node != nullptr) {
MS_LOG(INFO) << "Start padding shape to 5d by default reshape type, node [" << node->fullname_with_scope()
<< "], detail info: " << node->DebugString();
}
std::vector<T> shape_5d(kNcdhw, 1);
switch (shape.size()) {
case N_ncdhw:
@ -363,7 +359,8 @@ std::vector<T> PaddingShapeTo5dDefault(const std::vector<T> &shape, const AnfNod
shape_5d[W_ncdhw] = shape[H_ncdhw];
break;
default:
MS_LOG(EXCEPTION) << "Unexpected shape :" << shape;
auto node_info = (node != nullptr) ? ". Node: " + node->fullname_with_scope() : " .";
MS_LOG(EXCEPTION) << "Unexpected shape :" << shape << node_info;
}
return shape_5d;
}
@ -373,10 +370,6 @@ std::vector<T> PaddingShapeTo5dDefault(const std::vector<T> &shape, const AnfNod
* */
template <typename T>
std::vector<T> PaddingShapeTo4dDefault(const std::vector<T> &shape, const AnfNodePtr &node = nullptr) {
if (node != nullptr) {
MS_LOG(INFO) << "Start padding shape to 4d by default reshape type, node [" << node->fullname_with_scope()
<< "], detail info: " << node->DebugString();
}
std::vector<T> shape_4d(kNchwDims, 1);
switch (shape.size()) {
case kN:
@ -397,7 +390,8 @@ std::vector<T> PaddingShapeTo4dDefault(const std::vector<T> &shape, const AnfNod
(void)std::copy(shape.begin(), shape.end(), shape_4d.begin());
break;
default:
MS_LOG(EXCEPTION) << "Unexpected shape : " << shape;
auto node_info = (node != nullptr) ? ". Node: " + node->fullname_with_scope() : " .";
MS_LOG(EXCEPTION) << "Unexpected shape : " << shape << node_info;
}
return shape_4d;
}
@ -443,8 +437,8 @@ template <typename T>
std::vector<T> PaddingShape(const std::vector<T> &shape, const std::string &format, const std::string &pad_index = {""},
const AnfNodePtr &node = nullptr) {
if (node != nullptr) {
MS_LOG(INFO) << "Start padding shape for node: [" << node->fullname_with_scope() << "], format: " << format
<< ", detail info: " << node->DebugString();
MS_LOG(DEBUG) << "Start padding shape for node: [" << node->fullname_with_scope() << "], format: " << format
<< ", detail info: " << node->DebugString();
}
std::vector<T> host_shape;
if (k3DFormatSet.find(format) != k3DFormatSet.end()) {