From f116a0d2bc297f5088e0253ccdb9b3035a19a452 Mon Sep 17 00:00:00 2001 From: caifubi Date: Tue, 28 Apr 2020 19:35:05 +0800 Subject: [PATCH] save graph and task desc info to framework file --- .../device/ascend/ascend_kernel_runtime.cc | 4 +- .../ascend/profiling/profiling_utils.cc | 77 +++++++++++------- .../device/ascend/profiling/profiling_utils.h | 7 +- .../profiling/reporter/desc_reporter.cc | 64 +++++++++++++++ .../ascend/profiling/reporter/desc_reporter.h | 49 +++++++++++ .../profiling/reporter/graph_desc_reporter.cc | 65 +++++++++++++++ .../profiling/reporter/graph_desc_reporter.h | 37 +++++++++ .../profiling/reporter/profiling_desc.cc | 81 +++++++++++++++++++ .../profiling/reporter/profiling_desc.h | 75 +++++++++++++++++ .../profiling/reporter/task_desc_reporter.cc | 51 ++++++++++++ .../profiling/reporter/task_desc_reporter.h | 41 ++++++++++ .../device/ascend/tasksink/task_generator.cc | 7 +- .../ccsrc/kernel/aicpu/aicpu_kernel_mod.cc | 6 +- .../ccsrc/kernel/aicpu/aicpu_kernel_mod.h | 4 +- mindspore/ccsrc/kernel/ascend_kernel_mod.h | 6 ++ mindspore/ccsrc/kernel/hccl/hccl_kernel.cc | 6 +- mindspore/ccsrc/kernel/hccl/hccl_kernel.h | 4 +- mindspore/ccsrc/kernel/mng/assign.cc | 8 +- mindspore/ccsrc/kernel/mng/memcpy_async.cc | 8 +- mindspore/ccsrc/kernel/mng/memcpy_async.h | 0 .../ccsrc/kernel/mng/profiling_kernel_mod.cc | 1 + mindspore/ccsrc/kernel/mng/recv.cc | 1 + mindspore/ccsrc/kernel/mng/send.cc | 1 + mindspore/ccsrc/kernel/mng/send.h | 4 +- mindspore/ccsrc/kernel/mng/stream_active.cc | 1 + mindspore/ccsrc/kernel/mng/stream_active.h | 4 +- mindspore/ccsrc/kernel/mng/stream_switch.cc | 1 + mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.cc | 16 ++-- mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.h | 4 +- 29 files changed, 568 insertions(+), 65 deletions(-) create mode 100644 mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc create mode 100644 mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.h create mode 100644 mindspore/ccsrc/device/ascend/profiling/reporter/graph_desc_reporter.cc create mode 100644 mindspore/ccsrc/device/ascend/profiling/reporter/graph_desc_reporter.h create mode 100644 mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.cc create mode 100644 mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h create mode 100644 mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.cc create mode 100644 mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h mode change 100755 => 100644 mindspore/ccsrc/kernel/hccl/hccl_kernel.cc mode change 100755 => 100644 mindspore/ccsrc/kernel/mng/memcpy_async.h diff --git a/mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc b/mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc index d9b3e6ebe4..d78c2f9206 100644 --- a/mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc +++ b/mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc @@ -337,8 +337,8 @@ bool AscendKernelRuntime::LoadTask(const session::KernelGraph *graph) { return false; } if (ProfilingManager::GetInstance().IsProfiling()) { - std::vector task_ids = ge::model_runner::ModelRunner::Instance().GetTaskIdList(model_iter->first); - ProfilingUtils::ReportProfilingData(graph->graph_id(), task_ids); + auto task_ids = ge::model_runner::ModelRunner::Instance().GetTaskIdList(model_iter->first); + ProfilingUtils::ReportProfilingData(task_ids, NOT_NULL(graph)); } return true; } diff --git a/mindspore/ccsrc/device/ascend/profiling/profiling_utils.cc b/mindspore/ccsrc/device/ascend/profiling/profiling_utils.cc index 1f87bf7bfa..a322a8e577 100644 --- a/mindspore/ccsrc/device/ascend/profiling/profiling_utils.cc +++ b/mindspore/ccsrc/device/ascend/profiling/profiling_utils.cc @@ -15,12 +15,15 @@ */ #include +#include "device/ascend/profiling/reporter/graph_desc_reporter.h" #include "device/ascend/profiling/profiling_utils.h" #include "kernel/kernel.h" #include "device/ascend/profiling/profiling_manager.h" #include "session/anf_runtime_algorithm.h" #include "common/utils.h" #include "utils/utils.h" +#include "device/ascend/profiling/reporter/task_desc_reporter.h" +#include "utils/context/ms_context.h" namespace mindspore { namespace device { @@ -30,6 +33,7 @@ constexpr char kCustomNode[] = "PROFILING_CUSTOM_"; constexpr char kFpStartNode[] = "PROFILING_FP_START"; constexpr char kBpEndNode[] = "PROFILING_BP_END"; constexpr char kIterEndNode[] = "PROFILING_ITER_END"; +std::unordered_map> ProfilingUtils::graph_profiling_cnode_; std::unordered_map> ProfilingUtils::graph_kernel_name_; uint32_t ProfilingUtils::custom_node_index_ = 1; @@ -77,7 +81,7 @@ std::string ProfilingUtils::GetTraceBegin(const std::vector &cnode_exe return std::string(trace_begin); } - std::string fp_start_str = ""; + std::string fp_start_str; std::set getnext_outputs; GetCNodeOutputRealNode(kGetNextOpName, cnode_exec_order, NOT_NULL(&getnext_outputs)); if (getnext_outputs.empty()) { @@ -97,8 +101,8 @@ std::string ProfilingUtils::GetTraceBegin(const std::vector &cnode_exe void ProfilingUtils::GetCNodeOutputRealNode(const std::string &node_name, const std::vector &cnode_exec_order, NotNull *> getnext_outputs) { - for (auto cnode : cnode_exec_order) { - for (auto input : cnode->inputs()) { + for (const auto &cnode : cnode_exec_order) { + for (const auto &input : cnode->inputs()) { auto prev_cnode = AnfAlgo::VisitKernel(input, 0); if (!prev_cnode.first->isa()) { continue; @@ -120,7 +124,7 @@ std::string ProfilingUtils::GetTraceBpEnd(const std::vector &cnode_exe if (trace_bp_end != nullptr) { return std::string(trace_bp_end); } - std::string bp_end_str = ""; + std::string bp_end_str; // Contain hccl kernel auto iter = cnode_exec_order.rbegin(); while (iter != cnode_exec_order.rend()) { @@ -154,7 +158,7 @@ std::string ProfilingUtils::GetTraceBpEnd(const std::vector &cnode_exe } std::string ProfilingUtils::GetGraphLastTbeKernelName(const std::vector &cnode_exec_order) { - std::string last_tbe_kernel_name = ""; + std::string last_tbe_kernel_name; // find last tbe_kernel for (auto iter = cnode_exec_order.rbegin(); iter != cnode_exec_order.rend(); ++iter) { if (AnfAlgo::GetKernelType(*iter) == TBE_KERNEL) { @@ -276,40 +280,51 @@ void ProfilingUtils::ProfilingTraceEnd(const AnfNodePtr &anf_node, const Profili } void ProfilingUtils::SetGraphKernelName(uint32_t graph_id, const std::vector &kernel_names) { - auto iter = graph_kernel_name_.find(graph_id); - if (iter == graph_kernel_name_.end()) { - graph_kernel_name_[graph_id] = kernel_names; - } else { - MS_LOG(ERROR) << "[profiling]graph kernel names already exist"; + auto ret = graph_kernel_name_.try_emplace(graph_id, kernel_names); + if (!ret.second) { + MS_LOG(ERROR) << "[profiling]graph " << graph_id << " kernel names already exist"; } } -void ProfilingUtils::ReportProfilingData(uint32_t graph_id, const std::vector &task_ids) { - auto iter = graph_kernel_name_.find(graph_id); - if (iter == graph_kernel_name_.end()) { - MS_LOG(ERROR) << "[profiling]graph id " << graph_id << " not in graph_kernel_name_"; - return; +void ProfilingUtils::SetGraphProfilingCNode(uint32_t graph_id, const std::vector &profiling_cnode_list) { + auto ret = graph_profiling_cnode_.try_emplace(graph_id, profiling_cnode_list); + if (!ret.second) { + MS_LOG(ERROR) << "[profiling]graph " << graph_id << " profiling cnode list already exist"; } - auto &kernel_names = iter->second; +} - MS_LOG(INFO) << "kernel_names size:" << kernel_names.size() << ", task_ids size:" << task_ids.size(); - if (kernel_names.size() != task_ids.size()) { - MS_LOG(ERROR) << "[profiling]kernel name and task id not match"; - return; - } - std::map op_task_id_map; - size_t size = kernel_names.size(); - for (size_t i = 0; i < size; ++i) { - auto it = op_task_id_map.find(task_ids[i]); - if (it != op_task_id_map.end()) { - MS_LOG(WARNING) << "task_id " << task_ids[i] << " exist, " << kernel_names[i]; - continue; +bool ProfilingUtils::ValidComputeGraph(NotNull graph_ptr) { + for (const auto &node : graph_ptr->execution_order()) { + if (AnfAlgo::GetKernelType(node) == TBE_KERNEL) { + return true; } - op_task_id_map[task_ids[i]] = kernel_names[i]; } - if (!ProfilingManager::GetInstance().ReportProfilingData(op_task_id_map)) { - MS_LOG(ERROR) << "ReportProfilingData failed"; + return false; +} + +void ProfilingUtils::ReportProfilingData(const std::vector &task_ids, + NotNull graph) { + if (!ValidComputeGraph(graph)) { + MS_LOG(WARNING) << "Not a valid compute graph:" << graph->graph_id(); + return; + } + + auto ret = graph_profiling_cnode_.find(graph->graph_id()); + if (ret == graph_profiling_cnode_.end()) { + MS_LOG(ERROR) << "Graph id not found"; + return; } + + auto context = MsContext::GetInstance(); + MS_EXCEPTION_IF_NULL(context); + TaskDescReporter task_reporter(context->device_id(), "vm.task_desc_info_" + std::to_string(graph->graph_id()), + ret->second); + task_reporter.set_task_ids(task_ids); + task_reporter.ReportData(); + + GraphDescReporter graph_reporter(context->device_id(), "vm.graph_desc_info_" + std::to_string(graph->graph_id()), + ret->second); + graph_reporter.ReportData(); } } // namespace ascend } // namespace device diff --git a/mindspore/ccsrc/device/ascend/profiling/profiling_utils.h b/mindspore/ccsrc/device/ascend/profiling/profiling_utils.h index 6986eaab54..39ea80a2e9 100644 --- a/mindspore/ccsrc/device/ascend/profiling/profiling_utils.h +++ b/mindspore/ccsrc/device/ascend/profiling/profiling_utils.h @@ -80,12 +80,14 @@ class ProfilingUtils { NotNull *> kernel_list); // Mapping graph id and the kernels' name in the graph + static void SetGraphProfilingCNode(uint32_t graph_id, const std::vector &profiling_cnode_list); + static void SetGraphKernelName(uint32_t graph_id, const std::vector &kernel_names); // Mapping task_id and kernel name for device to generate the time cost of specific kernel. // Device calculate the time cost of the task which is marked by task id. // But we need data of (kernel name , time cost) - static void ReportProfilingData(uint32_t graph_id, const std::vector &task_ids); + static void ReportProfilingData(const std::vector &task_ids, NotNull graph); // Get profiling trace point from envs. // export PROFILING_FP_START='full name of the first cnode to execute' @@ -122,7 +124,10 @@ class ProfilingUtils { static void GetCNodeOutputRealNode(const std::string &node_name, const std::vector &cnode_exec_order, NotNull *> getnext_outputs); + static bool ValidComputeGraph(NotNull graph_ptr); + // graph id --> (kernel name list) + static std::unordered_map> graph_profiling_cnode_; static std::unordered_map> graph_kernel_name_; static uint32_t custom_node_index_; }; diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc b/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc new file mode 100644 index 0000000000..10cbb77964 --- /dev/null +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc @@ -0,0 +1,64 @@ +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "device/ascend/profiling/reporter/desc_reporter.h" +#include "device/ascend/profiling/plugin_impl.h" +#include "utils/log_adapter.h" + +constexpr size_t kReportMaxLen = 2048; + +namespace mindspore { +namespace device { +namespace ascend { +DescReporter::~DescReporter() = default; + +void DescReporter::ReportByLine(const std::string &data, const std::string &file_name) const { + auto reporter = PluginImpl::GetPluginReporter(); + MS_EXCEPTION_IF_NULL(reporter); + + auto tot_size = data.size(); + size_t cur_size = 0; + while (cur_size < tot_size) { + size_t remain_size = tot_size - cur_size; + size_t report_size = std::min(remain_size, kReportMaxLen); + + Msprof::Engine::ReporterData report_data{}; + report_data.deviceId = device_id_; + report_data.dataLen = report_size; + report_data.data = (unsigned char *)data.c_str() + cur_size; + auto ret = memcpy_s(report_data.tag, MSPROF_ENGINE_MAX_TAG_LEN + 1, file_name.c_str(), file_name.length()); + if (ret != 0) { + MS_LOG(EXCEPTION) << "memcpy_s report data tag failed"; + } + auto report_ret = reporter->Report(&report_data); + if (report_ret != 0) { + MS_LOG(EXCEPTION) << "report data failed"; + } + cur_size += report_size; + } +} + +void DescReporter::ReportData() { + for (const auto &desc : prof_desc_) { + auto data = desc->ToString(); + ReportByLine(data, file_name_); + } +} + +} // namespace ascend +} // namespace device +} // namespace mindspore diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.h b/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.h new file mode 100644 index 0000000000..b8f0cd2f25 --- /dev/null +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.h @@ -0,0 +1,49 @@ +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_DESC_REPORTER_H_ +#define MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_DESC_REPORTER_H_ + +#include +#include +#include +#include +#include "toolchain/prof_reporter.h" +#include "device/ascend/profiling/reporter/profiling_desc.h" +#include "utils/contract.h" +#include "session/kernel_graph.h" + +namespace mindspore { +namespace device { +namespace ascend { +class DescReporter { + public: + virtual ~DescReporter() = 0; + DescReporter(int device_id, std::string file_name, std::vector cnode_list) + : device_id_(device_id), file_name_(std::move(file_name)), cnode_list_(std::move(cnode_list)) {} + virtual void ReportData(); + + protected: + void ReportByLine(const std::string &data, const std::string &file_name) const; + int device_id_; + std::string file_name_; + std::vector cnode_list_; + std::vector> prof_desc_; +}; +} // namespace ascend +} // namespace device +} // namespace mindspore +#endif // MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_DESC_REPORTER_H_ diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/graph_desc_reporter.cc b/mindspore/ccsrc/device/ascend/profiling/reporter/graph_desc_reporter.cc new file mode 100644 index 0000000000..f4f4b3362c --- /dev/null +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/graph_desc_reporter.cc @@ -0,0 +1,65 @@ +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include "device/ascend/profiling/reporter/graph_desc_reporter.h" +#include "session/anf_runtime_algorithm.h" + +namespace mindspore { +namespace device { +namespace ascend { +void GraphDescReporter::ReportData() { + for (const auto &node : cnode_list_) { + if (AnfAlgo::GetKernelType(node) != TBE_KERNEL) { + MS_LOG(WARNING) << "Skip non tbe kernel"; + continue; + } + std::vector input_data_list; + std::vector output_data_list; + auto op_name = node->fullname_with_scope(); + auto op_type = AnfAlgo::GetCNodeName(node); + auto input_size = AnfAlgo::GetInputTensorNum(node); + for (size_t i = 0; i < input_size; ++i) { + auto input_node_with_index = AnfAlgo::GetPrevNodeOutput(node, i); + auto input_node = input_node_with_index.first; + auto input_index = input_node_with_index.second; + DataElement element{}; + element.index_ = i; + element.data_type_ = AnfAlgo::GetOutputDeviceDataType(input_node, input_index); + element.data_format_ = AnfAlgo::GetOutputFormat(input_node, input_index); + element.data_shape_ = AnfAlgo::GetOutputDeviceShape(input_node, input_index); + input_data_list.emplace_back(element); + } + + auto output_size = AnfAlgo::GetOutputTensorNum(node); + for (size_t i = 0; i < output_size; ++i) { + DataElement element{}; + element.index_ = i; + element.data_type_ = AnfAlgo::GetOutputDeviceDataType(node, i); + element.data_format_ = AnfAlgo::GetOutputFormat(node, i); + element.data_shape_ = AnfAlgo::GetOutputDeviceShape(node, i); + output_data_list.emplace_back(element); + } + + auto graph_desc = std::make_shared(op_name, op_type, input_data_list, output_data_list); + prof_desc_.emplace_back(graph_desc); + } + DescReporter::ReportData(); +} +} // namespace ascend +} // namespace device +} // namespace mindspore diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/graph_desc_reporter.h b/mindspore/ccsrc/device/ascend/profiling/reporter/graph_desc_reporter.h new file mode 100644 index 0000000000..0365472ae9 --- /dev/null +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/graph_desc_reporter.h @@ -0,0 +1,37 @@ +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_GRAPH_DESC_REPORTER_H_ +#define MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_GRAPH_DESC_REPORTER_H_ + +#include +#include +#include +#include "device/ascend/profiling/reporter/desc_reporter.h" + +namespace mindspore { +namespace device { +namespace ascend { +class GraphDescReporter : public DescReporter { + public: + GraphDescReporter(uint32_t device_id, const std::string &file_name, std::vector cnode_list) + : DescReporter(device_id, file_name, std::move(cnode_list)) {} + void ReportData() override; +}; +} // namespace ascend +} // namespace device +} // namespace mindspore +#endif // MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_GRAPH_DESC_REPORTER_H_ diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.cc b/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.cc new file mode 100644 index 0000000000..f28f133e1a --- /dev/null +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.cc @@ -0,0 +1,81 @@ +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include "device/ascend/profiling/reporter/profiling_desc.h" + +namespace mindspore { +namespace device { +namespace ascend { +std::string TaskDesc::ToString() { + std::string out = op_name_; + out.append(" ") + .append(std::to_string(block_dim_)) + .append(" ") + .append(std::to_string(task_id_)) + .append(" ") + .append(std::to_string(stream_id_)) + .append("\n"); + return out; +} + +std::string GraphDesc::ToString() { + std::string desc; + desc.append("op_name:").append(op_name_).append(" op_type:").append(op_type_); + int input_id = 0; + for (const auto &element : input_data_list_) { + desc.append(" input_id:") + .append(std::to_string(input_id++)) + .append(" input_format:") + .append(element.data_format_) + .append(" input_data_type:") + .append(std::to_string(element.data_type_)) + .append(" input_shape:") + .append(DataShapeToString(element.data_shape_)); + } + + input_id = 0; + for (const auto &element : output_data_list_) { + desc.append(" output_id:") + .append(std::to_string(input_id++)) + .append(" output_format:") + .append(element.data_format_) + .append(" output_data_type:") + .append(std::to_string(element.data_type_)) + .append(" output_shape:") + .append((DataShapeToString(element.data_shape_))); + } + + desc.append("\n"); + + return desc; +} + +std::string GraphDesc::DataShapeToString(const std::vector &shape) { + std::ostringstream oss; + oss << "\""; + if (!shape.empty()) { + std::copy(shape.begin(), shape.end() - 1, std::ostream_iterator(oss, ",")); + oss << shape.back(); + } + oss << "\""; + return oss.str(); +} +} // namespace ascend +} // namespace device +} // namespace mindspore diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h b/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h new file mode 100644 index 0000000000..2da56ceb93 --- /dev/null +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h @@ -0,0 +1,75 @@ +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_PROFILING_DESC_H_ +#define MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_PROFILING_DESC_H_ + +#include +#include +#include + +namespace mindspore { +namespace device { +namespace ascend { +class ProfDesc { + public: + explicit ProfDesc(std::string op_name) : op_name_(std::move(op_name)) {} + virtual std::string ToString() = 0; + + protected: + std::string op_name_; +}; + +class TaskDesc : public ProfDesc { + public: + TaskDesc(std::string op_name, uint32_t task_id, uint32_t block_dim, uint32_t stream_id) + : ProfDesc(std::move(op_name)), task_id_(task_id), block_dim_(block_dim), stream_id_(stream_id) {} + std::string ToString() override; + + private: + uint32_t task_id_; + uint32_t block_dim_; + uint32_t stream_id_; +}; + +struct DataElement { + size_t index_; + std::string data_format_; + int data_type_; + std::vector data_shape_; +}; + +class GraphDesc : public ProfDesc { + public: + GraphDesc(std::string op_name, std::string op_type, std::vector input_data_list, + std::vector output_data_list) + : ProfDesc(std::move(op_name)), + op_type_(std::move(op_type)), + input_data_list_(std::move(input_data_list)), + output_data_list_(std::move(output_data_list)) {} + std::string ToString() override; + + private: + std::string op_type_; + std::vector input_data_list_; + std::vector output_data_list_; + [[nodiscard]] static std::string DataShapeToString(const std::vector &shape); +}; +} // namespace ascend +} // namespace device +} // namespace mindspore + +#endif // MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_PROFILING_DESC_H_ diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.cc b/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.cc new file mode 100644 index 0000000000..8f59e72613 --- /dev/null +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.cc @@ -0,0 +1,51 @@ +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "device/ascend/profiling/reporter/task_desc_reporter.h" +#include "session/anf_runtime_algorithm.h" +#include "kernel/ascend_kernel_mod.h" + +namespace mindspore { +namespace device { +namespace ascend { +void TaskDescReporter::ReportData() { + MS_LOG(INFO) << "cnode_list.size()=" << cnode_list_.size() << " task_ids_.size()=" << task_ids_.size(); + if (cnode_list_.size() != task_ids_.size()) { + MS_LOG(ERROR) << "cnode list size not equal task ids size"; + return; + } + + size_t task_index = 0; + for (const auto &node : cnode_list_) { + if (AnfAlgo::GetKernelType(node) != TBE_KERNEL) { + MS_LOG(WARNING) << "Skip non tbe kernel"; + ++task_index; + continue; + } + auto kernel_mod = AnfAlgo::GetKernelMod(node); + auto ascend_kernel_mod = dynamic_cast(kernel_mod); + MS_EXCEPTION_IF_NULL(node); + MS_EXCEPTION_IF_NULL(ascend_kernel_mod); + auto desc_ptr = std::make_shared(node->fullname_with_scope(), task_ids_[task_index++], + ascend_kernel_mod->block_dim(), ascend_kernel_mod->stream_id()); + prof_desc_.emplace_back(desc_ptr); + } + DescReporter::ReportData(); +} +} // namespace ascend +} // namespace device +} // namespace mindspore diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h b/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h new file mode 100644 index 0000000000..7fed990840 --- /dev/null +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h @@ -0,0 +1,41 @@ +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_TASK_DESC_REPORTER_H_ +#define MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_TASK_DESC_REPORTER_H_ + +#include +#include +#include +#include "device/ascend/profiling/reporter/desc_reporter.h" + +namespace mindspore { +namespace device { +namespace ascend { +class TaskDescReporter : public DescReporter { + public: + TaskDescReporter(int device_id, const std::string &file_name, std::vector cnode_list) + : DescReporter(device_id, file_name, std::move(cnode_list)) {} + void ReportData() override; + void set_task_ids(const std::vector &task_ids) { task_ids_ = task_ids; } + + private: + std::vector task_ids_; +}; +} // namespace ascend +} // namespace device +} // namespace mindspore +#endif // MINDSPORE_MINDSPORE_CCSRC_DEVICE_ASCEND_PROFILING_REPORTER_TASK_DESC_REPORTER_H_ diff --git a/mindspore/ccsrc/device/ascend/tasksink/task_generator.cc b/mindspore/ccsrc/device/ascend/tasksink/task_generator.cc index bdcc178b54..9e50480087 100644 --- a/mindspore/ccsrc/device/ascend/tasksink/task_generator.cc +++ b/mindspore/ccsrc/device/ascend/tasksink/task_generator.cc @@ -83,7 +83,6 @@ void TaskGenerator::LaunchAddrCleanKernel(const CNodePtr &anf_node_ptr, AddressP bool TaskGenerator::LaunchKernel(const CNodePtr &anf_node_ptr, uint32_t stream_id, std::vector *task_info_list) { - MS_LOG(INFO) << "LaunchKernel start..."; MS_EXCEPTION_IF_NULL(task_info_list); MS_EXCEPTION_IF_NULL(anf_node_ptr); AddressPtrList kernel_inputs; @@ -132,6 +131,7 @@ bool TaskGenerator::LaunchKernel(const CNodePtr &anf_node_ptr, uint32_t stream_i bool TaskGenerator::LaunchAllKernel(const std::vector &anf_node_list, std::vector *task_info_list, uint32_t graph_id) { uint32_t current_op_index = 0; + std::vector profiling_cnode_list; std::vector kernel_name_list; for (const auto &anf_node_ptr : anf_node_list) { size_t old_size = task_info_list->size(); @@ -143,11 +143,16 @@ bool TaskGenerator::LaunchAllKernel(const std::vector &anf_node_list, return false; } for (size_t i = old_size; i < task_info_list->size(); ++i) { + profiling_cnode_list.emplace_back(anf_node_ptr); kernel_name_list.emplace_back(anf_node_ptr->fullname_with_scope()); } current_op_index++; } + ProfilingUtils::SetGraphKernelName(graph_id, kernel_name_list); + if (ProfilingManager::GetInstance().IsProfiling()) { + ProfilingUtils::SetGraphProfilingCNode(graph_id, profiling_cnode_list); + } return true; } } // namespace tasksink diff --git a/mindspore/ccsrc/kernel/aicpu/aicpu_kernel_mod.cc b/mindspore/ccsrc/kernel/aicpu/aicpu_kernel_mod.cc index d18e0fbe6f..5e07cd0ad7 100644 --- a/mindspore/ccsrc/kernel/aicpu/aicpu_kernel_mod.cc +++ b/mindspore/ccsrc/kernel/aicpu/aicpu_kernel_mod.cc @@ -127,10 +127,12 @@ bool AicpuOpKernelMod::Launch(const std::vector &inputs, const std:: return true; } -vector AicpuOpKernelMod::GenTask(const std::vector &inputs, const std::vector &, - const std::vector &outputs, uint32_t stream_id) { +std::vector AicpuOpKernelMod::GenTask(const std::vector &inputs, + const std::vector &, + const std::vector &outputs, uint32_t stream_id) { MS_LOG(INFO) << "AicpuOpKernelMod GenTask start"; + stream_id_ = stream_id; node_so_ = AICPU_OPS_SO_NAME; std::vector input_data_addrs; (void)std::transform(std::begin(inputs), std::end(inputs), std::back_inserter(input_data_addrs), diff --git a/mindspore/ccsrc/kernel/aicpu/aicpu_kernel_mod.h b/mindspore/ccsrc/kernel/aicpu/aicpu_kernel_mod.h index dde2afe34a..f7469c5e72 100644 --- a/mindspore/ccsrc/kernel/aicpu/aicpu_kernel_mod.h +++ b/mindspore/ccsrc/kernel/aicpu/aicpu_kernel_mod.h @@ -29,8 +29,8 @@ class AicpuOpKernelMod : public AscendKernelMod { bool Launch(const std::vector &inputs, const std::vector &workspace, const std::vector &outputs, uintptr_t stream_ptr) override; - vector GenTask(const std::vector &inputs, const std::vector &workspace, - const std::vector &outputs, uint32_t stream_id) override; + std::vector GenTask(const std::vector &inputs, const std::vector &workspace, + const std::vector &outputs, uint32_t stream_id) override; void SetInputList(const std::vector &inputList); void SetOutputList(const std::vector &outputList); diff --git a/mindspore/ccsrc/kernel/ascend_kernel_mod.h b/mindspore/ccsrc/kernel/ascend_kernel_mod.h index ff8595c1a2..0aee881f7d 100644 --- a/mindspore/ccsrc/kernel/ascend_kernel_mod.h +++ b/mindspore/ccsrc/kernel/ascend_kernel_mod.h @@ -29,6 +29,12 @@ class AscendKernelMod : public KernelMod { public: virtual std::vector GenTask(const std::vector &, const std::vector &, const std::vector &, uint32_t) = 0; + uint32_t block_dim() { return block_dim_; } + uint32_t stream_id() { return stream_id_; } + + protected: + uint32_t block_dim_{1}; + uint32_t stream_id_{0}; }; } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/kernel/hccl/hccl_kernel.cc b/mindspore/ccsrc/kernel/hccl/hccl_kernel.cc old mode 100755 new mode 100644 index 0c6d45f008..5421b301a1 --- a/mindspore/ccsrc/kernel/hccl/hccl_kernel.cc +++ b/mindspore/ccsrc/kernel/hccl/hccl_kernel.cc @@ -124,11 +124,13 @@ const std::vector &HcclKernel::GetOutputSizeList() const { const std::vector &HcclKernel::GetWorkspaceSizeList() const { return workspace_size_list_; } -vector HcclKernel::GenTask(const std::vector &inputs, const std::vector &workspace, - const std::vector &outputs, uint32_t stream_id) { +std::vector HcclKernel::GenTask(const std::vector &inputs, + const std::vector &workspace, + const std::vector &outputs, uint32_t stream_id) { if (inputs.empty() || outputs.empty()) { MS_LOG(EXCEPTION) << "inputs or outputs is empty"; } + stream_id_ = stream_id; std::string hccl_type = AnfAlgo::GetCNodeName(anf_node_); MS_EXCEPTION_IF_NULL(inputs.at(0)); auto input_data_addr = inputs.at(0)->addr; diff --git a/mindspore/ccsrc/kernel/hccl/hccl_kernel.h b/mindspore/ccsrc/kernel/hccl/hccl_kernel.h index 24e1feec0a..b6c1fcfff2 100644 --- a/mindspore/ccsrc/kernel/hccl/hccl_kernel.h +++ b/mindspore/ccsrc/kernel/hccl/hccl_kernel.h @@ -38,8 +38,8 @@ class HcclKernel : public AscendKernelMod { const std::vector &GetInputSizeList() const override; const std::vector &GetOutputSizeList() const override; const std::vector &GetWorkspaceSizeList() const override; - vector GenTask(const std::vector &inputs, const std::vector &workspace, - const std::vector &outputs, uint32_t stream_id) override; + std::vector GenTask(const std::vector &inputs, const std::vector &workspace, + const std::vector &outputs, uint32_t stream_id) override; protected: std::vector> hccl_kernel_input_shape_list_; diff --git a/mindspore/ccsrc/kernel/mng/assign.cc b/mindspore/ccsrc/kernel/mng/assign.cc index 15ffd6ee94..fca93b881e 100644 --- a/mindspore/ccsrc/kernel/mng/assign.cc +++ b/mindspore/ccsrc/kernel/mng/assign.cc @@ -52,13 +52,13 @@ bool AssignKernel::Launch(const std::vector &inputs, const std::vect return true; } -std::vector AssignKernel::GenTask(const vector &inputs, - const vector &workspace, - const vector &outputs, - uint32_t stream_id) { +std::vector AssignKernel::GenTask(const std::vector &inputs, + const std::vector &workspace, + const std::vector &outputs, uint32_t stream_id) { if (inputs.size() != 2) { MS_LOG(EXCEPTION) << "inputs size is not two"; } + stream_id_ = stream_id; std::shared_ptr task_info_ptr = std::make_shared( stream_id, inputs[0]->addr, inputs[0]->size, inputs[1]->addr, inputs[1]->size, RT_MEMCPY_DEVICE_TO_DEVICE); diff --git a/mindspore/ccsrc/kernel/mng/memcpy_async.cc b/mindspore/ccsrc/kernel/mng/memcpy_async.cc index 9ccbc424e7..559982b1b9 100644 --- a/mindspore/ccsrc/kernel/mng/memcpy_async.cc +++ b/mindspore/ccsrc/kernel/mng/memcpy_async.cc @@ -93,10 +93,9 @@ void MemCpyAsyncKernel::GetInputOutputTotalCount(const AnfNodePtr &anf_node) { output_size_list_.emplace_back(total_size); } -std::vector MemCpyAsyncKernel::GenTask(const vector &inputs, - const vector & /*workspace*/, - const vector &outputs, - uint32_t stream_id) { +std::vector MemCpyAsyncKernel::GenTask(const std::vector &inputs, + const std::vector &, + const std::vector &outputs, uint32_t stream_id) { if (inputs.size() != 1) { MS_LOG(EXCEPTION) << "MemCpyAsync op inputs is not one"; } @@ -105,6 +104,7 @@ std::vector MemCpyAsyncKernel::GenTask(const vector task_info_ptr = std::make_shared( stream_id, outputs[0]->addr, outputs[0]->size, inputs[0]->addr, inputs[0]->size, RT_MEMCPY_DEVICE_TO_DEVICE); MS_EXCEPTION_IF_NULL(task_info_ptr); diff --git a/mindspore/ccsrc/kernel/mng/memcpy_async.h b/mindspore/ccsrc/kernel/mng/memcpy_async.h old mode 100755 new mode 100644 diff --git a/mindspore/ccsrc/kernel/mng/profiling_kernel_mod.cc b/mindspore/ccsrc/kernel/mng/profiling_kernel_mod.cc index 38b42989d2..5c24c37d52 100644 --- a/mindspore/ccsrc/kernel/mng/profiling_kernel_mod.cc +++ b/mindspore/ccsrc/kernel/mng/profiling_kernel_mod.cc @@ -62,6 +62,7 @@ std::vector ProfilingKernelMod::GenTask(const std::vector &outputs, uint32_t stream_id) { MS_LOG(INFO) << "gen task inputs size:" << inputs.size() << ", workspace size:" << workspace.size() << ", outputs size:" << outputs.size(); + stream_id_ = stream_id; std::shared_ptr task_info_ptr = std::make_shared(stream_id, log_id_, notify_, flags_); return {task_info_ptr}; diff --git a/mindspore/ccsrc/kernel/mng/recv.cc b/mindspore/ccsrc/kernel/mng/recv.cc index bbf0308924..34e4d28fcb 100644 --- a/mindspore/ccsrc/kernel/mng/recv.cc +++ b/mindspore/ccsrc/kernel/mng/recv.cc @@ -57,6 +57,7 @@ bool RecvKernel::Launch(const std::vector &inputs, const std::vector std::vector RecvKernel::GenTask(const std::vector &, const std::vector &, const std::vector &, uint32_t stream_id) { MS_LOG(INFO) << "RecvKernel GenTask event_id_:" << event_id_ << ", stream_id_:" << stream_id; + stream_id_ = stream_id; EventWaitTaskInfoPtr task_info_ptr = std::make_shared(stream_id, event_id_); MS_EXCEPTION_IF_NULL(task_info_ptr); return {task_info_ptr}; diff --git a/mindspore/ccsrc/kernel/mng/send.cc b/mindspore/ccsrc/kernel/mng/send.cc index c63440ccc4..c917ea5708 100644 --- a/mindspore/ccsrc/kernel/mng/send.cc +++ b/mindspore/ccsrc/kernel/mng/send.cc @@ -54,6 +54,7 @@ bool SendKernel::Launch(const std::vector &inputs, const std::vector std::vector SendKernel::GenTask(const std::vector &, const std::vector &, const std::vector &, uint32_t stream_id) { MS_LOG(INFO) << "SendKernel GenTask event id:" << event_id_ << ", stream id:" << stream_id; + stream_id_ = stream_id; EventRecordTaskInfoPtr task_info_ptr = std::make_shared(stream_id, event_id_); MS_EXCEPTION_IF_NULL(task_info_ptr); return {task_info_ptr}; diff --git a/mindspore/ccsrc/kernel/mng/send.h b/mindspore/ccsrc/kernel/mng/send.h index 43e27049aa..abc96cba72 100644 --- a/mindspore/ccsrc/kernel/mng/send.h +++ b/mindspore/ccsrc/kernel/mng/send.h @@ -30,8 +30,8 @@ class SendKernel : public RtKernel { bool Init(const AnfNodePtr &anf_node) override; bool Launch(const std::vector &inputs, const std::vector &workspace, const std::vector &outputs, uintptr_t stream_ptr) override; - vector GenTask(const std::vector &inputs, const std::vector &workspace, - const std::vector &outputs, uint32_t stream_id) override; + std::vector GenTask(const std::vector &inputs, const std::vector &workspace, + const std::vector &outputs, uint32_t stream_id) override; private: uint32_t event_id_; diff --git a/mindspore/ccsrc/kernel/mng/stream_active.cc b/mindspore/ccsrc/kernel/mng/stream_active.cc index b0caa689ac..51c960172a 100644 --- a/mindspore/ccsrc/kernel/mng/stream_active.cc +++ b/mindspore/ccsrc/kernel/mng/stream_active.cc @@ -67,6 +67,7 @@ std::vector StreamActiveKernel::GenTask(const std::vector &, uint32_t stream_id) { MS_LOG(INFO) << "StreamActiveKernel GenTask active stream size:" << active_streams_index_.size() << ", stream id:" << stream_id; + stream_id_ = stream_id; std::vector task_info_list; for (auto &index : active_streams_index_) { std::shared_ptr task_info_ptr = std::make_shared(stream_id, index); diff --git a/mindspore/ccsrc/kernel/mng/stream_active.h b/mindspore/ccsrc/kernel/mng/stream_active.h index 51aeff9bbf..6608134b2b 100644 --- a/mindspore/ccsrc/kernel/mng/stream_active.h +++ b/mindspore/ccsrc/kernel/mng/stream_active.h @@ -32,8 +32,8 @@ class StreamActiveKernel : public RtKernel { bool Launch(const std::vector &inputs, const std::vector &workspace, const std::vector &outputs, uintptr_t stream_ptr) override; - vector GenTask(const std::vector &inputs, const std::vector &workspace, - const std::vector &outputs, uint32_t stream_id) override; + std::vector GenTask(const std::vector &inputs, const std::vector &workspace, + const std::vector &outputs, uint32_t stream_id) override; private: std::vector active_streams_index_; diff --git a/mindspore/ccsrc/kernel/mng/stream_switch.cc b/mindspore/ccsrc/kernel/mng/stream_switch.cc index b4655020fa..b77c44cf9e 100644 --- a/mindspore/ccsrc/kernel/mng/stream_switch.cc +++ b/mindspore/ccsrc/kernel/mng/stream_switch.cc @@ -76,6 +76,7 @@ std::vector StreamSwitchKernel::GenTask(const std::vectoraddr; diff --git a/mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.cc b/mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.cc index 422a06a336..6a44ea2cc1 100644 --- a/mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.cc +++ b/mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.cc @@ -66,9 +66,9 @@ bool TbeKernelMod::Launch(const std::vector &inpu return true; } -vector TbeKernelMod::GenTask(const std::vector &inputs, - const std::vector &workspaces, - const std::vector &outputs, uint32_t stream_id) { +std::vector TbeKernelMod::GenTask(const std::vector &inputs, + const std::vector &workspaces, + const std::vector &outputs, uint32_t stream_id) { if (kernel_pack_ == nullptr) { MS_EXCEPTION(ArgumentError) << "kernel pack should not be nullptr."; } @@ -90,19 +90,19 @@ vector TbeKernelMod::GenTask(const std::vector &inputs, [](const AddressPtr &workspace) -> void * { return workspace->addr; }); } - uint32_t block_dim = 1; // default blockdim equal to 1. - auto funcstub = KernelManager::GenFuncStub(*kernel_pack_, false, &block_dim); + stream_id_ = stream_id; + auto funcstub = KernelManager::GenFuncStub(*kernel_pack_, false, &block_dim_); if (funcstub == 0) { MS_EXCEPTION(ArgumentError) << "GenFuncStub failed."; } std::string stub_func = KernelManager::GetStubFuncName(kernel_pack_); - MS_LOG(INFO) << "block_dim is:" << block_dim; + MS_LOG(INFO) << "block_dim is:" << block_dim_; TbeTaskInfoPtr task_info_ptr = - make_shared(stream_id, stub_func, block_dim, args, 0, sm_desc, nullptr, 0, meta_data, - input_data_addrs, output_data_addrs, workspace_addrs); + make_shared(stream_id, stub_func, block_dim_, args, 0, sm_desc, nullptr, 0, + meta_data, input_data_addrs, output_data_addrs, workspace_addrs); return {task_info_ptr}; } diff --git a/mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.h b/mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.h index f4fb75038e..d7af83e2c9 100644 --- a/mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.h +++ b/mindspore/ccsrc/kernel/tbe/tbe_kernel_mod.h @@ -40,8 +40,8 @@ class TbeKernelMod : public AscendKernelMod { bool Launch(const std::vector &inputs, const std::vector &workspace, const std::vector &outputs, uintptr_t stream_ptr) override; - vector GenTask(const std::vector &inputs, const std::vector &workspaces, - const std::vector &outputs, uint32_t stream_id) override; + std::vector GenTask(const std::vector &inputs, const std::vector &workspaces, + const std::vector &outputs, uint32_t stream_id) override; std::vector GenParameters() override; private: