!9000 add trace info for cpu

From: @kisnwang
Reviewed-by: @jjfeing,@chujinjin
Signed-off-by: @jjfeing
pull/9000/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit d79961e11c

@ -19,6 +19,7 @@
#include <sstream>
#include "ir/anf.h"
#include "utils/ms_utils.h"
#include "utils/trace_base.h"
#include "backend/session/anf_runtime_algorithm.h"
#include "runtime/device/kernel_runtime.h"
#include "backend/kernel_compiler/cpu/cpu_kernel_factory.h"
@ -174,7 +175,7 @@ void KernelNotSupportException(const AnfNodePtr &kernel_node) {
operator_info << ") ";
}
operator_info << "is not support.";
MS_LOG(EXCEPTION) << operator_info.str();
MS_LOG(EXCEPTION) << operator_info.str() << " Trace: " << trace::DumpSourceLines(kernel_node);
}
} // namespace

@ -28,6 +28,7 @@
#include "frontend/operator/ops.h"
#include "utils/shape_utils.h"
#include "utils/profile.h"
#include "utils/trace_base.h"
namespace mindspore {
namespace device {
@ -350,7 +351,7 @@ bool CPUKernelRuntime::Run(session::KernelGraph *kernel_graph, bool is_task_sink
auto ret = kernel_mod->Launch(kernel_inputs, kernel_workspaces, kernel_outputs, 0);
resource_manager_.DecreaseAddressRefCount(kernel);
if (!ret) {
MS_LOG(EXCEPTION) << "Launch kernel failed.";
MS_LOG(EXCEPTION) << "Launch kernel failed. Trace:" << trace::DumpSourceLines(kernel);
}
#ifdef ENABLE_PROFILE
double cost_time = GetTime() - start_time;

@ -15,13 +15,11 @@
*/
#include "runtime/device/cpu/kernel_select_cpu.h"
#include <string>
#include <memory>
#include <algorithm>
#include "backend/kernel_compiler/cpu/cpu_kernel_factory.h"
#include "utils/trace_base.h"
namespace mindspore {
namespace device {
namespace cpu {
@ -234,7 +232,7 @@ void KernelNotSupportException(const AnfNodePtr &kernel_node, const std::vector<
operator_info << ") ";
}
operator_info << "is not support.";
MS_EXCEPTION(TypeError) << operator_info.str();
MS_EXCEPTION(TypeError) << operator_info.str() << " Trace: " << trace::DumpSourceLines(kernel_node);
}
} // namespace
bool SelectKernel(const CNodePtr &kernel_node, KernelAttr *selected_kernel_attr,
@ -298,7 +296,8 @@ void SetKernelInfo(const CNodePtr &kernel_node) {
auto kernel_attrs =
kernel::CPUKernelFactory::GetInstance().GetSupportedKernelAttrList(AnfAlgo::GetCNodeName(kernel_node));
if (kernel_attrs.empty()) {
MS_LOG(EXCEPTION) << "Operator[" << AnfAlgo::GetCNodeName(kernel_node) << "] is not support.";
MS_LOG(EXCEPTION) << "Operator[" << AnfAlgo::GetCNodeName(kernel_node)
<< "] is not support. Trace: " << trace::DumpSourceLines(kernel_node);
}
GetInputFormatsAndDtypes(kernel_node, &input_formats, &input_types, &input_not_cnode_indexes);
GetOutputInferFormatsAndDtypes(kernel_node, &infer_output_formats, &infer_output_types);

Loading…
Cancel
Save