diff --git a/include/infer_tensor.h b/include/infer_tensor.h index bdbf2704bd0..5c590e33613 100644 --- a/include/infer_tensor.h +++ b/include/infer_tensor.h @@ -30,7 +30,6 @@ namespace mindspore { #define MS_API __attribute__((visibility("default"))) namespace inference { - enum DataType { kMSI_Unknown = 0, kMSI_Bool = 1, @@ -209,7 +208,6 @@ class VectorInferTensorWrapRequest : public RequestBase { } const std::vector &tensor_list_; }; - } // namespace inference } // namespace mindspore #endif // MINDSPORE_INCLUDE_INFER_TENSOR_H_ diff --git a/include/inference.h b/include/inference.h index a72ec0b81ce..7af19e1736e 100644 --- a/include/inference.h +++ b/include/inference.h @@ -25,7 +25,6 @@ namespace mindspore { namespace inference { - enum StatusCode { SUCCESS = 0, FAILED, INVALID_INPUTS }; class Status { diff --git a/mindspore/ccsrc/backend/optimizer/ascend/format_type/insert_transpose_for_basiclstm_op.cc b/mindspore/ccsrc/backend/optimizer/ascend/format_type/insert_transpose_for_basiclstm_op.cc index 365bacd1fff..93f6f76dcc0 100644 --- a/mindspore/ccsrc/backend/optimizer/ascend/format_type/insert_transpose_for_basiclstm_op.cc +++ b/mindspore/ccsrc/backend/optimizer/ascend/format_type/insert_transpose_for_basiclstm_op.cc @@ -57,7 +57,6 @@ CNodePtr Insert(const FuncGraphPtr &func_graph, const CNodePtr &cnode, const std } else { new_node = kernel_graph->NewCNode(cnode); } - } else if (op_name == kBasicLSTMCellWeightGradOpName) { std::vector make_tuple_inputs = {NewValueNode(prim::kPrimMakeTuple)}; size_t out_num = AnfAlgo::GetOutputTensorNum(cnode); diff --git a/mindspore/ccsrc/backend/session/ascend_control_parser.cc b/mindspore/ccsrc/backend/session/ascend_control_parser.cc index 00fab503e21..0bd79b54b5a 100644 --- a/mindspore/ccsrc/backend/session/ascend_control_parser.cc +++ b/mindspore/ccsrc/backend/session/ascend_control_parser.cc @@ -208,7 +208,6 @@ void AscendControlParser::LinkGraph(NotNull kg) { memo.clear(); // assign label resource device::ascend::AscendLabelAssign::GetInstance().AssignLabel(kg); - // AttachChildGraphToReturnNode(kg, NOT_NULL(&memo)); } void AscendControlParser::EraseParameter(NotNull root_graph, diff --git a/mindspore/ccsrc/debug/data_dump/e2e_dump_util.cc b/mindspore/ccsrc/debug/data_dump/e2e_dump_util.cc index 4bde9dab4e9..b5512708935 100644 --- a/mindspore/ccsrc/debug/data_dump/e2e_dump_util.cc +++ b/mindspore/ccsrc/debug/data_dump/e2e_dump_util.cc @@ -68,7 +68,6 @@ void E2eDumpUtil::DumpGPUMemToFile(const std::string &file_path, const std::stri TensorLoader *tensor_loader = debug_services->tensor_loader(); auto ret = tensor_loader->DumpTensorToFile(original_kernel_name, trans_flag, file_path, format, int_shapes, type, addr->type_id(), addr->format(), slot); - if (!ret) { MS_LOG(ERROR) << "DumpTensorToFile Failed: flag:" << std::to_string(trans_flag) << ", path:" << file_path << ", host_format:" << format; diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_memory_manager.cc b/mindspore/ccsrc/runtime/device/ascend/ascend_memory_manager.cc index ac1f737954b..13e29b9f571 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_memory_manager.cc +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_memory_manager.cc @@ -29,7 +29,6 @@ void AscendMemoryManager::MallocDeviceMemory() { auto context_mem = GetDeviceMemSizeFromContext(); device_mem_size_ = context_mem == 0 ? kAscendDeviceMemSize : context_mem; auto ret = rtMalloc(reinterpret_cast(&device_mem_base_), device_mem_size_, RT_MEMORY_HBM); - if (ret != RT_ERROR_NONE) { MS_EXCEPTION(DeviceProcessError) << "rtMalloc mem size[" << device_mem_size_ << "] fail, ret[" << ret << "]"; } diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_stream_assign.cc b/mindspore/ccsrc/runtime/device/ascend/ascend_stream_assign.cc index da66d338fb9..bb47981e23b 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_stream_assign.cc +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_stream_assign.cc @@ -541,7 +541,6 @@ void AscendStreamAssign::InsertStreamActiveForCommon(const NotNull &graph MS_LOG(INFO) << "Event_id:" << AnfAlgo::GetNodeAttr(item.first, kAttrEventId); } } - } // namespace ascend } // namespace device } // namespace mindspore diff --git a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc index 89436fc7235..6afb36724ed 100644 --- a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc +++ b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc @@ -57,9 +57,6 @@ constexpr const char *kOpTypeOpDebug = "Opdebug"; namespace mindspore { namespace device { namespace ascend { -static void DumpKernelOutput(const CNodePtr &kernel, void *args, NotNull task); -static void DumpKernelInput(const CNodePtr &kernel, void *args, NotNull task); -static void RtLoadDumpData(const aicpu::dump::OpMappingInfo &dump_info, void **ptr); DataDumper::~DataDumper() { ReleaseDevMem(&dev_load_mem_); @@ -328,7 +325,7 @@ void DataDumper::OpDebugUnregister() { } } -void RtLoadDumpData(const aicpu::dump::OpMappingInfo &dump_info, void **ptr) { +void DataDumper::RtLoadDumpData(const aicpu::dump::OpMappingInfo &dump_info, void **ptr) { std::string proto_str; size_t proto_size = dump_info.ByteSizeLong(); bool ret = dump_info.SerializeToString(&proto_str); @@ -357,7 +354,7 @@ void RtLoadDumpData(const aicpu::dump::OpMappingInfo &dump_info, void **ptr) { } } -void DumpKernelOutput(const CNodePtr &kernel, void *args, NotNull task) { +void DataDumper::DumpKernelOutput(const CNodePtr &kernel, void *args, NotNull task) { if (!DumpJsonParser::GetInstance().OutputNeedDump()) { MS_LOG(INFO) << "Skip dump output"; return; @@ -391,7 +388,7 @@ void DumpKernelOutput(const CNodePtr &kernel, void *args, NotNull task) { +void DataDumper::DumpKernelInput(const CNodePtr &kernel, void *args, NotNull task) { if (!DumpJsonParser::GetInstance().InputNeedDump()) { MS_LOG(INFO) << "Skip dump input"; return; diff --git a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.h b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.h index d19c0680d6a..30baab58d55 100644 --- a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.h +++ b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.h @@ -65,6 +65,9 @@ class DataDumper { void SetOpDebugMappingInfo(const NotNull dump_info) const; void ConstructDumpTask(NotNull kernel, NotNull dump_task) const; void GetNeedDumpKernelList(NotNull *> kernel_map) const; + static void DumpKernelOutput(const CNodePtr &kernel, void *args, NotNull task); + static void DumpKernelInput(const CNodePtr &kernel, void *args, NotNull task); + static void RtLoadDumpData(const aicpu::dump::OpMappingInfo &dump_info, void **ptr); std::function model_handle_; uint32_t debug_task_id_; diff --git a/mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc b/mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc index de25f5e0d15..83457da62f1 100644 --- a/mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc +++ b/mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc @@ -541,7 +541,6 @@ KernelSelectStatus SelectKernelInfo(const CNodePtr &kernel_node, KernelType kern kernel::KernelQuery(kernel_node, &kernel_info_list, kernel_type); auto select_status = SetMatchedKernelInfo(kernel_node, kernel_info_list); // If aicore not find valid kernel info reloading aicpu kernel info list to find it - if (select_status == kNoMatched) { MS_LOG(WARNING) << "The node [" << kernel_node->DebugString() << "] cannot find valid TBE kernel info, try to get aicpu kernel info"; diff --git a/mindspore/ccsrc/runtime/device/cpu/mpi/mpi_interface.cc b/mindspore/ccsrc/runtime/device/cpu/mpi/mpi_interface.cc index 229f2c39e0b..fcc9d441d0a 100644 --- a/mindspore/ccsrc/runtime/device/cpu/mpi/mpi_interface.cc +++ b/mindspore/ccsrc/runtime/device/cpu/mpi/mpi_interface.cc @@ -33,7 +33,7 @@ inline void *GetMPIAdapterHandle() { return handle; } -inline void *GetMPIAdapterFunc(const char *name) { +void *GetMPIAdapterFunc(const char *name) { static void *handle = GetMPIAdapterHandle(); if (handle == nullptr) { MS_LOG(EXCEPTION) << "Load lib " << name << " failed, make sure you have installed it!"; diff --git a/serving/acl/dvpp_process.cc b/serving/acl/dvpp_process.cc index b1b95ac5722..f97eecaa1c0 100644 --- a/serving/acl/dvpp_process.cc +++ b/serving/acl/dvpp_process.cc @@ -28,7 +28,6 @@ DvppProcess::DvppProcess() {} DvppProcess::~DvppProcess() {} static uint32_t ToEven(uint32_t num) { return (num + 1) / 2 * 2; } - static uint32_t ToOdd(uint32_t num) { if (num == 0) { return 1; diff --git a/tests/st/pynative/test_parser_tensor_assign.py b/tests/st/pynative/test_parser_tensor_assign.py index f7e4ba62a0b..b59db8134a2 100644 --- a/tests/st/pynative/test_parser_tensor_assign.py +++ b/tests/st/pynative/test_parser_tensor_assign.py @@ -13,13 +13,13 @@ # limitations under the License. # ============================================================================ +import pytest +import numpy as np import mindspore as ms from mindspore.nn import ReLU from mindspore.nn import Cell from mindspore.common.tensor import Tensor from mindspore.ops import operations as P -import numpy as np -import pytest @pytest.mark.level0 @pytest.mark.platform_arm_ascend_training