From 6d3d0c91c7881422552c27034c46115adf4fcbeb Mon Sep 17 00:00:00 2001 From: "wangwenhua1@huawei.com" Date: Mon, 21 Dec 2020 19:43:29 +0800 Subject: [PATCH] dump add origin shape --- ge/common/dump/dump_op.cc | 15 ++++++++++++++- ge/common/proto/op_mapping_info.proto | 2 ++ ge/executor/proto/op_mapping_info.proto | 2 ++ ge/graph/load/new_model_manager/data_dumper.cc | 6 ++++++ ge/proto/op_mapping_info.proto | 2 ++ metadef | 2 +- parser | 2 +- 7 files changed, 28 insertions(+), 3 deletions(-) diff --git a/ge/common/dump/dump_op.cc b/ge/common/dump/dump_op.cc index e92ada05..4b451dd6 100755 --- a/ge/common/dump/dump_op.cc +++ b/ge/common/dump/dump_op.cc @@ -94,6 +94,9 @@ Status DumpOp::DumpOutput(aicpu::dump::Task &task) { for (auto dim : output_descs.at(i).GetShape().GetDims()) { output.mutable_shape()->add_dim(dim); } + for (auto dim : output_descs.at(i).GetOriginShape().GetDims()) { + output.mutable_origin_shape()->add_dim(dim); + } int64_t output_size = 0; if (TensorUtils::GetTensorSizeInBytes(output_descs.at(i), output_size) != SUCCESS) { GELOGE(PARAM_INVALID, "Get output size filed"); @@ -118,6 +121,9 @@ Status DumpOp::DumpInput(aicpu::dump::Task &task) { for (auto dim : input_descs.at(i).GetShape().GetDims()) { input.mutable_shape()->add_dim(dim); } + for (auto dim : input_descs.at(i).GetOriginShape().GetDims()) { + input.mutable_origin_shape()->add_dim(dim); + } int64_t input_size = 0; if (TensorUtils::GetTensorSizeInBytes(input_descs.at(i), input_size) != SUCCESS) { GELOGE(PARAM_INVALID, "Get output size filed"); @@ -214,8 +220,15 @@ Status DumpOp::LaunchDumpOp() { SetOpMappingLoopAddr(global_step_, loop_per_iter_, loop_cond_, op_mapping_info); GELOGI("Dump step is %s ,dump path is %s ,in Launch dump op", dump_properties_.GetDumpStep().c_str(), dump_path.c_str()); - + uint32_t task_id = 0; + uint32_t stream_id = 0; + rt_ret = rtGetTaskIdAndStreamID(&task_id, &stream_id); + if (rt_ret != RT_ERROR_NONE) { + GELOGE(RT_FAILED, "call rtGetTaskIdAndStreamID failed, ret = 0x%X", rt_ret); + } aicpu::dump::Task task; + task.set_task_id(task_id); + task.set_stream_id(stream_id); task.mutable_op()->set_op_name(op_desc_->GetName()); task.mutable_op()->set_op_type(op_desc_->GetType()); if (dump_properties_.GetDumpMode() == kDumpOutput) { diff --git a/ge/common/proto/op_mapping_info.proto b/ge/common/proto/op_mapping_info.proto index e23b7ebe..7fb6f84b 100644 --- a/ge/common/proto/op_mapping_info.proto +++ b/ge/common/proto/op_mapping_info.proto @@ -15,6 +15,7 @@ message Output { int32 original_output_data_type = 7; int32 original_output_format = 8; uint64 size = 9; + Shape origin_shape = 10; } message Input { @@ -23,6 +24,7 @@ message Input { Shape shape = 3; uint64 address = 4; uint64 size = 5; + Shape origin_shape = 6; } enum BufferType { diff --git a/ge/executor/proto/op_mapping_info.proto b/ge/executor/proto/op_mapping_info.proto index e23b7ebe..7fb6f84b 100644 --- a/ge/executor/proto/op_mapping_info.proto +++ b/ge/executor/proto/op_mapping_info.proto @@ -15,6 +15,7 @@ message Output { int32 original_output_data_type = 7; int32 original_output_format = 8; uint64 size = 9; + Shape origin_shape = 10; } message Input { @@ -23,6 +24,7 @@ message Input { Shape shape = 3; uint64 address = 4; uint64 size = 5; + Shape origin_shape = 6; } enum BufferType { diff --git a/ge/graph/load/new_model_manager/data_dumper.cc b/ge/graph/load/new_model_manager/data_dumper.cc index b331d780..6f65e907 100644 --- a/ge/graph/load/new_model_manager/data_dumper.cc +++ b/ge/graph/load/new_model_manager/data_dumper.cc @@ -319,6 +319,9 @@ Status DataDumper::GenerateOutput(aicpu::dump::Output &output, const OpDesc::Vis for (auto dim : tensor_descs.at(index).GetShape().GetDims()) { output.mutable_shape()->add_dim(dim); } + for (auto dim : tensor_descs.at(index).GetOriginShape().GetDims()) { + output.mutable_origin_shape()->add_dim(dim); + } int64_t output_size = 0; if (TensorUtils::GetTensorSizeInBytes(tensor_descs.at(index), output_size) != SUCCESS) { GELOGE(PARAM_INVALID, "Get output size filed"); @@ -476,6 +479,9 @@ Status DataDumper::GenerateInput(aicpu::dump::Input &input, const OpDesc::Vistor for (auto dim : tensor_descs.at(index).GetShape().GetDims()) { input.mutable_shape()->add_dim(dim); } + for (auto dim : tensor_descs.at(index).GetOriginShape().GetDims()) { + input.mutable_origin_shape()->add_dim(dim); + } int64_t input_size = 0; if (AttrUtils::GetInt(tensor_descs.at(index), ATTR_NAME_INPUT_ORIGIN_SIZE, input_size)) { GELOGI("Get aipp input size according to attr is %ld", input_size); diff --git a/ge/proto/op_mapping_info.proto b/ge/proto/op_mapping_info.proto index e23b7ebe..7fb6f84b 100644 --- a/ge/proto/op_mapping_info.proto +++ b/ge/proto/op_mapping_info.proto @@ -15,6 +15,7 @@ message Output { int32 original_output_data_type = 7; int32 original_output_format = 8; uint64 size = 9; + Shape origin_shape = 10; } message Input { @@ -23,6 +24,7 @@ message Input { Shape shape = 3; uint64 address = 4; uint64 size = 5; + Shape origin_shape = 6; } enum BufferType { diff --git a/metadef b/metadef index 5546f5f4..191b7ad1 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 5546f5f4701130f2dd11a6d69817dc37d52c497e +Subproject commit 191b7ad10e99d0b8d800ce85dae3ef7a2a146870 diff --git a/parser b/parser index 866d6a2b..8317ba6e 160000 --- a/parser +++ b/parser @@ -1 +1 @@ -Subproject commit 866d6a2b45ab00a08fbb9b07b5ef04722730c946 +Subproject commit 8317ba6e886da54f4f161bf4a7fc40de27d6ce3c