Merge pull request !1456 from ldy2021/master
pull/1456/MERGE
计晨 4 years ago committed by Gitee
commit 5057512666

@ -41,8 +41,7 @@ NpuMemoryAllocator *NpuMemoryAllocator::GetAllocator() {
auto rt_result = rtGetDevice(&device_id);
if (rt_result != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "[Get][Device] Failed, result:%d.", rt_result);
REPORT_INNER_ERROR("E19999", "rtGetDevice failed when NpuMemoryAllocator %s, result:%d.",
__FUNCTION__, rt_result);
REPORT_INNER_ERROR("E19999", "rtGetDevice failed, result:%d.", rt_result);
return nullptr;
}
@ -62,8 +61,7 @@ void *NpuMemoryAllocator::Allocate(std::size_t size, AllocationAttr *attr) {
if (allocate_size == 0) {
GELOGE(MEMALLOC_FAILED, "[Check][Param:size_t]Memory size is 0, device_id = %u, size = %zu.",
device_id_, allocate_size);
REPORT_INNER_ERROR("E19999", "Memory size is 0, device_id = %u, size = %zu when %s.",
device_id_, allocate_size, __FUNCTION__);
REPORT_INNER_ERROR("E19999", "Memory size is 0, device_id = %u, size = %zu.", device_id_, allocate_size);
return nullptr;
}
@ -76,8 +74,8 @@ void *NpuMemoryAllocator::Allocate(std::size_t size, AllocationAttr *attr) {
if (allocate_size > kMaxHbmMemorySize) {
GELOGE(PARAM_INVALID, "[Check][Param:size_t]Invalid HBM memory size: %zu bigger than limit:%lu, check invalid.",
allocate_size, kMaxHbmMemorySize);
REPORT_CALL_ERROR("E19999", "Invalid HBM memory size: %zu bigger than limit:%lu, check invalid when %s.",
allocate_size, kMaxHbmMemorySize, __FUNCTION__);
REPORT_CALL_ERROR("E19999", "Invalid HBM memory size: %zu bigger than limit:%lu, check invalid.",
allocate_size, kMaxHbmMemorySize);
return nullptr;
}
void *try_reuse_addr = nullptr;
@ -96,10 +94,10 @@ void *NpuMemoryAllocator::Allocate(std::size_t size, AllocationAttr *attr) {
.Malloc(allocate_size, reinterpret_cast<uint8_t *>(try_reuse_addr), device_id_);
}
if (buffer == nullptr) {
GELOGE(MEMALLOC_FAILED, "[Malloc][Memory] Failed, device_id = %u, size = %zu.",
GELOGE(MEMALLOC_FAILED, "[Malloc][Memory] Failed, device_id = %u, size = %zu",
device_id_, allocate_size);
REPORT_CALL_ERROR("E19999", "malloc memory failed, device_id = %u, size = %zu",
device_id_, allocate_size);
REPORT_CALL_ERROR("E19999", "malloc memory failed, device_id = %u, size = %zu when %s.",
device_id_, allocate_size, __FUNCTION__);
return nullptr;
}

@ -33,7 +33,7 @@ std::unique_ptr<TensorBuffer> TensorBuffer::Create(NpuMemoryAllocator *allocator
if (allocator == nullptr) {
GELOGE(INTERNAL_ERROR, "[Check][Param:NpuMemoryAllocator] allocator is NULL.");
REPORT_INNER_ERROR("E19999", "input allocator is NULL, when %s.", __FUNCTION__);
REPORT_INNER_ERROR("E19999", "input allocator is NULL.");
return nullptr;
}
@ -44,7 +44,7 @@ std::unique_ptr<TensorBuffer> TensorBuffer::Create(NpuMemoryAllocator *allocator
buffer = allocator->Allocate(size, attr);
if (buffer == nullptr) {
GELOGE(MEMALLOC_FAILED, "[Allocate][Memory] Failed. size = %zu.", size);
REPORT_CALL_ERROR("E19999", "allocate failed, size = %zu, when %s.", size, __FUNCTION__);
REPORT_CALL_ERROR("E19999", "allocate failed, size = %zu.", size);
return nullptr;
}

@ -60,8 +60,7 @@ Status GraphExecutionContext::Synchronize(rtStream_t rt_stream) {
}
GELOGE(RT_FAILED, "[Invoke][rtStreamSynchronize] failed, ret = %d", rt_ret);
REPORT_CALL_ERROR("E19999",
"invoke rtStreamSynchronize failed when GraphExecutionContext %s, ret = %d", __FUNCTION__, rt_ret);
REPORT_CALL_ERROR("E19999", "invoke rtStreamSynchronize failed, ret = %d", rt_ret);
return RT_FAILED;
}
} // namespace hybrid

@ -48,8 +48,7 @@ void HybridModelAsyncExecutor::SetModelId(uint32_t model_id) {
Status HybridModelAsyncExecutor::EnqueueData(const shared_ptr<InputDataWrapper> &data) {
if (data_inputer_->Push(data) != SUCCESS) {
REPORT_CALL_ERROR("E19999", "Data queue is full, please call again later when %s, model_id %u.",
__FUNCTION__, model_id_);
REPORT_CALL_ERROR("E19999", "Data queue is full, please call again later, model_id %u.", model_id_);
GELOGE(domi::DATA_QUEUE_ISFULL,
"[Push][Data] Data queue is full, please call again later, model_id %u ", model_id_);
return domi::DATA_QUEUE_ISFULL;
@ -62,8 +61,7 @@ Status HybridModelAsyncExecutor::Start(const std::shared_ptr<ModelListener> &lis
GELOGD("HybridModelExecutor::Start IN, has listener = %d", listener != nullptr);
std::lock_guard<std::mutex> lk(mu_);
if (run_flag_) {
REPORT_INNER_ERROR("E19999",
"Model already started when HybridModelAsyncExecutor %s, model_id:%u.", __FUNCTION__, model_id_);
REPORT_INNER_ERROR("E19999", "Model already started, model_id:%u.", model_id_);
GELOGE(INTERNAL_ERROR, "[Check][RunState] Model already started, model_id:%u.", model_id_);
return INTERNAL_ERROR;
}
@ -209,8 +207,7 @@ Status HybridModelAsyncExecutor::HandleResult(Status exec_ret,
if (exec_ret != SUCCESS) {
GELOGE(exec_ret, "[Check][Param:Status] failed to execute graph. model_id = %u", model_id_);
REPORT_INNER_ERROR("E19999",
"failed to execute graph when HybridModelAsyncExecutor %s. model_id = %u", __FUNCTION__, model_id_);
REPORT_INNER_ERROR("E19999", "failed to execute graph. model_id = %u", model_id_);
return OnComputeDone(data_id, INTERNAL_ERROR, output_tensor_info_list);
}
@ -249,9 +246,8 @@ Status HybridModelAsyncExecutor::PrepareInputs(const InputData &current_data, Hy
GELOGE(PARAM_INVALID,
"[Check][Size]Blob size mismatches, expect at least %zu, but got %zu, model_id = %u",
input_tensor_desc_.size(), current_data.blobs.size(), model_id_);
REPORT_INNER_ERROR("E19999",
"Blob size mismatches, expect at least %zu, but got %zu when HybridModelAsyncExecutor %s, model_id = %u.",
input_tensor_desc_.size(), current_data.blobs.size(), __FUNCTION__, model_id_);
REPORT_INNER_ERROR("E19999", "Blob size mismatches, expect at least %zu, but got %zu, model_id = %u.",
input_tensor_desc_.size(), current_data.blobs.size(), model_id_);
return PARAM_INVALID;
}
@ -266,9 +262,8 @@ Status HybridModelAsyncExecutor::PrepareInputs(const InputData &current_data, Hy
GELOGE(PARAM_INVALID,
"[Check][Range]Shape index out of range, index = %zu, shape size = %zu model_id = %u.",
input_index, current_data.shapes.size(), model_id_);
REPORT_INNER_ERROR("E19999",
"Shape index out of range, index = %zu, shape size = %zu when HybridModelAsyncExecutor %s, model_id = %u.",
input_index, current_data.shapes.size(), __FUNCTION__, model_id_);
REPORT_INNER_ERROR("E19999", "Shape index out of range, index = %zu, shape size = %zu, model_id = %u.",
input_index, current_data.shapes.size(), model_id_);
return PARAM_INVALID;
}
auto &tensor_desc = input_tensor_desc_[input_index];
@ -283,11 +278,11 @@ Status HybridModelAsyncExecutor::PrepareInputs(const InputData &current_data, Hy
}
// range[k].second can be -1
if (shape.GetDim(k) < range[k].first || (range[k].second >= 0 && shape.GetDim(k) > range[k].second)) {
GELOGE(PARAM_INVALID,
"[Check][Range]Dim out of range, shape idx = %zu, dim idx = %zu, dim = %ld, range = [%ld, %ld], model_id = %u.",
GELOGE(PARAM_INVALID, "[Check][Range]Dim out of range, shape idx = %zu, dim idx = %zu,"
"dim = %ld, range = [%ld, %ld], model_id = %u.",
input_index, k, shape.GetDim(k), range[k].first, range[k].second, model_id_);
REPORT_INNER_ERROR("E19999",
"Dim out of range, shape idx = %zu, dim idx = %zu, dim = %ld, range = [%ld, %ld], model_id = %u.",
REPORT_INNER_ERROR("E19999", "Dim out of range, shape idx = %zu, dim idx = %zu, dim = %ld,"
"range = [%ld, %ld], model_id = %u.",
input_index, k, shape.GetDim(k), range[k].first, range[k].second, model_id_);
return PARAM_INVALID;
}
@ -296,7 +291,8 @@ Status HybridModelAsyncExecutor::PrepareInputs(const InputData &current_data, Hy
args.input_desc[input_index] = tensor_desc;
GELOGD("Update shape of input[%zu] to [%s]", input_index, tensor_desc->MutableShape().ToString().c_str());
GE_CHK_GRAPH_STATUS_RET(TensorUtils::GetTensorMemorySizeInBytes(*tensor_desc, tensor_size),
"[Invoke][GetTensorMemorySizeInBytes]Failed to calc tensor size, index = %zu, shape = [%s], model_id = %u.",
"[Invoke][GetTensorMemorySizeInBytes]Failed to calc tensor size,"
"index = %zu, shape = [%s], model_id = %u.",
input_index, tensor_desc->GetShape().ToString().c_str(), model_id_);
GELOGD("Input tensor[%zu] size = %zu", input_index, tensor_size);
}
@ -316,8 +312,8 @@ Status HybridModelAsyncExecutor::PrepareInputs(const InputData &current_data, Hy
if (mem_size < data_buf.length) {
REPORT_INNER_ERROR("E19999",
"input data size(%lu) does not match model required size(%lu) when %s, ret failed, model_id = %u.",
data_buf.length, mem_size, __FUNCTION__, model_id_);
"input data size(%lu) does not match model required size(%lu), ret failed, model_id = %u.",
data_buf.length, mem_size, model_id_);
GELOGE(PARAM_INVALID,
"[Check][Size]input data size(%lu) does not match model required size(%lu), ret failed, model_id = %u.",
data_buf.length, mem_size, model_id_);
@ -393,9 +389,9 @@ Status HybridModelAsyncExecutor::CopyOutputs(HybridModelExecutor::ExecuteArgs &a
GELOGE(INTERNAL_ERROR,
"[Check][Size]Output sizes mismatch. From op_desc = %zu, and from output tensors = %zu, model_id = %u.",
output_tensor_desc_list.size(), output_tensors.size(), model_id_);
REPORT_INNER_ERROR("E19999", "Output sizes mismatch. From op_desc = %zu, and from output tensors = %zu, "
"when HybridModelAsyncExecutor %s, model_id = %u.",
output_tensor_desc_list.size(), output_tensors.size(), __FUNCTION__, model_id_);
REPORT_INNER_ERROR("E19999",
"Output sizes mismatch. From op_desc = %zu, and from output tensors = %zu, model_id = %u.",
output_tensor_desc_list.size(), output_tensors.size(), model_id_);
return INTERNAL_ERROR;
}
@ -410,7 +406,7 @@ Status HybridModelAsyncExecutor::CopyOutputs(HybridModelExecutor::ExecuteArgs &a
tensor_desc->GetFormat(),
tensor_desc->GetDataType(),
output_size),
"Failed to calc tensor size for output[%zu]. shape = [%s], type = %s, format = %s",
"[Calc][TensorMemSize]Failed for output[%zu]. shape = [%s], type = %s, format = %s",
i,
tensor_desc->GetShape().ToString().c_str(),
TypeUtils::DataTypeToSerialString(tensor_desc->GetDataType()).c_str(),
@ -429,10 +425,8 @@ Status HybridModelAsyncExecutor::CopyOutputs(HybridModelExecutor::ExecuteArgs &a
GELOGE(INTERNAL_ERROR,
"[Check][Size]output[%zu] tensor size(%zu) is not enough for output shape [%s], model_id = %u.",
i, output_tensor.GetSize(), tensor_desc->GetShape().ToString().c_str(), model_id_);
REPORT_INNER_ERROR("E19999",
"output[%zu] tensor size(%zu) is not enough for output shape [%s] model_id = %u,"
" when HybridModelAsyncExecutor %s.",
i, output_tensor.GetSize(), tensor_desc->GetShape().ToString().c_str(), model_id_, __FUNCTION__);
REPORT_INNER_ERROR("E19999", "output[%zu] tensor size(%zu) is not enough for output shape [%s] model_id = %u",
i, output_tensor.GetSize(), tensor_desc->GetShape().ToString().c_str(), model_id_);
return INTERNAL_ERROR;
}

@ -69,10 +69,8 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v
task_queue_.Pop(task_info);
GELOGD("[Executor: %d] Got task, stage = %d, iteration = %ld", id_, task_info.stage, task_info.iteration);
if (task_info.iteration >= pipe_config_->iteration_end) {
GELOGE(INTERNAL_ERROR, "[Check][Range][Executor: %d] Unexpected iteration: %ld.",
id_, task_info.iteration);
REPORT_INNER_ERROR("E19999", "[Executor: %d] Unexpected iteration: %ld when StageExecutor %s.",
id_, task_info.iteration, __FUNCTION__);
GELOGE(INTERNAL_ERROR, "[Check][Range][Executor: %d] Unexpected iteration: %ld.", id_, task_info.iteration);
REPORT_INNER_ERROR("E19999", "[Executor: %d] Unexpected iteration: %ld.", id_, task_info.iteration);
return INTERNAL_ERROR;
}
@ -109,8 +107,8 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v
GELOGE(sync_result,
"[Invoke][Synchronize][Executor: %d] Failed to sync result:%d. iteration = %ld",
id_, sync_result, task_info.iteration);
REPORT_CALL_ERROR("E19999", "[Executor: %d] Failed to sync result:%d when StageExecutor %s. iteration = %ld",
id_, sync_result, __FUNCTION__, task_info.iteration);
REPORT_CALL_ERROR("E19999", "[Executor: %d] Failed to sync result:%d. iteration = %ld",
id_, sync_result, task_info.iteration);
context_.profiler->Dump(std::cout);
context_.callback_manager->Destroy();
RuntimeInferenceContext::DestroyContext(std::to_string(context_.context_id));
@ -260,8 +258,7 @@ Status HybridModelPipelineExecutor::Execute(HybridModelExecutor::ExecuteArgs &ar
auto ret = futures[i].get();
if (ret != SUCCESS) {
GELOGE(ret, "[Check][Result][Executor: %zu] Failed to schedule tasks.", i);
REPORT_INNER_ERROR("E19999", "[Executor: %zu] Failed to schedule tasks when HybridModelPipelineExecutor %s.",
i, __FUNCTION__);
REPORT_INNER_ERROR("E19999", "[Executor: %zu] Failed to schedule tasks.", i);
has_error = true;
continue;
}
@ -270,8 +267,7 @@ Status HybridModelPipelineExecutor::Execute(HybridModelExecutor::ExecuteArgs &ar
if (ret != SUCCESS) {
GELOGE(ret, "[Invoke][Synchronize] failed for [Executor: %zu].", i);
REPORT_CALL_ERROR("E19999", "[Executor: %zu] failed to Synchronize result when HybridModelPipelineExecutor %s.",
i, __FUNCTION__);
REPORT_CALL_ERROR("E19999", "[Executor: %zu] failed to Synchronize result.", i);
has_error = true;
continue;
}
@ -288,7 +284,7 @@ Status HybridModelPipelineExecutor::Execute(HybridModelExecutor::ExecuteArgs &ar
if (has_error) {
GELOGE(FAILED, "[Check][Error]Error occurred while execution.");
REPORT_INNER_ERROR("E19999", "Error occurred while execution when HybridModelPipelineExecutor %s.", __FUNCTION__);
REPORT_INNER_ERROR("E19999", "Error occurred while execution.");
return FAILED;
}

@ -41,7 +41,7 @@ void HybridProfiler::RecordEvent(EventType event_type, const char *fmt, ...) {
char buf[kEventDescMax];
if (vsnprintf_s(buf, kEventDescMax, kEventDescMax - 1, fmt, args) == -1) {
GELOGE(FAILED, "[Parse][Param:fmt]Format %s failed.", fmt);
REPORT_CALL_ERROR("E19999", "Parse Format %s failed when HybridProfiler %s.", fmt, __FUNCTION__);
REPORT_CALL_ERROR("E19999", "Parse Format %s failed.", fmt);
va_end(args);
return;
}
@ -51,8 +51,7 @@ void HybridProfiler::RecordEvent(EventType event_type, const char *fmt, ...) {
if (index >= static_cast<int>(events_.size())) {
GELOGE(INTERNAL_ERROR,
"[Check][Range]index out of range. index = %d, max event size = %zu", index, events_.size());
REPORT_INNER_ERROR("E19999", "index out of range when HybridProfiler %s. index = %d, max event size = %zu",
__FUNCTION__, index, events_.size());
REPORT_INNER_ERROR("E19999", "index out of range. index = %d, max event size = %zu", index, events_.size());
return;
}
auto &evt = events_[index];

@ -29,7 +29,7 @@ bool NodeDoneManager::Cond::Await() {
std::chrono::seconds(kDefaultWaitTimeoutInSec),
[&]() { return is_released_ || is_cancelled_; })) {
GELOGE(INTERNAL_ERROR, "[Invoke][wait_for]Wait timed out.");
REPORT_INNER_ERROR("E19999", "wait timed out[%d] when %s.", kDefaultWaitTimeoutInSec, __FUNCTION__);
REPORT_INNER_ERROR("E19999", "wait timed out[%d].", kDefaultWaitTimeoutInSec);
return false;
}

@ -67,10 +67,8 @@ Status ShapeInferenceState::UpdateInputShape(int idx, const GeTensorDesc &target
Format format = input_desc.GetFormat();
DataType data_type = input_desc.GetDataType();
if (TensorUtils::CalcTensorMemSize(shape, format, data_type, tensor_size) != GRAPH_SUCCESS) {
GELOGE(FAILED, "[Invoke][CalcTensorMemSize] failed for [%s].",
node_item.NodeName().c_str());
REPORT_CALL_ERROR("E19999", "CalcTensorMemSize failed for [%s] when ShapeInferenceState %s.",
node_item.NodeName().c_str(), __FUNCTION__);
GELOGE(FAILED, "[Invoke][CalcTensorMemSize] failed for [%s].", node_item.NodeName().c_str());
REPORT_CALL_ERROR("E19999", "CalcTensorMemSize failed for [%s].", node_item.NodeName().c_str());
return FAILED;
}
}
@ -124,19 +122,15 @@ Status ShapeInferenceState::AwaitShapesReady(const GraphExecutionContext &contex
}
if (context.GetStatus() != SUCCESS) {
GELOGE(FAILED, "[Check][Status][%s] Await pending shape cancelled.",
node_item.NodeName().c_str());
REPORT_CALL_ERROR("E19999", "[%s] Await pending shape cancelled when %s.",
node_item.NodeName().c_str(), __FUNCTION__);
GELOGE(FAILED, "[Check][Status][%s] Await pending shape cancelled.", node_item.NodeName().c_str());
REPORT_CALL_ERROR("E19999", "[%s] Await pending shape cancelled.", node_item.NodeName().c_str());
break;
}
}
if (!wait_success) {
GELOGE(FAILED, "[Check][Status][%s] Wait for shape timeout:%d.",
node_item.NodeName().c_str(), kWaitInternal);
REPORT_CALL_ERROR("E19999", "[%s] Wait for shape timeout:%d when %s.",
node_item.NodeName().c_str(), kWaitInternal, __FUNCTION__);
GELOGE(FAILED, "[Check][Status][%s] Wait for shape timeout:%d.", node_item.NodeName().c_str(), kWaitInternal);
REPORT_CALL_ERROR("E19999", "[%s] Wait for shape timeout:%d.", node_item.NodeName().c_str(), kWaitInternal);
return FAILED;
}
}
@ -240,8 +234,7 @@ Status NodeState::AwaitInputTensors(GraphExecutionContext &context) const {
Status NodeState::WaitForPrepareDone() {
if (prepare_future_.valid()) {
GELOGD("[%s] Start to wait for prepare future.", GetName().c_str());
GE_CHK_STATUS_RET(prepare_future_.get(),
"[Check][Status][%s] PreRun failed.", GetName().c_str());
GE_CHK_STATUS_RET(prepare_future_.get(), "[Check][Status][%s] PreRun failed.", GetName().c_str());
}
return SUCCESS;

@ -28,7 +28,7 @@ Status CallbackManager::RegisterCallback(rtStream_t stream, rtCallback_t callbac
auto rt_ret = rtEventRecord(event, stream);
if (rt_ret != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "[Invoke][rtEventRecord] failed, error code = %d", rt_ret);
REPORT_CALL_ERROR("E19999", "Invoke rtEventRecord failed when %s, error code = %d", __FUNCTION__, rt_ret);
REPORT_CALL_ERROR("E19999", "Invoke rtEventRecord failed, error code = %d", rt_ret);
(void) rtEventDestroy(event);
return RT_FAILED;
}
@ -76,8 +76,7 @@ Status CallbackManager::CallbackProcess(rtContext_t context) {
auto rt_err = rtEventSynchronize(event);
if (rt_err != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "[Invoke][rtEventSynchronize] failed. ret = %d", rt_err);
REPORT_CALL_ERROR("E19999",
"Invoke rtEventSynchronize failed when CallbackManager %s, ret = %d.", __FUNCTION__, rt_err);
REPORT_CALL_ERROR("E19999", "Invoke rtEventSynchronize failed, ret = %d.", rt_err);
GE_CHK_RT(rtEventDestroy(event));
return RT_FAILED;
}

@ -52,9 +52,8 @@ Status SubgraphContext::SetInput(int index, const TensorValue &tensor) {
GELOGE(INTERNAL_ERROR,
"[Check][Param:index]input index out of range. all input num = %zu, input index = %d",
all_inputs_.size(), index);
REPORT_INNER_ERROR("E19999",
"input param index out of range when SubgraphContext %s, all input num = %zu, input index = %d.",
__FUNCTION__, all_inputs_.size(), index);
REPORT_INNER_ERROR("E19999", "input param index out of range, all input num = %zu, input index = %d.",
all_inputs_.size(), index);
return INTERNAL_ERROR;
}
all_inputs_[index] = tensor;
@ -69,12 +68,11 @@ Status SubgraphContext::SetInput(const NodeItem &node_item, int input_index, con
Status SubgraphContext::SetOutput(const NodeItem &node_item, int output_index, const TensorValue &tensor) {
auto index = node_item.output_start + output_index;
if ((output_index >= node_item.num_outputs) || (static_cast<size_t>(index) >= all_outputs_.size())) {
GELOGE(INTERNAL_ERROR,
"[Check][Param:output_index]output index out of range. all output num = %zu, node_item = %s,"
"output index = %d.", all_outputs_.size(), node_item.DebugString().c_str(), output_index);
REPORT_INNER_ERROR("E19999", "output index out of range when SubgraphContext %s. "
"all output num = %zu, node_item = %s, output index = %d.",
__FUNCTION__, all_outputs_.size(), node_item.DebugString().c_str(), output_index);
GELOGE(INTERNAL_ERROR, "[Check][Param:output_index]output index out of range. all output num = %zu,"
"node_item = %s, output index = %d.",
all_outputs_.size(), node_item.DebugString().c_str(), output_index);
REPORT_INNER_ERROR("E19999", "output index out of range. all output num = %zu, node_item = %s, output index = %d.",
all_outputs_.size(), node_item.DebugString().c_str(), output_index);
return INTERNAL_ERROR;
}
@ -131,8 +129,8 @@ void SubgraphContext::OnError(Status error) {
if (error != END_OF_SEQUENCE) {
GELOGE(error, "[Check][Param:error][%s] Error:%d occurred while executing graph.",
graph_item_->GetName().c_str(), error);
REPORT_INNER_ERROR("E19999", "[%s] Error:%d occurred while executing graph when SubgraphContext %s.",
graph_item_->GetName().c_str(), error, __FUNCTION__);
REPORT_INNER_ERROR("E19999", "[%s] Error:%d occurred while executing graph.",
graph_item_->GetName().c_str(), error);
}
node_done_manager_.Destroy();
}

@ -72,9 +72,8 @@ Status SubgraphExecutor::InitInputsForUnknownShape(const std::vector<TensorValue
"[Check][Size][%s] Number of inputs [%zu] is not sufficient for subgraph which needs [%zu] inputs.",
graph_item_->GetName().c_str(), inputs.size(), input_nodes.size());
REPORT_INNER_ERROR("E19999",
"[%s] Number of inputs [%zu] is not sufficient for subgraph which needs [%zu] inputs,"
"check invalid when SubgraphExecutor %s.",
graph_item_->GetName().c_str(), inputs.size(), input_nodes.size(), __FUNCTION__);
"[%s] Number of inputs [%zu] is not sufficient for subgraph which needs [%zu] inputs.",
graph_item_->GetName().c_str(), inputs.size(), input_nodes.size());
return INTERNAL_ERROR;
}
@ -93,7 +92,8 @@ Status SubgraphExecutor::InitInputsForUnknownShape(const std::vector<TensorValue
input_tensor.DebugString().c_str());
GE_CHK_STATUS_RET(subgraph_context_->SetInput(*input_node, kDataInputIndex, input_tensor),
"[Invoke][SetInput] failed for grap_item[%s] input tensor[%zu]", graph_item_->GetName().c_str(), i);
"[Invoke][SetInput] failed for grap_item[%s] input tensor[%zu]",
graph_item_->GetName().c_str(), i);
if (force_infer_shape_ || input_node->is_dynamic) {
GELOGD("[%s] Start to update input[%zu] for subgraph data node.", graph_item_->GetName().c_str(), i);
@ -115,13 +115,12 @@ Status SubgraphExecutor::InitInputsForKnownShape(const std::vector<TensorValue>
for (size_t i = 0; i < input_index_mapping.size(); ++i) {
auto &parent_input_index = input_index_mapping[i];
if (static_cast<size_t>(parent_input_index) >= inputs.size()) {
GELOGE(INTERNAL_ERROR,
"[Check][Size][%s] Number of inputs [%zu] is not sufficient for subgraph which needs at lease [%d] inputs",
GELOGE(INTERNAL_ERROR, "[Check][Size][%s] Number of inputs [%zu] is not sufficient for subgraph"
"which needs at lease [%d] inputs", graph_item_->GetName().c_str(), inputs.size(),
parent_input_index + 1);
REPORT_INNER_ERROR("E19999", "[%s] Number of inputs [%zu] is not sufficient for subgraph"
"which needs at lease [%d] inputs",
graph_item_->GetName().c_str(), inputs.size(), parent_input_index + 1);
REPORT_INNER_ERROR("E19999",
"[%s] Number of inputs [%zu] is not sufficient for subgraph which needs at lease [%d] inputs,"
"check invalid when %s.",
graph_item_->GetName().c_str(), inputs.size(), parent_input_index + 1, __FUNCTION__);
return INTERNAL_ERROR;
}
@ -163,10 +162,10 @@ Status SubgraphExecutor::ExecuteAsync(const std::vector<TensorValue> &inputs,
Status SubgraphExecutor::ExecuteAsyncForKnownShape(const std::vector<TensorValue> &inputs) {
GELOGD("[%s] subgraph is not dynamic.", graph_item_->GetName().c_str());
if (graph_item_->GetAllNodes().size() != 1) {
GELOGE(INTERNAL_ERROR,
"[%s] Invalid known shape subgraph. node size = %zu",
graph_item_->GetName().c_str(),
graph_item_->GetAllNodes().size());
REPORT_INNER_ERROR("E19999", "[%s] Invalid known shape subgraph. node size = %zu",
graph_item_->GetName().c_str(), graph_item_->GetAllNodes().size());
GELOGE(INTERNAL_ERROR, "[Check][Size][%s] Invalid known shape subgraph. node size = %zu",
graph_item_->GetName().c_str(), graph_item_->GetAllNodes().size());
return INTERNAL_ERROR;
}
@ -198,8 +197,8 @@ Status SubgraphExecutor::ExecuteAsync(TaskContext &task_context) {
input_desc.emplace_back(task_context.GetInputDesc(i));
}
GE_CHK_STATUS_RET(ExecuteAsync(inputs, input_desc),
"[Invoke][ExecuteAsync] failed for [%s].", graph_item_->GetName().c_str());
GE_CHK_STATUS_RET(ExecuteAsync(inputs, input_desc), "[Invoke][ExecuteAsync] failed for [%s].",
graph_item_->GetName().c_str());
GE_CHK_STATUS_RET(SetOutputsToParentNode(task_context),
"[Invoke][SetOutputsToParentNode][%s] Failed to set output shapes to parent node.",
@ -253,8 +252,7 @@ Status SubgraphExecutor::PrepareNodes(int group) {
const auto &task = node_state->GetKernelTask();
if (task == nullptr) {
GELOGE(INTERNAL_ERROR, "[Get][KernelTask] failed for[%s], NodeTask is null.", node_state->GetName().c_str());
REPORT_CALL_ERROR("E19999", "invoke GetKernelTask failed for %s when %s, nodetask is null.",
node_state->GetName().c_str(), __FUNCTION__);
REPORT_CALL_ERROR("E19999", "GetKernelTask failed for %s, nodetask is null.", node_state->GetName().c_str());
return INTERNAL_ERROR;
}
auto shared_task_context = std::shared_ptr<TaskContext>(unique_task_context.release());
@ -269,8 +267,8 @@ Status SubgraphExecutor::PrepareNodes(int group) {
}
GELOGE(INTERNAL_ERROR, "[Check][State][%s] Error occurs while launching tasks. quit from preparing nodes.",
graph_item_->GetName().c_str());
REPORT_INNER_ERROR("E19999", "[%s] Error occurs while launching tasks. quit from preparing nodes when %s.",
graph_item_->GetName().c_str(), __FUNCTION__);
REPORT_INNER_ERROR("E19999", "[%s] Error occurs while launching tasks. quit from preparing nodes.",
graph_item_->GetName().c_str());
return INTERNAL_ERROR;
}
@ -302,8 +300,7 @@ Status SubgraphExecutor::PrepareForExecution(GraphExecutionContext *ctx, NodeSta
const auto &task = node_state.GetKernelTask();
if (task == nullptr) {
GELOGE(INTERNAL_ERROR, "[Invoke][GetKernelTask] failed for[%s], NodeTask is null.", node_state.GetName().c_str());
REPORT_CALL_ERROR("E19999", "invoke GetKernelTask failed for %s, NodeTask is null when %s.",
node_state.GetName().c_str(), __FUNCTION__);
REPORT_CALL_ERROR("E19999", "invoke GetKernelTask failed for %s, NodeTask is null.", node_state.GetName().c_str());
return INTERNAL_ERROR;
}
auto shared_task_context = std::shared_ptr<TaskContext>(unique_task_context.release());
@ -320,7 +317,7 @@ Status SubgraphExecutor::LaunchTasks() {
NodeState *node_state = nullptr;
if (!ready_queue_.Pop(node_state)) {
GELOGE(INTERNAL_ERROR, "[Invoke][Pop] failed for [%s].", graph_item_->GetName().c_str());
REPORT_CALL_ERROR("E19999", "invoke pop failed for %s when %s", graph_item_->GetName().c_str(), __FUNCTION__);
REPORT_CALL_ERROR("E19999", "invoke pop failed for %s.", graph_item_->GetName().c_str());
return INTERNAL_ERROR;
}
@ -370,8 +367,8 @@ Status SubgraphExecutor::ScheduleTasks(int group) {
return ret;
}
GE_CHK_STATUS_RET(prepare_future.get(),
"[Invoke][get] [%s] Error occurred in task preparation.", graph_item_->GetName().c_str());
GE_CHK_STATUS_RET(prepare_future.get(), "[Invoke][get] [%s] Error occurred in task preparation.",
graph_item_->GetName().c_str());
GELOGD("[%s] Done launching all tasks successfully.", graph_item_->GetName().c_str());
return SUCCESS;
@ -386,14 +383,13 @@ Status SubgraphExecutor::GetOutputs(vector<TensorValue> &outputs, std::vector<Co
// copy output data from op to designated position
GE_CHK_STATUS_RET(graph_item_->GetOutputDescList(output_desc),
"[Invoke][GetOutputDescList][%s] Failed to get output tensor desc.", graph_item_->GetName().c_str());
"[Invoke][GetOutputDescList][%s] Failed to get output tensor desc.",
graph_item_->GetName().c_str());
if (outputs.size() != output_desc.size()) {
GELOGE(INTERNAL_ERROR,
"[Check][Size]Number of outputs(%zu) mismatch number of output_desc(%zu).",
GELOGE(INTERNAL_ERROR, "[Check][Size]Number of outputs(%zu) mismatch number of output_desc(%zu).",
outputs.size(), output_desc.size());
REPORT_INNER_ERROR("E19999", "Number of outputs(%zu) mismatch number of output_desc(%zu).",
outputs.size(), output_desc.size());
REPORT_INNER_ERROR("E19999", "Number of outputs(%zu) mismatch number of output_desc(%zu),"
"check invlid when SubgraphExecutor %s.",
outputs.size(), output_desc.size(), __FUNCTION__);
return INTERNAL_ERROR;
}
return SUCCESS;
@ -410,18 +406,17 @@ Status SubgraphExecutor::SetOutputsToParentNode(TaskContext &task_context) {
// get output tensors and tensor desc list
std::vector<TensorValue> outputs;
std::vector<ConstGeTensorDescPtr> output_desc_list;
GE_CHK_STATUS_RET(subgraph_context_->GetOutputs(outputs),
"[Invoke][GetOutputs][%s] Failed to get output tensors.", graph_item_->GetName().c_str());
GE_CHK_STATUS_RET(subgraph_context_->GetOutputs(outputs), "[Invoke][GetOutputs][%s] Failed to get output tensors.",
graph_item_->GetName().c_str());
GE_CHK_STATUS_RET(graph_item_->GetOutputDescList(output_desc_list),
"[Invoke][GetOutputDescList][%s] Failed to get output tensor desc.", graph_item_->GetName().c_str());
"[Invoke][GetOutputDescList][%s] Failed to get output tensor desc.",
graph_item_->GetName().c_str());
if (outputs.size() != output_desc_list.size()) {
GELOGE(INTERNAL_ERROR, "[Check][Size][%s] num of output tensors = %zu, num of output tensor desc = %zu not equal",
graph_item_->GetName().c_str(), outputs.size(), output_desc_list.size());
REPORT_INNER_ERROR("E19999",
"%s num of output tensors = %zu, num of output tensor desc = %zu not equal,"
"check invalid when SubgraphExecutor %s",
graph_item_->GetName().c_str(), outputs.size(), output_desc_list.size(), __FUNCTION__);
REPORT_INNER_ERROR("E19999", "%s num of output tensors = %zu, num of output tensor desc = %zu not equal",
graph_item_->GetName().c_str(), outputs.size(), output_desc_list.size());
return INTERNAL_ERROR;
}
@ -472,8 +467,8 @@ Status SubgraphExecutor::EnableOutputZeroCopy(const vector<TensorValue> &outputs
if (outputs.size() != output_edges.size()) {
GELOGE(PARAM_INVALID, "[Check][Size]Output number mismatches, expect = %zu, but given = %zu",
output_edges.size(), outputs.size());
REPORT_INNER_ERROR("E19999", "Output number mismatches, expect = %zu, but given = %zu when %s",
output_edges.size(), outputs.size(), __FUNCTION__);
REPORT_INNER_ERROR("E19999", "Output number mismatches, expect = %zu, but given = %zu",
output_edges.size(), outputs.size());
return PARAM_INVALID;
}
@ -489,7 +484,8 @@ Status SubgraphExecutor::EnableOutputZeroCopy(const vector<TensorValue> &outputs
output_tensor.DebugString().c_str());
GE_CHK_STATUS_RET(subgraph_context_->SetOutput(*output_node, output_idx, output_tensor),
"[Invoke][SetOutput][%s] Failed to set input tensor[%zu]", graph_item_->GetName().c_str(), i);
"[Invoke][SetOutput][%s] Failed to set input tensor[%zu]",
graph_item_->GetName().c_str(), i);
}
GELOGD("Done enabling zero copy for outputs successfully.");

@ -106,9 +106,9 @@ Status NodeDoneCallback::PrepareConstInputs(const NodeItem &node_item) {
node_item.NodeName().c_str(), output_idx, tensor_size,
output_tensor->DebugString().c_str());
REPORT_INNER_ERROR("E19999",
"[%s] Tensor size is not enough. output index = %d, required size = %ld, tensor = %s when %s.",
"[%s] Tensor size is not enough. output index = %d, required size = %ld, tensor = %s.",
node_item.NodeName().c_str(), output_idx, tensor_size,
output_tensor->DebugString().c_str(), __FUNCTION__);
output_tensor->DebugString().c_str());
return INTERNAL_ERROR;
}
@ -176,7 +176,7 @@ Status NodeDoneCallback::ProfilingReport() {
auto node = context_->GetNodeItem().node;
if (node == nullptr) {
GELOGE(PARAM_INVALID, "[Get][Node] value is nullptr.");
REPORT_INNER_ERROR("E19999", "Get node failed, when %s.", __FUNCTION__);
REPORT_INNER_ERROR("E19999", "TaskContext GetNodeItem value is nullptr.");
return PARAM_INVALID;
}
@ -194,7 +194,7 @@ Status NodeDoneCallback::ProfilingReport() {
auto profiling_ret = GetTaskDescInfo(node, model, task_desc_info);
if (profiling_ret != RT_ERROR_NONE) {
GELOGE(profiling_ret, "[Get][TaskDescInfo] of node:%s failed.", node->GetName().c_str());
REPORT_CALL_ERROR("E19999", "GetTaskDescInfo of node:%s failed, when %s.", node->GetName().c_str(), __FUNCTION__);
REPORT_CALL_ERROR("E19999", "GetTaskDescInfo of node:%s failed.", node->GetName().c_str());
return profiling_ret;
}
@ -207,7 +207,7 @@ Status NodeDoneCallback::DumpDynamicNode() {
auto node = context_->GetNodeItem().node;
if (node == nullptr) {
GELOGE(PARAM_INVALID, "[Get][Node] value is nullptr.");
REPORT_INNER_ERROR("E19999", "get node is nullptr when %s.", __FUNCTION__);
REPORT_INNER_ERROR("E19999", "get node value is nullptr.");
return PARAM_INVALID;
}
auto op_desc = node->GetOpDesc();
@ -260,7 +260,7 @@ Status NodeDoneCallback::DumpDynamicNode() {
auto rt_ret = rtStreamSynchronize(stream);
if (rt_ret != RT_ERROR_NONE) {
GELOGE(rt_ret, "[Call][rtStreamSynchronize] failed, ret = %d.", rt_ret);
REPORT_CALL_ERROR("E19999", "call rtStreamSynchronize failed when %s, ret = %d.", __FUNCTION__, rt_ret);
REPORT_CALL_ERROR("E19999", "call rtStreamSynchronize failed, ret = %d.", rt_ret);
return rt_ret;
}
return SUCCESS;
@ -279,8 +279,7 @@ Status NodeDoneCallback::OnNodeDone() {
}
if (ProfilingManager::Instance().ProfilingModelExecuteOn()) {
GE_CHK_STATUS_RET(ProfilingReport(), "[Report][Profiling] of node[%s] failed.",
node_item.NodeName().c_str());
GE_CHK_STATUS_RET(ProfilingReport(), "[Report][Profiling] of node[%s] failed.", node_item.NodeName().c_str());
}
// release workspace
@ -302,8 +301,8 @@ Status NodeDoneCallback::OnNodeDone() {
(void) LogOutputs(node_item, *context_);
}
GE_CHK_STATUS_RET(context_->PropagateOutputs(),
"[Propagate][Outputs] of [%s] failed.", node_item.NodeName().c_str());
GE_CHK_STATUS_RET(context_->PropagateOutputs(), "[Propagate][Outputs] of [%s] failed.",
node_item.NodeName().c_str());
RECORD_CALLBACK_EVENT(graph_context_, context_->GetNodeName(), "[PropagateOutputs] End");
}
@ -344,7 +343,7 @@ Status ExecutionEngine::DoExecuteAsync(NodeState &node_state,
const auto &task = node_state.GetKernelTask();
if (task == nullptr) {
GELOGE(INTERNAL_ERROR, "[Get][KernelTask] of [%s] is null.", node_state.GetName().c_str());
REPORT_INNER_ERROR("E19999", "GetKernelTask of %s is null when %s.", node_state.GetName().c_str(), __FUNCTION__);
REPORT_INNER_ERROR("E19999", "GetKernelTask of %s is null.", node_state.GetName().c_str());
return INTERNAL_ERROR;
}
@ -358,8 +357,8 @@ Status ExecutionEngine::DoExecuteAsync(NodeState &node_state,
auto executor = node_item.node_executor;
GE_CHECK_NOTNULL(executor);
RECORD_EXECUTION_EVENT(&context, task_context.GetNodeName(), "[PrepareTask] Start");
GE_CHK_STATUS_RET(executor->PrepareTask(*task, task_context),
"[Prepare][Task] for [%s] failed.", node_state.GetName().c_str());
GE_CHK_STATUS_RET(executor->PrepareTask(*task, task_context), "[Prepare][Task] for [%s] failed.",
node_state.GetName().c_str());
RECORD_EXECUTION_EVENT(&context, task_context.GetNodeName(), "[PrepareTask] End");
GELOGD("[%s] Done task preparation successfully.", node_state.GetName().c_str());
@ -427,8 +426,8 @@ Status ExecutionEngine::ValidateInputTensors(const NodeState &node_state, const
GELOGE(INTERNAL_ERROR,
"[Check][Size] for [%s] Input[%d]: tensor size mismatches. expected: %ld, but given %zu.",
task_context.GetNodeName(), i, expected_size, input_tensor->GetSize());
REPORT_INNER_ERROR("E19999", "[%s] Input[%d]: tensor size mismatches. expected: %ld, but given %zu when %s.",
task_context.GetNodeName(), i, expected_size, input_tensor->GetSize(), __FUNCTION__);
REPORT_INNER_ERROR("E19999", "[%s] Input[%d]: tensor size mismatches. expected: %ld, but given %zu.",
task_context.GetNodeName(), i, expected_size, input_tensor->GetSize());
return INTERNAL_ERROR;
}
}
@ -441,8 +440,8 @@ Status ExecutionEngine::PropagateOutputs(const NodeItem &node_item,
TaskContext &task_context,
GraphExecutionContext &context) {
if (node_item.shape_inference_type != DEPEND_COMPUTE) {
GE_CHK_STATUS_RET(task_context.PropagateOutputs(),
"[Propagate][Outputs] for [%s] failed.", node_item.NodeName().c_str());
GE_CHK_STATUS_RET(task_context.PropagateOutputs(), "[Propagate][Outputs] for [%s] failed.",
node_item.NodeName().c_str());
RECORD_EXECUTION_EVENT(&context, task_context.GetNodeName(), "[PropagateOutputs] End");
GELOGD("[%s] Done propagating outputs successfully.", node_item.NodeName().c_str());
}

@ -205,8 +205,7 @@ Status ShapeInferenceEngine::UpdatePeerNodeShape(const Node &node) {
auto peer_input_desc = peer_op_desc->MutableInputDesc(peer_anchor->GetIdx());
if (peer_input_desc == nullptr) {
GELOGE(GRAPH_FAILED, "[Call][MutableInputDesc] for %s return nullptr.", peer_op_desc->GetName().c_str());
REPORT_CALL_ERROR("E19999", "%s call MutableInputDesc return nullptr when ShapeInferenceEngine %s.",
peer_op_desc->GetName().c_str(), __FUNCTION__);
REPORT_CALL_ERROR("E19999", "%s call MutableInputDesc return nullptr.", peer_op_desc->GetName().c_str());
continue;
}
@ -234,8 +233,8 @@ Status ShapeInferenceEngine::CanonicalizeShape(GeTensorDesc &tensor_desc,
GELOGE(INTERNAL_ERROR,
"[Is][UnknownShape] Output shape is still unknown after shape inference. shape = [%s].",
tensor_shape.ToString().c_str());
REPORT_INNER_ERROR("E19999", "Output shape is still unknown after shape inference. "
"shape = [%s] when ShapeInferenceEngine %s.", tensor_shape.ToString().c_str(), __FUNCTION__);
REPORT_INNER_ERROR("E19999", "Output shape is still unknown after shape inference. shape = [%s].",
tensor_shape.ToString().c_str());
return INTERNAL_ERROR;
}
@ -245,8 +244,8 @@ Status ShapeInferenceEngine::CanonicalizeShape(GeTensorDesc &tensor_desc,
if (shape_range.size() != shape.size()) {
GELOGE(INTERNAL_ERROR, "[Check][Size] Number of shape ranges (%zu) mismatches that of dims (%zu).",
shape_range.size(), shape.size());
REPORT_INNER_ERROR("E19999", "Number of shape ranges (%zu) mismatches that of dims (%zu)"
" when ShapeInferenceEngine %s.", shape_range.size(), shape.size(), __FUNCTION__);
REPORT_INNER_ERROR("E19999", "Number of shape ranges (%zu) mismatches that of dims (%zu)",
shape_range.size(), shape.size());
return INTERNAL_ERROR;
}
@ -272,21 +271,22 @@ Status ShapeInferenceEngine::CalcTensorSize(DataType data_type,
if (!TypeUtils::GetDataTypeLength(data_type, type_size)) {
GELOGE(INTERNAL_ERROR, "[Get][DataTypeLength] failed for type:%s.",
TypeUtils::DataTypeToSerialString(data_type).c_str());
REPORT_CALL_ERROR("E19999", "GetDataTypeLength failed for type:%s when ShapeInferenceEngine %s.",
TypeUtils::DataTypeToSerialString(data_type).c_str(), __FUNCTION__);
REPORT_CALL_ERROR("E19999", "GetDataTypeLength failed for type:%s.",
TypeUtils::DataTypeToSerialString(data_type).c_str());
return INTERNAL_ERROR;
}
tensor_size = type_size;
for (const auto &dim : shape) {
GE_CHECK_GE(dim, 0);
GE_CHK_STATUS_RET(Int64MulCheckOverflow(tensor_size, dim),
"[Check][Overflow] Shape size overflow, shape = [%s]", GeShape(shape).ToString().c_str());
GE_CHK_STATUS_RET(Int64MulCheckOverflow(tensor_size, dim), "[Check][Overflow] Shape size overflow, shape = [%s]",
GeShape(shape).ToString().c_str());
tensor_size *= dim;
}
GE_CHK_STATUS_RET(CheckInt64AddOverflow(tensor_size, kAlignment - 1),
"[Check][Overflow]Tensor size is too large: %ld, shape = [%s] Shape size will overflow when add align.",
"[Check][Overflow]Tensor size is too large:%ld, shape = [%s]"
"Shape size will overflow when add align.",
tensor_size, GeShape(shape).ToString().c_str());
tensor_size = (tensor_size + kAlignment - 1) / kAlignment * kAlignment;
return SUCCESS;
@ -302,9 +302,8 @@ Status ShapeInferenceEngine::CalcOutputTensorSizes(const NodeItem &node_item, bo
auto dims = shape.GetDims();
auto status_result = CanonicalizeShape(*tensor_desc, dims, fallback_with_range);
if (status_result != SUCCESS) {
REPORT_CALL_ERROR("E19999",
"Invoke CanonicalizeShape failed when ShapeInferenceEngine %s, node:%s, output:%zu.",
node_item.NodeName().c_str(), __FUNCTION__, output_index);
REPORT_CALL_ERROR("E19999", "CanonicalizeShape failed, node:%s, output:%zu.",
node_item.NodeName().c_str(), output_index);
GELOGE(ge::FAILED, "[Canonicalize][Shape] failed for [%s], output %zu.",
node_item.NodeName().c_str(), output_index);
return status_result;
@ -312,8 +311,8 @@ Status ShapeInferenceEngine::CalcOutputTensorSizes(const NodeItem &node_item, bo
int64_t tensor_size;
status_result = CalcTensorSize(tensor_desc->GetDataType(), dims, tensor_size);
if (status_result != SUCCESS) {
REPORT_CALL_ERROR("E19999", "Invoke CalcTensorSize failed when ShapeInferenceEngine %s, node:%s, output:%zu.",
node_item.NodeName().c_str(), __FUNCTION__, output_index);
REPORT_CALL_ERROR("E19999", "Invoke CalcTensorSize failed, node:%s, output:%zu.",
node_item.NodeName().c_str(), output_index);
GELOGE(ge::FAILED, "[Calc][TensorSize] failed for [%s], output %zu.",
node_item.NodeName().c_str(), output_index);
return status_result;

@ -44,9 +44,9 @@ Status HybridModel::Init(bool is_single_op) {
GELOGD("Start to init hybrid model.");
is_single_op_ = is_single_op;
if (is_single_op) {
GE_CHK_STATUS_RET(HybridModelBuilder(*this).BuildForSingleOp(), "Failed to build hybrid model.");
GE_CHK_STATUS_RET(HybridModelBuilder(*this).BuildForSingleOp(), "[Build][HybridModel] for SingleOp failed.");
} else {
GE_CHK_STATUS_RET(HybridModelBuilder(*this).Build(), "Failed to build hybrid model.");
GE_CHK_STATUS_RET(HybridModelBuilder(*this).Build(), "[Build][HybridModel] failed.");
}
GELOGD("HybridModel initialized successfully.");
return SUCCESS;
@ -106,7 +106,10 @@ const NodeItem *HybridModel::GetNodeItem(const NodePtr &node) const {
GeModelPtr HybridModel::GetGeModel(const NodePtr &node) const {
auto it = known_shape_sub_models_.find(node);
if (it == known_shape_sub_models_.end()) {
GELOGE(INTERNAL_ERROR, "[%s] Failed to get GeModel for subgraph node.", node->GetName().c_str());
GELOGE(INTERNAL_ERROR, "[Check][Param:node][%s] Failed to get GeModel for subgraph node,"
"because node not in known_shape_sub_models_.", node->GetName().c_str());
REPORT_INNER_ERROR("E19999", "%s Failed to get GeModel for subgraph node,"
"because node not in known_shape_sub_models_.", node->GetName().c_str());
return nullptr;
}
@ -130,7 +133,10 @@ const GraphItem *HybridModel::GetSubgraphItem(const std::string &graph_name) con
const GraphItem *HybridModel::GetSubgraphItem(const ComputeGraphPtr &subgraph) const {
if (subgraph == nullptr) {
GELOGE(PARAM_INVALID, "subgraph is nullptr");
REPORT_INNER_ERROR("E19999", "Input param subgraph is nullptr, Graph:%s",
root_graph_item_->GetName().c_str());
GELOGE(PARAM_INVALID, "[Check][Param]subgraph is nullptr. graph:%s",
root_graph_item_->GetName().c_str());
return nullptr;
}
@ -164,19 +170,27 @@ Status HybridModel::GetInputOutputDescInfo(vector<InputOutputDescInfo> &input_de
std::vector<uint32_t> &output_formats) {
auto node_item_list = root_graph_item_->GetInputNodes();
if (node_item_list.empty()) {
GELOGE(FAILED, "node item list is empty!");
REPORT_INNER_ERROR("E19999", "node item list is empty!, graph:%s",
root_graph_item_->GetName().c_str());
GELOGE(FAILED, "[Get][InputNodes]node item list is empty!, graph:%s",
root_graph_item_->GetName().c_str());
return FAILED;
}
GE_CHECK_NOTNULL(node_item_list[0]->node);
GE_CHECK_NOTNULL(node_item_list[0]->node->GetOpDesc());
if (node_item_list[0]->node->GetOpDesc()->GetInputsSize() != 1) {
GELOGE(FAILED, "input size of op is not 1!");
REPORT_INNER_ERROR("E19999", "Input size of op is not 1, op:%s, type:%s",
node_item_list[0]->node->GetName().c_str(),
node_item_list[0]->node->GetType().c_str());
GELOGE(FAILED, "[Check][Size]input size of op is not 1! op:%s, type:%s",
node_item_list[0]->node->GetName().c_str(),
node_item_list[0]->node->GetType().c_str());
return FAILED;
}
GE_CHK_STATUS_RET(GetInputDescInfo(input_desc, input_formats), "get input desc info failed");
GE_CHK_STATUS_RET(GetOutputDescInfo(output_desc, output_formats), "get ouput desc info failed");
GE_CHK_STATUS_RET(GetInputDescInfo(input_desc, input_formats), "[Get][InputDescInfo] failed.");
GE_CHK_STATUS_RET(GetOutputDescInfo(output_desc, output_formats), "[Get][OutputDescInfo] failed.");
return SUCCESS;
}
@ -231,7 +245,14 @@ Status HybridModel::GetInputDescInfo(vector<InputOutputDescInfo> &input_desc, st
GeShape shape = op_desc->GetInputDescPtr(0)->GetShape();
int64_t tensor_size = 0;
if (TensorUtils::CalcTensorMemSize(shape, format, data_type, tensor_size) != GRAPH_SUCCESS) {
GELOGE(FAILED, "Calculate tensor mem size failed.");
GELOGE(FAILED, "[Calculate][TensorMemSize] failed input0 desc in node:%s."
"shape:%s, format:%s, datatype:%s.", op_desc->GetName().c_str(),
shape.ToString().c_str(), TypeUtils::FormatToSerialString(format).c_str(),
TypeUtils::DataTypeToSerialString(data_type).c_str());
REPORT_CALL_ERROR("E19999", "CalcTensorMemSize failed for input0 desc in node:%s,"
"shape:%s, format:%s, datatype:%s", op_desc->GetName().c_str(),
shape.ToString().c_str(), TypeUtils::FormatToSerialString(format).c_str(),
TypeUtils::DataTypeToSerialString(data_type).c_str());
return FAILED;
}
if (tensor_size == kMemSizeUnknownShape) {
@ -249,7 +270,10 @@ Status HybridModel::GetInputDescInfo(vector<InputOutputDescInfo> &input_desc, st
void HybridModel::CreateOutput(ConstGeTensorDescPtr &output_desc,
InputOutputDescInfo &output_desc_info, uint32_t &format_result) {
GE_IF_BOOL_EXEC(output_desc == nullptr, GELOGE(FAILED, "output desc ptr is nullptr"); return );
GE_IF_BOOL_EXEC(output_desc == nullptr,
REPORT_INNER_ERROR("E19999", "param output_desc is nullptr, check invalid.");
GELOGE(FAILED, "[Check][Param:output_desc]output desc ptr is nullptr");
return );
Format format = output_desc->GetFormat();
GeShape shape = output_desc->GetShape();
std::vector<std::pair<int64_t,int64_t>> shape_ranges;
@ -290,7 +314,9 @@ void HybridModel::CreateOutput(ConstGeTensorDescPtr &output_desc,
Status HybridModel::GetOutputDescInfo(vector<InputOutputDescInfo> &output_desc, std::vector<uint32_t> &formats) {
std::vector<ConstGeTensorDescPtr> output_desc_list;
// output_desc_list contains vaild input desc
GE_CHK_STATUS_RET(root_graph_item_->GetOutputDescList(output_desc_list), "get output desc info failed");
GE_CHK_STATUS_RET(root_graph_item_->GetOutputDescList(output_desc_list),
"[Invoke][GetOutputDescList]get output desc info failed, Graph:%s",
root_graph_item_->GetName().c_str());
vector<std::string> out_node_names;
(void)ge::AttrUtils::GetListStr(ge_root_model_->GetRootGraph(), ATTR_MODEL_OUT_NODES_NAME, out_node_names);
@ -300,8 +326,12 @@ Status HybridModel::GetOutputDescInfo(vector<InputOutputDescInfo> &output_desc,
GE_CHECK_NOTNULL(op_desc);
auto out_size = static_cast<uint32_t>(op_desc->GetInputsSize());
GE_CHK_BOOL_RET_STATUS(out_size == output_desc_list.size(),
FAILED, "output size[%u] not match output_desc_list size[%zu]", out_size, output_desc_list.size());
GE_IF_BOOL_EXEC(out_size != output_desc_list.size(),
REPORT_INNER_ERROR("E19999", "output size[%u] not match output_desc_list size[%zu]",
out_size, output_desc_list.size());
GELOGE(FAILED, "[Check][Size]output size[%u] not match output_desc_list size[%zu]",
out_size, output_desc_list.size());
return FAILED;);
for (uint32_t index = 0; index < out_size; ++index) {
string output_name;
@ -329,7 +359,8 @@ Status HybridModel::GetOutputDescInfo(vector<InputOutputDescInfo> &output_desc,
TensorValue *HybridModel::GetConstant(const NodePtr &node) const {
if (node == nullptr) {
GELOGE(PARAM_INVALID, "Param is null");
GELOGE(PARAM_INVALID, "[Check][Param:node]node is null.");
REPORT_INNER_ERROR("E19999", "param node is null, check invalid.");
return nullptr;
}
@ -347,7 +378,8 @@ TensorValue *HybridModel::GetConstant(const NodePtr &node) const {
TensorValue *HybridModel::GetTensor(const NodePtr &node) const {
if (node == nullptr) {
GELOGE(PARAM_INVALID, "Param is null");
GELOGE(PARAM_INVALID, "[Check][Param:node]node is null.");
REPORT_INNER_ERROR("E19999", "param node is null, check invalid.");
return nullptr;
}

File diff suppressed because it is too large Load Diff

@ -36,10 +36,10 @@ std::set<std::string> kControlOpTypes{
Status ParseInputMapping(Node &node, OpDesc &op_desc, FusedSubgraph &fused_subgraph) {
uint32_t parent_index = 0;
if (!AttrUtils::GetInt(op_desc, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) {
GELOGE(FAILED,
"[%s] Failed to get attr [%s]",
op_desc.GetName().c_str(),
ATTR_NAME_PARENT_NODE_INDEX.c_str());
GELOGE(FAILED, "[Invoke][GetInt][%s] Failed to get attr [%s]",
op_desc.GetName().c_str(), ATTR_NAME_PARENT_NODE_INDEX.c_str());
REPORT_CALL_ERROR("E19999", "[%s] Failed to get attr [%s]",
op_desc.GetName().c_str(), ATTR_NAME_PARENT_NODE_INDEX.c_str());
return FAILED;
}
@ -58,10 +58,10 @@ Status ParseInputMapping(Node &node, OpDesc &op_desc, FusedSubgraph &fused_subgr
Status ParseOutputMapping(const OpDescPtr &op_desc, FusedSubgraph &fused_subgraph) {
uint32_t parent_index = 0;
if (!AttrUtils::GetInt(op_desc, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) {
GELOGE(FAILED,
"[%s] Failed to get attr [%s]",
op_desc->GetName().c_str(),
ATTR_NAME_PARENT_NODE_INDEX.c_str());
GELOGE(FAILED, "[Invoke][GetInt][%s] Failed to get attr [%s]",
op_desc->GetName().c_str(), ATTR_NAME_PARENT_NODE_INDEX.c_str());
REPORT_CALL_ERROR("E19999", "[%s] Failed to get attr [%s].",
op_desc->GetName().c_str(), ATTR_NAME_PARENT_NODE_INDEX.c_str());
return FAILED;
}
@ -122,7 +122,7 @@ Status NodeItem::Create(const NodePtr &node, std::unique_ptr<NodeItem> &node_ite
GE_CHECK_NOTNULL(node->GetOpDesc());
std::unique_ptr<NodeItem> instance(new(std::nothrow)NodeItem(node));
GE_CHECK_NOTNULL(instance);
GE_CHK_STATUS_RET(instance->Init(), "Failed to init NodeItem [%s] .", node->GetName().c_str());
GE_CHK_STATUS_RET(instance->Init(), "[Invoke][Init]Failed to init NodeItem [%s] .", node->GetName().c_str());
node_item = std::move(instance);
return SUCCESS;
}
@ -171,7 +171,7 @@ Status NodeItem::ResolveDynamicState() {
GELOGD("Node name is %s, dynamic state is %d.", this->node_name.c_str(), is_dynamic);
if (!is_dynamic) {
GE_CHK_STATUS_RET(NodeUtils::GetNodeUnknownShapeStatus(*node, is_dynamic),
"[%s] Failed to get shape status.",
"[Invoke][GetNodeUnknownShapeStatus][%s] Failed to get shape status.",
node->GetName().c_str());
}
return SUCCESS;
@ -241,7 +241,8 @@ Status NodeItem::Init() {
ResolveUnknownShapeType();
if (is_dynamic) {
GE_CHK_STATUS_RET_NOLOG(ResolveStaticInputsAndOutputs());
GE_CHK_STATUS_RET(ParseFusedSubgraph(*this), "[%s] Failed to parse fused subgraph", node_name.c_str());
GE_CHK_STATUS_RET(ParseFusedSubgraph(*this),
"[Invoke][ParseFusedSubgraph][%s] Failed to parse fused subgraph", node_name.c_str());
}
return SUCCESS;
@ -303,11 +304,10 @@ GeTensorDescPtr NodeItem::DoGetInputDesc(int index) const {
}
if (index < 0 || index >= num_inputs) {
GELOGE(PARAM_INVALID,
"[%s] Invalid input index, num inputs = %d, index = %d",
node_name.c_str(),
num_inputs,
index);
GELOGE(PARAM_INVALID, "[Check][Param:index][%s] Invalid input index, num inputs = %d, index = %d",
node_name.c_str(), num_inputs, index);
REPORT_INNER_ERROR("E19999", "Invalid input index, node:%s num inputs = %d, index = %d",
node_name.c_str(), num_inputs, index);
return nullptr;
}
@ -356,7 +356,11 @@ Status NodeItem::GetCanonicalInputIndex(uint32_t index, int &canonical_index) co
auto iter = std::find(input_desc_indices_.begin(), input_desc_indices_.end(), index);
if (iter == input_desc_indices_.end()) {
GELOGE(INTERNAL_ERROR, "[%s] Invalid input index: %u", node_name.c_str(), index);
GELOGE(INTERNAL_ERROR,
"[Check][Param:index]input index:%u not in input_desc_indices_, check Invalid, node:%s",
index, node_name.c_str());
REPORT_INNER_ERROR("E19999", "input index:%u not in input_desc_indices_, check Invalid, node:%s",
index, node_name.c_str());
return INTERNAL_ERROR;
}
@ -371,7 +375,9 @@ bool NodeItem::IsInputShapeStatic(int index) const {
}
if (static_cast<size_t>(index) >= is_input_shape_static_.size()) {
GELOGE(PARAM_INVALID, "Input index(%d) out of range: [0, %zu)", index, is_input_shape_static_.size());
GELOGE(PARAM_INVALID, "[Check][Param:index]Input index(%d) out of range: [0, %zu)",
index, is_input_shape_static_.size());
REPORT_INNER_ERROR("E19999", "Input index(%d) out of range: [0, %zu).", index, is_input_shape_static_.size());
return false;
}

@ -42,7 +42,7 @@ AiCoreNodeTask::AiCoreNodeTask(std::vector<std::unique_ptr<AiCoreOpTask>> &&task
Status AiCoreNodeExecutor::Initialize() {
compiler_ = TaskCompilerFactory::GetInstance().GetTaskCompiler();
if (compiler_ != nullptr) {
GE_CHK_STATUS_RET(compiler_->Initialize(), "Failed to init aicore task compiler.");
GE_CHK_STATUS_RET(compiler_->Initialize(), "[Init][TaskCompiler] failed.");
}
return SUCCESS;
}
@ -60,7 +60,11 @@ Status AiCoreNodeExecutor::LoadTask(const HybridModel &model, const NodePtr &nod
node->GetName().c_str());
return SUCCESS;
} else {
GELOGE(FAILED, "Task_defs is empty for node (%s) which 'support_dynamicshape' is true, failed.",
GELOGE(FAILED, "[Invoke][GetBool]Task_defs is empty for node (%s)"
"which 'support_dynamicshape' is true, check invalid",
node->GetName().c_str());
REPORT_CALL_ERROR("E19999", "Task_defs is empty for node (%s)"
"which 'support_dynamicshape' is true, check invalid",
node->GetName().c_str());
return FAILED;
}
@ -69,7 +73,7 @@ Status AiCoreNodeExecutor::LoadTask(const HybridModel &model, const NodePtr &nod
AiCoreTaskBuilder builder(node->GetOpDesc(), *task_defs);
std::unique_ptr<AiCoreNodeTask> node_task;
GE_CHK_STATUS_RET(builder.BuildTask(node_task, true, is_single_op),
"[%s] Failed to build op tasks.", node->GetName().c_str());
"[Invoke][BuildTask][%s] Failed to build op tasks.", node->GetName().c_str());
task = std::move(node_task);
GELOGI("AiCoreNodeExecutor(%s) LoadTask End.", node->GetName().c_str());
return SUCCESS;
@ -105,7 +109,8 @@ bool AiCoreNodeTaskRegistry::AddTask(const std::string &node_key, const std::sha
std::lock_guard<std::mutex> lock(mutex_);
auto iter = reg_node_tasks_.find(node_key);
if (iter != reg_node_tasks_.end()) {
GELOGE(FAILED, "AiCoreNodeTaskRegistry(%s) AddTask failed, key already exist.", node_key.c_str());
GELOGE(FAILED, "[Add][Task] failed, key:%s already exist.", node_key.c_str());
REPORT_INNER_ERROR("E19999", "AddTask failed, key:%s already exist.", node_key.c_str());
return false;
}
auto ret = reg_node_tasks_.emplace(node_key, task);
@ -131,13 +136,14 @@ Status AiCoreNodeExecutor::CompileTask(const HybridModel &model,
auto ori_node_name = node->GetName();
if (compiler_ == nullptr) {
GELOGE(FAILED, "[%s] Can not find any valid aicore task compiler.", ori_node_name.c_str());
GELOGE(FAILED, "[Find][Compiler][%s] Can not find any valid aicore task compiler.", ori_node_name.c_str());
REPORT_INNER_ERROR("E19999", "[%s] Can not find any valid aicore task compiler.", ori_node_name.c_str());
return FAILED;
}
AiCoreNodeTaskRegistry &registry = AiCoreNodeTaskRegistry::GetInstance();
std::string shape_key;
GE_CHK_STATUS_RET(GenNodeKey(node, shape_key), "GenNodeKey failed, op name = %s.", node->GetName().c_str());
GE_CHK_STATUS_RET(GenNodeKey(node, shape_key), "[Generate][NodeKey] failed, op name = %s.", node->GetName().c_str());
auto node_key = std::to_string(model.GetModelId()) + "/" + shape_key;
GELOGD("NodeKey for %s = %s", node->GetName().c_str(), node_key.c_str());
@ -152,19 +158,21 @@ Status AiCoreNodeExecutor::CompileTask(const HybridModel &model,
std::vector<domi::TaskDef> task_defs;
op_desc->SetName(ori_node_name + "_" + shape_key);
GE_CHK_STATUS_RET(compiler_->CompileOp(node, task_defs), "Compile op(%s) failed.", ori_node_name.c_str());
GE_CHK_STATUS_RET(compiler_->CompileOp(node, task_defs), "[Compile][Op:%s] failed.", ori_node_name.c_str());
op_desc->SetName(ori_node_name);
GELOGD("successfully generated task_defs: %s", node->GetName().c_str());
AiCoreTaskBuilder builder(node->GetOpDesc(), task_defs);
std::unique_ptr<AiCoreNodeTask> node_task;
GE_CHK_STATUS_RET(builder.BuildTask(node_task, false), "[%s] Failed to build op tasks.", node->GetName().c_str());
GE_CHK_STATUS_RET(builder.BuildTask(node_task, false),
"[Invoke][BuildTask][%s] Failed to build op tasks.", node->GetName().c_str());
node_task->SetWorkspaceSizes(op_desc->GetWorkspaceBytes());
aicore_task = std::move(node_task);
GELOGD("successfully created node task: %s", node->GetName().c_str());
if (!registry.AddTask(node_key, aicore_task)) {
GELOGE(INTERNAL_ERROR, "Add NodeTask failed, op name = %s.", node->GetName().c_str());
GELOGE(INTERNAL_ERROR, "[Add][NodeTask] failed, op name = %s.", node->GetName().c_str());
REPORT_CALL_ERROR("E19999", "add task failed, op name = %s.", node->GetName().c_str());
return INTERNAL_ERROR;
}
@ -196,7 +204,8 @@ Status AiCoreNodeTask::ExecuteAsync(TaskContext &context, std::function<void()>
uint32_t stream_id = 0;
rtError_t rt_ret = rtGetTaskIdAndStreamID(&task_id, &stream_id); // must be called after Launch kernel
if (rt_ret != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "Get task_id and stream_id failed, ret: 0x%X.", rt_ret);
GELOGE(RT_FAILED, "[Invoke][rtGetTaskIdAndStreamID] failed, ret: 0x%X.", rt_ret);
REPORT_CALL_ERROR("E19999", "rtGetTaskIdAndStreamID failed, ret: 0x%X.", rt_ret);
return RT_ERROR_TO_GE_STATUS(rt_ret);
}
GELOGD("Aicore node[%s] task_id: %u, stream_id: %u.", context.GetNodeName(), task_id, stream_id);
@ -271,7 +280,8 @@ Status AiCoreNodeTask::CheckOverflow(TaskContext &context) {
GELOGW("Dynamic shape op %s is over flow", context.GetNodeName());
return SUCCESS;
} else if (rt_ret != RT_ERROR_NONE) {
GELOGE(rt_ret, "rtstreamsynchronize failed");
GELOGE(rt_ret, "[Invoke][rtstreamsynchronize] failed, ret:%d.", rt_ret);
REPORT_CALL_ERROR("E19999", "rtstreamsynchronize failed, ret:%d.", rt_ret);
return RT_ERROR_TO_GE_STATUS(rt_ret);
}
return SUCCESS;

File diff suppressed because it is too large Load Diff

@ -42,10 +42,10 @@ Status AiCoreTaskBuilder::BuildTask(std::unique_ptr<AiCoreNodeTask> &node_task,
bool is_single_op) {
GE_CHECK_NOTNULL(op_desc_);
if (task_defs_.size() > kNumTaskWithAtomicAddrCleanTask) {
GELOGE(INTERNAL_ERROR,
"[%s] At most 2 task was supported, but got %zu",
op_desc_->GetName().c_str(),
task_defs_.size());
GELOGE(INTERNAL_ERROR, "[Check][Size][%s] At most %zu task was supported, but got %zu",
op_desc_->GetName().c_str(), kNumTaskWithAtomicAddrCleanTask, task_defs_.size());
REPORT_INNER_ERROR("E19999", "[%s] At most %zu task was supported, but got %zu, check invalid.",
op_desc_->GetName().c_str(), kNumTaskWithAtomicAddrCleanTask, task_defs_.size());
return INTERNAL_ERROR;
}
@ -58,10 +58,10 @@ Status AiCoreTaskBuilder::BuildTask(std::unique_ptr<AiCoreNodeTask> &node_task,
task_defs_.size());
return SUCCESS;
} else {
GELOGE(INTERNAL_ERROR,
"[%s] AtomicAddrClean task was expected, but got %zu task_defs",
op_desc_->GetName().c_str(),
task_defs_.size());
GELOGE(INTERNAL_ERROR, "[Check][Size][%s] AtomicAddrClean task was expected:%zu, but got %zu task_defs",
op_desc_->GetName().c_str(), kNumTaskWithAtomicAddrCleanTask, task_defs_.size());
REPORT_INNER_ERROR("E19999", "[%s] AtomicAddrClean task was expected:%zu, but got %zu task_defs,",
op_desc_->GetName().c_str(), kNumTaskWithAtomicAddrCleanTask, task_defs_.size());
return INTERNAL_ERROR;
}
}
@ -72,7 +72,7 @@ Status AiCoreTaskBuilder::BuildTask(std::unique_ptr<AiCoreNodeTask> &node_task,
GE_CHECK_NOTNULL(atomic_task);
atomic_task->SetSingleOp(is_single_op);
GE_CHK_STATUS_RET(atomic_task->Init(*op_desc_, task_defs_.front()),
"[%s] Failed to init task for AtomicAddrClean",
"[Invoke][AtomicAddrCleanOpTask::Init] failed for [%s].",
op_desc_->GetName().c_str());
op_tasks.emplace_back(std::move(atomic_task));
}
@ -82,7 +82,7 @@ Status AiCoreTaskBuilder::BuildTask(std::unique_ptr<AiCoreNodeTask> &node_task,
GE_CHECK_NOTNULL(aicore_task);
aicore_task->SetSingleOp(is_single_op);
GE_CHK_STATUS_RET(aicore_task->Init(*op_desc_, task_defs_.back()),
"[%s] Failed to init task for AtomicAddrClean",
"[Invoke][AiCoreOpTask::Init] failed for [%s].",
op_desc_->GetName().c_str());
op_tasks.emplace_back(std::move(aicore_task));

@ -34,7 +34,8 @@ Status AiCoreTaskCompiler::Initialize() {
auto ge_lib = GELib::GetInstance();
GE_CHECK_NOTNULL(ge_lib);
if (!ge_lib->InitFlag()) {
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "Ge_lib is uninitialized, failed.");
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Check][State] failed, because Ge_lib is uninitialized.");
REPORT_INNER_ERROR("E19999", "Initialize failed, because Ge_lib is uninitialized.");
return GE_CLI_GE_NOT_INITIALIZED;
}
auto &kernel_manager = ge_lib->OpsKernelManagerObj();
@ -49,11 +50,9 @@ Status AiCoreTaskCompiler::DoCompileOp(const NodePtr &node) const {
vector<NodePtr> node_vec;
node_vec.emplace_back(node);
GE_CHK_STATUS_RET(aic_kernel_store_->CompileOpRun(node_vec),
"Failed to execute CompileOp, node = %s",
node->GetName().c_str());
"[Invoke][CompileOpRun] Failed, node = %s", node->GetName().c_str());
GE_CHK_STATUS_RET(OpsKernelBuilderManager::Instance().CalcOpRunningParam(*node),
"Failed to execute CalcOpRunningParam, node = %s",
node->GetName().c_str());
"[Invoke][CalcOpRunningParam] Failed, node = %s", node->GetName().c_str());
return SUCCESS;
}
@ -102,7 +101,7 @@ Status AiCoreTaskCompiler::DoGenerateTask(const Node &node,
ret = OpsKernelBuilderManager::Instance().GenerateTask(node, context, tasks);
}
GE_CHK_STATUS(ret, "Failed to execute GenerateTask, node = %s", node.GetName().c_str());
GE_CHK_STATUS(ret, "[Invoke][GenerateTask] Failed, node = %s", node.GetName().c_str());
GE_CHK_RT(rtModelUnbindStream(rt_model_, stream));
GE_CHK_RT(rtModelDestroy(rt_model_));
return ret;

@ -29,8 +29,9 @@ constexpr int64_t kDimEndFlag = INT64_MIN;
Status AicpuExtInfoHandler::Parse(const std::string &ext_info) {
GELOGI("Node[%s] parse ext info start.", node_name_.c_str());
if (ext_info.empty()) {
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "Node[%s] parse ext info failed as ext info is empty.",
node_name_.c_str());
GELOGE(ACL_ERROR_GE_PARAM_INVALID,
"[Check][Param:ext_info]Node[%s] parse ext info failed as ext info is empty.", node_name_.c_str());
REPORT_INNER_ERROR("E19999", "Node[%s] parse ext info failed as ext info is empty.", node_name_.c_str());
return ACL_ERROR_GE_PARAM_INVALID;
}
@ -39,7 +40,8 @@ Status AicpuExtInfoHandler::Parse(const std::string &ext_info) {
GE_CHECK_NOTNULL(ext_info_);
if (memcpy_s(ext_info_.get(), ext_info_len_, ext_info.c_str(), ext_info.size()) != EOK) {
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[%s] Failed to coy ext info", node_name_.c_str());
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Update][ext_info_][%s] Failed to copy ext info", node_name_.c_str());
REPORT_CALL_ERROR("E19999", "[%s] Failed to copy ext info.", node_name_.c_str());
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED;
}
@ -53,22 +55,22 @@ Status AicpuExtInfoHandler::Parse(const std::string &ext_info) {
GELOGD("Ext infoType=%d, infoLen=%u.", aicpu_ext_info->infoType, aicpu_ext_info->infoLen);
switch (aicpu_ext_info->infoType) {
case aicpu::FWKAdapter::FWK_ADPT_EXT_SHAPE_TYPE:
GE_CHK_STATUS_RET(ParseExtShapeType(aicpu_ext_info), "Parse ext shape type failed.");
GE_CHK_STATUS_RET(ParseExtShapeType(aicpu_ext_info), "[Parse][ExtShapeType] failed.");
break;
case aicpu::FWKAdapter::FWK_ADPT_EXT_INPUT_SHAPE:
GE_CHK_STATUS_RET(ParseExtInputShape(aicpu_ext_info), "Parse ext input shape failed.");
GE_CHK_STATUS_RET(ParseExtInputShape(aicpu_ext_info), "[Parse][ExtInputShape] failed.");
break;
case aicpu::FWKAdapter::FWK_ADPT_EXT_OUTPUT_SHAPE:
GE_CHK_STATUS_RET(ParseExtOutputShape(aicpu_ext_info), "Parse ext output shape failed.");
GE_CHK_STATUS_RET(ParseExtOutputShape(aicpu_ext_info), "[Parse][ExtOutputShape] failed.");
break;
case aicpu::FWKAdapter::FWK_ADPT_EXT_SESSION_INFO:
GE_CHK_STATUS_RET(ParseExtSessionInfo(aicpu_ext_info), "Parse ext session info failed.");
GE_CHK_STATUS_RET(ParseExtSessionInfo(aicpu_ext_info), "[Parse][ExtSessionInfo] failed.");
break;
case aicpu::FWKAdapter::FWK_ADPT_EXT_BITMAP:
GE_CHK_STATUS_RET(ParseExtBitMap(aicpu_ext_info), "Parse ext bit map failed.");
GE_CHK_STATUS_RET(ParseExtBitMap(aicpu_ext_info), "[Parse][ExtBitMap] failed.");
break;
case aicpu::FWKAdapter::FWK_ADPT_EXT_UPDATE_ADDR:
GE_CHK_STATUS_RET(ParseExtUpdateAddr(aicpu_ext_info), "Parse ext update_addr failed.");
GE_CHK_STATUS_RET(ParseExtUpdateAddr(aicpu_ext_info), "[Parse][ExtUpdateAddr] failed.");
break;
default:
GELOGD("Node[%s] ignore infoType=%d, infoLen=%u.",
@ -79,33 +81,51 @@ Status AicpuExtInfoHandler::Parse(const std::string &ext_info) {
offset += aicpu_ext_info->infoLen;
}
GE_CHK_BOOL_RET_STATUS(offset == ext_info_len_, ACL_ERROR_GE_PARAM_INVALID,
"Node[%s] ext_info format error, parse not reach end, offset=%zu, ext_info_len=%zu.",
GE_IF_BOOL_EXEC(offset != ext_info_len_,
REPORT_INNER_ERROR("E19999", "Node[%s] ext_info format error, parse not reach end,"
"offset=%zu, ext_info_len=%zu.", node_name_.c_str(), offset, ext_info_len_);
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Check][Size]Node[%s] ext_info format error,"
"parse not reach end, offset=%zu, ext_info_len=%zu.",
node_name_.c_str(), offset, ext_info_len_);
return ACL_ERROR_GE_PARAM_INVALID;);
GELOGI("Node[%s] parse ext info end.", node_name_.c_str());
return SUCCESS;
}
Status AicpuExtInfoHandler::ParseExtShapeType(AicpuExtInfo *aicpu_ext_info) {
GE_CHK_BOOL_RET_STATUS(aicpu_ext_info->infoLen == sizeof(int32_t), ACL_ERROR_GE_PARAM_INVALID,
"Node[%s] parse ext shape type failed as infoLen must be %zu but %u.",
GE_IF_BOOL_EXEC(aicpu_ext_info->infoLen != sizeof(int32_t),
REPORT_INNER_ERROR("E19999", "Node[%s] parse ext shape type failed as infoLen must be %zu but %u.",
node_name_.c_str(), sizeof(int32_t), aicpu_ext_info->infoLen);
GELOGE(ACL_ERROR_GE_PARAM_INVALID,
"[Check][Size]Node[%s] parse ext shape type failed as infoLen must be %zu but %u.",
node_name_.c_str(), sizeof(int32_t), aicpu_ext_info->infoLen);
return ACL_ERROR_GE_PARAM_INVALID;);
auto type = reinterpret_cast<const int32_t *>(aicpu_ext_info->infoMsg);
GE_CHK_BOOL_RET_STATUS(*type == unknown_type_, ACL_ERROR_GE_PARAM_INVALID,
"Node[%s] parse ext shape type failed as need %d but %d.",
GE_IF_BOOL_EXEC(*type != unknown_type_,
REPORT_INNER_ERROR("E19999", "Node[%s] parse ext shape type failed as need %d but %d.",
node_name_.c_str(), unknown_type_, *type);
GELOGE(ACL_ERROR_GE_PARAM_INVALID,
"[Check][Type]Node[%s] parse ext shape type failed as need %d but %d.",
node_name_.c_str(), unknown_type_, *type);
return ACL_ERROR_GE_PARAM_INVALID;);
GELOGI("Node[%s] parse ext shape type success infoLen=%u.", node_name_.c_str(), aicpu_ext_info->infoLen);
return SUCCESS;
}
Status AicpuExtInfoHandler::ParseExtInputShape(AicpuExtInfo *aicpu_ext_info) {
auto need_len = input_num_ * sizeof(AicpuShapeAndType);
GE_CHK_BOOL_RET_STATUS(aicpu_ext_info->infoLen == need_len, ACL_ERROR_GE_PARAM_INVALID,
"Node[%s] parse ext input shape failed as infoLen must be "
GE_IF_BOOL_EXEC(aicpu_ext_info->infoLen != need_len,
REPORT_INNER_ERROR("E19999", "Node[%s] parse ext input shape failed as infoLen must be "
"input_num[%u]*sizeof(ShapeAndType)[%zu] but %u.",
node_name_.c_str(), input_num_, sizeof(AicpuShapeAndType),
aicpu_ext_info->infoLen);
GELOGE(ACL_ERROR_GE_PARAM_INVALID,
"[Check][DataLen]Node[%s] parse ext input shape failed as infoLen must be "
"input_num[%u]*sizeof(ShapeAndType)[%zu] but %u.",
node_name_.c_str(), input_num_, sizeof(AicpuShapeAndType), aicpu_ext_info->infoLen);
return ACL_ERROR_GE_PARAM_INVALID;);
auto input = reinterpret_cast<AicpuShapeAndType *>(aicpu_ext_info->infoMsg);
@ -123,10 +143,16 @@ Status AicpuExtInfoHandler::ParseExtOutputShape(AicpuExtInfo *aicpu_ext_info) {
return SUCCESS;
}
auto need_len = output_num_ * sizeof(AicpuShapeAndType);
GE_CHK_BOOL_RET_STATUS(aicpu_ext_info->infoLen == need_len, ACL_ERROR_GE_PARAM_INVALID,
"Node[%s] parse ext output shape failed as infoLen must be "
GE_IF_BOOL_EXEC(aicpu_ext_info->infoLen != need_len,
REPORT_INNER_ERROR("E19999", "Node[%s] parse ext output shape failed as infoLen must be "
"output_num[%u]*sizeof(ShapeAndType)[%zu] but %u.",
node_name_.c_str(), output_num_, sizeof(AicpuShapeAndType),
aicpu_ext_info->infoLen);
GELOGE(ACL_ERROR_GE_PARAM_INVALID,
"[Check][DataLen]Node[%s] parse ext output shape failed as infoLen must be "
"output_num[%u]*sizeof(ShapeAndType)[%zu] but %u.",
node_name_.c_str(), output_num_, sizeof(AicpuShapeAndType), aicpu_ext_info->infoLen);
return ACL_ERROR_GE_PARAM_INVALID;);
auto output = reinterpret_cast<AicpuShapeAndType *>(aicpu_ext_info->infoMsg);
for (uint32_t index = 0; index < output_num_; ++index) {
@ -137,9 +163,14 @@ Status AicpuExtInfoHandler::ParseExtOutputShape(AicpuExtInfo *aicpu_ext_info) {
}
Status AicpuExtInfoHandler::ParseExtSessionInfo(AicpuExtInfo *aicpu_ext_info) {
GE_CHK_BOOL_RET_STATUS(aicpu_ext_info->infoLen == sizeof(AicpuSessionInfo), ACL_ERROR_GE_PARAM_INVALID,
GE_IF_BOOL_EXEC(aicpu_ext_info->infoLen != sizeof(AicpuSessionInfo),
REPORT_INNER_ERROR("E19999",
"Node[%s] parse ext session info failed as infoLen must be %zu but %u.",
node_name_.c_str(), sizeof(SessionInfo), aicpu_ext_info->infoLen);
GELOGE(ACL_ERROR_GE_PARAM_INVALID,
"[Check][DataLen]Node[%s] parse ext session info failed as infoLen must be %zu but %u.",
node_name_.c_str(), sizeof(SessionInfo), aicpu_ext_info->infoLen);
return ACL_ERROR_GE_PARAM_INVALID;);
session_info_ = reinterpret_cast<AicpuSessionInfo *>(aicpu_ext_info->infoMsg);
GELOGI("Node[%s] parse session info success infoLen=%u.", node_name_.c_str(), aicpu_ext_info->infoLen);
@ -147,9 +178,14 @@ Status AicpuExtInfoHandler::ParseExtSessionInfo(AicpuExtInfo *aicpu_ext_info) {
}
Status AicpuExtInfoHandler::ParseExtBitMap(AicpuExtInfo *aicpu_ext_info) {
GE_CHK_BOOL_RET_STATUS(aicpu_ext_info->infoLen == sizeof(uint64_t), PARAM_INVALID,
GE_IF_BOOL_EXEC(aicpu_ext_info->infoLen != sizeof(uint64_t),
REPORT_INNER_ERROR("E19999",
"Node[%s] parse bit_map info failed as infoLen must be %zu but %u.",
node_name_.c_str(), sizeof(uint64_t), aicpu_ext_info->infoLen);
GELOGE(PARAM_INVALID,
"[Check][DataLen]Node[%s] parse bit_map info failed as infoLen must be %zu but %u.",
node_name_.c_str(), sizeof(uint64_t), aicpu_ext_info->infoLen);
return PARAM_INVALID;);
bit_map_ = reinterpret_cast<uint64_t *>(aicpu_ext_info->infoMsg);
GELOGI("Node[%s] bit_map info success infoLen=%u.", node_name_.c_str(), aicpu_ext_info->infoLen);
@ -157,9 +193,14 @@ Status AicpuExtInfoHandler::ParseExtBitMap(AicpuExtInfo *aicpu_ext_info) {
}
Status AicpuExtInfoHandler::ParseExtUpdateAddr(AicpuExtInfo *aicpu_ext_info) {
GE_CHK_BOOL_RET_STATUS(aicpu_ext_info->infoLen == sizeof(uint32_t), PARAM_INVALID,
GE_IF_BOOL_EXEC(aicpu_ext_info->infoLen != sizeof(uint32_t),
REPORT_INNER_ERROR("E19999",
"Node[%s] parse update_addr info failed as infoLen must be %zu but %u.",
node_name_.c_str(), sizeof(uint32_t), aicpu_ext_info->infoLen);
GELOGE(PARAM_INVALID,
"[Check][DataLen]Node[%s] parse update_addr info failed as infoLen must be %zu but %u.",
node_name_.c_str(), sizeof(uint32_t), aicpu_ext_info->infoLen);
return PARAM_INVALID;);
update_addr_ = reinterpret_cast<uint32_t *>(aicpu_ext_info->infoMsg);
GELOGI("Node[%s] update_addr info success infoLen=%u.", node_name_.c_str(), aicpu_ext_info->infoLen);
@ -207,15 +248,19 @@ Status AicpuExtInfoHandler::UpdateInputShapeAndType(uint32_t input_index, const
const auto &shape = input_desc.GetShape();
GE_CHK_STATUS_RET(UpdateShapeAndType(shape, input_desc.GetDataType(), input_shape_and_type_[input_index]),
"Node[%s] input[%u] update input shape and type failed.",
"[Update][ShapeAndType] failed, Node[%s] input[%u] .",
node_name_.c_str(), input_index);
return SUCCESS;
}
Status AicpuExtInfoHandler::UpdateOutputShapeAndType(uint32_t output_index, const GeTensorDesc &output_desc) {
GE_CHK_BOOL_RET_STATUS((unknown_type_ != DEPEND_COMPUTE), ACL_ERROR_GE_INTERNAL_ERROR,
"Node[%s] is depend compute is no need update output shape and type by ext.",
GE_IF_BOOL_EXEC((unknown_type_ == DEPEND_COMPUTE),
REPORT_INNER_ERROR("E19999", "Node[%s] is depend compute is no need update output shape"
"and type by ext.", node_name_.c_str());
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR,
"[Check][Type]Node[%s] is depend compute is no need update output shape and type by ext.",
node_name_.c_str());
return ACL_ERROR_GE_INTERNAL_ERROR;);
GE_CHECK_LE(output_index, output_num_);
auto shape = output_desc.GetShape();
@ -223,9 +268,13 @@ Status AicpuExtInfoHandler::UpdateOutputShapeAndType(uint32_t output_index, cons
if (unknown_type_ == DEPEND_SHAPE_RANGE) {
std::vector<std::pair<int64_t, int64_t>> range;
auto range_ret = output_desc.GetShapeRange(range);
GE_CHK_BOOL_RET_STATUS(range_ret == GRAPH_SUCCESS, ACL_ERROR_GE_INTERNAL_ERROR,
"Node[%s] is shape range type but get GetShapeRange failed, ret=%u.",
GE_IF_BOOL_EXEC(range_ret != GRAPH_SUCCESS,
REPORT_INNER_ERROR("E19999", "Node[%s] is shape range type but get GetShapeRange failed, ret=%u",
node_name_.c_str(), range_ret);
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR,
"[Invoke][GetShapeRange]Node[%s] is shape range type but get GetShapeRange failed, ret=%u",
node_name_.c_str(), range_ret);
return ACL_ERROR_GE_INTERNAL_ERROR;);
for (size_t k = 0; k < range.size(); ++k) {
if (shape.GetDim(k) < 0 && k < range.size()) {
GELOGD("Node[%s] output[%u] update dim[%zu] from %ld to range max %ld.",
@ -239,9 +288,14 @@ Status AicpuExtInfoHandler::UpdateOutputShapeAndType(uint32_t output_index, cons
}
Status AicpuExtInfoHandler::GetOutputShapeAndType(uint32_t output_index, GeShape &shape, DataType &data_type) {
GE_CHK_BOOL_RET_STATUS((unknown_type_ != DEPEND_COMPUTE), INTERNAL_ERROR,
GE_IF_BOOL_EXEC((unknown_type_ == DEPEND_COMPUTE),
REPORT_INNER_ERROR("E19999",
"Node[%s] is depend compute type can not get output shape and type by ext.",
node_name_.c_str());
GELOGE(INTERNAL_ERROR,
"[Check][Type]Node[%s] is depend compute type can not get output shape and type by ext.",
node_name_.c_str());
return INTERNAL_ERROR;);
GetShapeAndType(output_shape_and_type_[output_index], shape, data_type);
return SUCCESS;
}
@ -254,7 +308,10 @@ Status AicpuExtInfoHandler::UpdateShapeAndType(const GeShape &shape, DataType da
AicpuShapeAndType *shape_and_type) {
auto dim_num = shape.GetDimNum();
if (dim_num > aicpu::FWKAdapter::kMaxShapeDims) {
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "Update shape and type failed, as dim_num %zu is over max shape dims %u.",
GELOGE(ACL_ERROR_GE_PARAM_INVALID,
"[Check][DimNum]Update shape and type failed, as dim_num %zu is over max shape dims %u.",
dim_num, aicpu::FWKAdapter::kMaxShapeDims);
REPORT_INNER_ERROR("E19999", "Update shape and type failed, as dim_num %zu is over max shape dims %u.",
dim_num, aicpu::FWKAdapter::kMaxShapeDims);
return ACL_ERROR_GE_PARAM_INVALID;
}

File diff suppressed because it is too large Load Diff

@ -217,7 +217,8 @@ bool CheckDynamicDimsInputShapeValid(const map<string, vector<int64_t>> &shape_m
"E10001", {"parameter", "value", "reason"},
{"--input_shape's dynamic dim num", "0", "at least one dim should be -1 when set dynamic_dims"});
GELOGE(ge::PARAM_INVALID,
"[Check][DynamicDimsInputShape]--input_shape invalid, at least one dim should be -1 when set dynamic_dims.");
"[Check][DynamicDimsInputShape]--input_shape invalid,"
"at least one dim should be -1 when set dynamic_dims.");
return false;
}
@ -392,7 +393,6 @@ bool ParseInputShapeRange(const std::string &shape_range,
}
shape_range_map.emplace(make_pair(StringUtils::Trim(shape_range_pair_vec[0]), shape_range_val));
}
return true;
}
@ -547,8 +547,8 @@ bool ParseInputShape(const string &input_shape, map<string, vector<int64_t>> &sh
Status CheckOutputTypeParamValid(const std::string output_type) {
if ((!output_type.empty()) && (kOutputTypeSupportDatatype.find(output_type) == kOutputTypeSupportDatatype.end())) {
ErrorManager::GetInstance().ATCReportErrMessage(
"E10001", {"parameter", "value", "reason"}, {"--output_type", output_type, kOutputTypeSupport});
ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"},
{"--output_type", output_type, kOutputTypeSupport});
GELOGE(ge::PARAM_INVALID,
"[Check][Param]Invalid value for --output_type[%s], %s.", output_type.c_str(), kOutputTypeSupport);
return ge::PARAM_INVALID;
@ -559,8 +559,8 @@ Status CheckOutputTypeParamValid(const std::string output_type) {
Status CheckBufferOptimizeParamValid(const std::string buffer_optimize) {
if ((!buffer_optimize.empty()) &&
(kBufferOptimizeSupportOption.find(buffer_optimize) == kBufferOptimizeSupportOption.end())) {
ErrorManager::GetInstance().ATCReportErrMessage(
"E10001", {"parameter", "value", "reason"}, {"--buffer_optimize", buffer_optimize, kBufferOptimizeSupport});
ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"},
{"--buffer_optimize", buffer_optimize, kBufferOptimizeSupport});
GELOGE(ge::PARAM_INVALID,
"[Check][BufferOptimize]Invalid value for [%s], %s.", buffer_optimize.c_str(), kBufferOptimizeSupport);
return ge::PARAM_INVALID;
@ -577,10 +577,10 @@ Status CheckCompressWeightParamValid(const std::string enable_compress_weight,
return ge::PARAM_INVALID;
}
if ((enable_compress_weight != "") && (enable_compress_weight != "true") && (enable_compress_weight != "false")) {
ErrorManager::GetInstance().ATCReportErrMessage(
"E10005", {"parameter", "value"}, {"enable_compress_weight", enable_compress_weight});
GELOGE(ge::PARAM_INVALID,
"[Check][Param:enable_compress_weight]Input parameter[--enable_compress_weight]'s value:%s must be true or false.",
ErrorManager::GetInstance().ATCReportErrMessage("E10005", {"parameter", "value"},
{"enable_compress_weight", enable_compress_weight});
GELOGE(ge::PARAM_INVALID, "[Check][Param:enable_compress_weight]"
"Input parameter[--enable_compress_weight]'s value:%s must be true or false.",
enable_compress_weight.c_str());
return ge::PARAM_INVALID;
}
@ -597,8 +597,8 @@ Status CheckCompressWeightParamValid(const std::string enable_compress_weight,
Status CheckKeepTypeParamValid(const std::string &keep_dtype) {
if ((!keep_dtype.empty()) && (!CheckInputPathValid(keep_dtype, "--keep_dtype"))) {
ErrorManager::GetInstance().ATCReportErrMessage(
"E10001", {"parameter", "value", "reason"}, {"--keep_dtype", keep_dtype, kKeepDtypeError});
ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"},
{"--keep_dtype", keep_dtype, kKeepDtypeError});
GELOGE(ge::PARAM_INVALID, "[Check][InputPath::--keep_dtype] file not found, file_name:%s", keep_dtype.c_str());
return ge::PARAM_INVALID;
}
@ -654,8 +654,8 @@ Status CheckDisableReuseMemoryParamValid(const std::string disable_reuse_memory)
Status CheckEnableSingleStreamParamValid(const std::string enable_single_stream) {
if ((enable_single_stream != "") && (enable_single_stream != "true") && (enable_single_stream != "false")) {
ErrorManager::GetInstance().ATCReportErrMessage(
"E10005", {"parameter", "value"}, {"enable_single_stream", enable_single_stream});
ErrorManager::GetInstance().ATCReportErrMessage("E10005", {"parameter", "value"},
{"enable_single_stream", enable_single_stream});
GELOGE(ge::PARAM_INVALID, "[Check][Param:--enable_single_stream] value:%s must be true or false.",
enable_single_stream.c_str());
return ge::PARAM_INVALID;
@ -667,7 +667,8 @@ Status CheckImplmodeParamValid(const std::string &optypelist_for_implmode, std::
// only appointed op_select_implmode, can user appoint optypelist_for_implmode
if (optypelist_for_implmode != "" && op_select_implmode == "") {
ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"},
{"--op_select_implmode", op_select_implmode.c_str(), kCompressWeightError});
{"--op_select_implmode", op_select_implmode.c_str(),
kCompressWeightError});
GELOGE(ge::PARAM_INVALID, "[Check][Param:--op_select_implmode]value:%s invalid, %s.",
op_select_implmode.c_str(), kCompressWeightError);
return ge::PARAM_INVALID;
@ -679,7 +680,8 @@ Status CheckImplmodeParamValid(const std::string &optypelist_for_implmode, std::
if (op_select_implmode != IR_OPTION_OP_SELECT_IMPLMODE_DEFAULT &&
op_select_implmode != IR_OPTION_OP_SELECT_IMPLMODE_PRECISON) {
ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"},
{"--op_select_implmode", op_select_implmode.c_str(), kSelectImplmodeError});
{"--op_select_implmode", op_select_implmode.c_str(),
kSelectImplmodeError});
GELOGE(ge::PARAM_INVALID, "[Check][Implmode]Invalid value for --op_select_implmode[%s], %s.",
op_select_implmode.c_str(), kSelectImplmodeError);
return ge::PARAM_INVALID;

@ -562,7 +562,8 @@ graphStatus Impl::InitDomiOmgContext(const string &input_shape, const string &in
if (iter != ge::input_format_str_to_geformat.end()) {
omg_context_.format = iter->second;
} else {
GELOGE(GRAPH_PARAM_INVALID, "[Check][Param:InputForamt] %s not support , expect ND/NCHW/NHWC/CHWN/NC1HWC0/NHWC1C0.",
GELOGE(GRAPH_PARAM_INVALID,
"[Check][Param:InputForamt] %s not support , expect ND/NCHW/NHWC/CHWN/NC1HWC0/NHWC1C0.",
input_format.c_str());
return GRAPH_PARAM_INVALID;
}
@ -573,7 +574,7 @@ graphStatus Impl::InitDomiOmgContext(const string &input_shape, const string &in
}
if (!ParseInputShape(input_shape, omg_context_.input_dims, omg_context_.user_input_dims, is_dynamic_input)) {
GELOGE(GRAPH_PARAM_INVALID, "[Parse][InputShape:ImputShape] Failed, shape: %s", input_shape.c_str());
GELOGE(GRAPH_PARAM_INVALID, "[Parse][InputShape:input_shape] Failed, shape: %s", input_shape.c_str());
return GRAPH_PARAM_INVALID;
}
return GRAPH_SUCCESS;

@ -152,7 +152,8 @@ Status OpsKernelBuilderManager::GenerateTask(const Node &node,
const std::string &lib_name = op_desc->GetOpKernelLibName();
auto it = ops_kernel_builders_.find(lib_name);
if (it == ops_kernel_builders_.end()) {
GELOGE(INTERNAL_ERROR, "[Find][LibName]fail for libName = %s, node:%s", lib_name.c_str(), op_desc->GetName().c_str());
GELOGE(INTERNAL_ERROR, "[Find][LibName]fail for libName = %s, node:%s", lib_name.c_str(),
op_desc->GetName().c_str());
REPORT_INNER_ERROR("E19999", "find LibName for GenerateTask failed, libName = %s, node = %s not exist",
lib_name.c_str(), op_desc->GetName().c_str());
return INTERNAL_ERROR;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save