Browse Source

dump add origin shape

tags/v1.2.0
wangwenhua1@huawei.com 3 years ago
parent
commit
6d3d0c91c7
7 changed files with 28 additions and 3 deletions
  1. +14
    -1
      ge/common/dump/dump_op.cc
  2. +2
    -0
      ge/common/proto/op_mapping_info.proto
  3. +2
    -0
      ge/executor/proto/op_mapping_info.proto
  4. +6
    -0
      ge/graph/load/new_model_manager/data_dumper.cc
  5. +2
    -0
      ge/proto/op_mapping_info.proto
  6. +1
    -1
      metadef
  7. +1
    -1
      parser

+ 14
- 1
ge/common/dump/dump_op.cc View File

@@ -94,6 +94,9 @@ Status DumpOp::DumpOutput(aicpu::dump::Task &task) {
for (auto dim : output_descs.at(i).GetShape().GetDims()) { for (auto dim : output_descs.at(i).GetShape().GetDims()) {
output.mutable_shape()->add_dim(dim); 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; int64_t output_size = 0;
if (TensorUtils::GetTensorSizeInBytes(output_descs.at(i), output_size) != SUCCESS) { if (TensorUtils::GetTensorSizeInBytes(output_descs.at(i), output_size) != SUCCESS) {
GELOGE(PARAM_INVALID, "Get output size filed"); 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()) { for (auto dim : input_descs.at(i).GetShape().GetDims()) {
input.mutable_shape()->add_dim(dim); 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; int64_t input_size = 0;
if (TensorUtils::GetTensorSizeInBytes(input_descs.at(i), input_size) != SUCCESS) { if (TensorUtils::GetTensorSizeInBytes(input_descs.at(i), input_size) != SUCCESS) {
GELOGE(PARAM_INVALID, "Get output size filed"); 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); 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(), GELOGI("Dump step is %s ,dump path is %s ,in Launch dump op", dump_properties_.GetDumpStep().c_str(),
dump_path.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; 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_name(op_desc_->GetName());
task.mutable_op()->set_op_type(op_desc_->GetType()); task.mutable_op()->set_op_type(op_desc_->GetType());
if (dump_properties_.GetDumpMode() == kDumpOutput) { if (dump_properties_.GetDumpMode() == kDumpOutput) {


+ 2
- 0
ge/common/proto/op_mapping_info.proto View File

@@ -15,6 +15,7 @@ message Output {
int32 original_output_data_type = 7; int32 original_output_data_type = 7;
int32 original_output_format = 8; int32 original_output_format = 8;
uint64 size = 9; uint64 size = 9;
Shape origin_shape = 10;
} }


message Input { message Input {
@@ -23,6 +24,7 @@ message Input {
Shape shape = 3; Shape shape = 3;
uint64 address = 4; uint64 address = 4;
uint64 size = 5; uint64 size = 5;
Shape origin_shape = 6;
} }


enum BufferType { enum BufferType {


+ 2
- 0
ge/executor/proto/op_mapping_info.proto View File

@@ -15,6 +15,7 @@ message Output {
int32 original_output_data_type = 7; int32 original_output_data_type = 7;
int32 original_output_format = 8; int32 original_output_format = 8;
uint64 size = 9; uint64 size = 9;
Shape origin_shape = 10;
} }


message Input { message Input {
@@ -23,6 +24,7 @@ message Input {
Shape shape = 3; Shape shape = 3;
uint64 address = 4; uint64 address = 4;
uint64 size = 5; uint64 size = 5;
Shape origin_shape = 6;
} }


enum BufferType { enum BufferType {


+ 6
- 0
ge/graph/load/new_model_manager/data_dumper.cc View File

@@ -319,6 +319,9 @@ Status DataDumper::GenerateOutput(aicpu::dump::Output &output, const OpDesc::Vis
for (auto dim : tensor_descs.at(index).GetShape().GetDims()) { for (auto dim : tensor_descs.at(index).GetShape().GetDims()) {
output.mutable_shape()->add_dim(dim); 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; int64_t output_size = 0;
if (TensorUtils::GetTensorSizeInBytes(tensor_descs.at(index), output_size) != SUCCESS) { if (TensorUtils::GetTensorSizeInBytes(tensor_descs.at(index), output_size) != SUCCESS) {
GELOGE(PARAM_INVALID, "Get output size filed"); 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()) { for (auto dim : tensor_descs.at(index).GetShape().GetDims()) {
input.mutable_shape()->add_dim(dim); 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; int64_t input_size = 0;
if (AttrUtils::GetInt(tensor_descs.at(index), ATTR_NAME_INPUT_ORIGIN_SIZE, input_size)) { 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); GELOGI("Get aipp input size according to attr is %ld", input_size);


+ 2
- 0
ge/proto/op_mapping_info.proto View File

@@ -15,6 +15,7 @@ message Output {
int32 original_output_data_type = 7; int32 original_output_data_type = 7;
int32 original_output_format = 8; int32 original_output_format = 8;
uint64 size = 9; uint64 size = 9;
Shape origin_shape = 10;
} }


message Input { message Input {
@@ -23,6 +24,7 @@ message Input {
Shape shape = 3; Shape shape = 3;
uint64 address = 4; uint64 address = 4;
uint64 size = 5; uint64 size = 5;
Shape origin_shape = 6;
} }


enum BufferType { enum BufferType {


+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit 5546f5f4701130f2dd11a6d69817dc37d52c497e
Subproject commit 191b7ad10e99d0b8d800ce85dae3ef7a2a146870

+ 1
- 1
parser

@@ -1 +1 @@
Subproject commit 866d6a2b45ab00a08fbb9b07b5ef04722730c946
Subproject commit 8317ba6e886da54f4f161bf4a7fc40de27d6ce3c

Loading…
Cancel
Save