diff --git a/mindspore/ccsrc/backend/optimizer/ascend/format_type/check_consistency.cc b/mindspore/ccsrc/backend/optimizer/ascend/format_type/check_consistency.cc index 19d8572f44..d6c55fd7ca 100644 --- a/mindspore/ccsrc/backend/optimizer/ascend/format_type/check_consistency.cc +++ b/mindspore/ccsrc/backend/optimizer/ascend/format_type/check_consistency.cc @@ -39,7 +39,7 @@ bool CheckFormatForConsistency(const CNodePtr &node, const size_t input_index) { if (pre_output_format == kOpFormat_DEFAULT || selected_input_format == kOpFormat_DEFAULT) { string checking_format = (pre_output_format == kOpFormat_DEFAULT) ? selected_input_format : pre_output_format; // when input shape size is 1D, default format and NC1HWC0 are compatible - if (input_origin_shape.size() == 1 && checking_format == kOpFormat_NC1HWC0) { + if (input_origin_shape.size() == 1) { return true; } if (kDefaultCompatibleFormat.find(checking_format) != kDefaultCompatibleFormat.end()) { diff --git a/mindspore/ccsrc/backend/optimizer/ascend/ir_fission/gather_v2_ds_fission.cc b/mindspore/ccsrc/backend/optimizer/ascend/ir_fission/gather_v2_ds_fission.cc index d3415e5e3d..0d749dd5cb 100644 --- a/mindspore/ccsrc/backend/optimizer/ascend/ir_fission/gather_v2_ds_fission.cc +++ b/mindspore/ccsrc/backend/optimizer/ascend/ir_fission/gather_v2_ds_fission.cc @@ -128,7 +128,6 @@ bool CheckInputs(const CNodePtr &origin_node) { } auto param_shape = AnfAlgo::GetPrevNodeOutputInferShape(origin_node, 0); auto indice_shape = AnfAlgo::GetPrevNodeOutputInferShape(origin_node, 1); - // this optimizer only support embedding_table has dynamic shape if (param_shape.empty() || indice_shape.empty() || AnfAlgo::IsDynamicShape(origin_node->input(2))) { return false; diff --git a/mindspore/ccsrc/debug/data_dump/e2e_dump.cc b/mindspore/ccsrc/debug/data_dump/e2e_dump.cc index a98f1427fe..4789752c6f 100644 --- a/mindspore/ccsrc/debug/data_dump/e2e_dump.cc +++ b/mindspore/ccsrc/debug/data_dump/e2e_dump.cc @@ -32,7 +32,6 @@ #endif namespace mindspore { - bool E2eDump::IsDeviceTargetGPU() { auto context = MsContext::GetInstance(); MS_EXCEPTION_IF_NULL(context); diff --git a/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc b/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc index 50369de543..adc81039f2 100644 --- a/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc +++ b/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc @@ -309,7 +309,7 @@ void PsCacheManager::IncreaseGraphStep(const std::string &channel_name) { data_prase_.notify_one(); } -void PsCacheManager::DoProcessData(uint32_t device_id, void *context) { +void PsCacheManager::DoProcessData(uint32_t device_id, const void *context) { // PS embeddingLookup cache check. if (!initialized_ps_cache_) { MS_LOG(EXCEPTION) << "Only the sink_mode of dataset supports embeddingLookup cache in parameter server training " @@ -318,7 +318,7 @@ void PsCacheManager::DoProcessData(uint32_t device_id, void *context) { process_data_thread_ = std::thread(&PsCacheManager::ProcessDataTask, this, device_id, context); } -void PsCacheManager::ProcessDataTask(uint32_t device_id, void *context) { +void PsCacheManager::ProcessDataTask(uint32_t device_id, const void *context) { MS_LOG(INFO) << "PS embedding cache process data task begin."; running_ = true; embedding_device_cache_->cache_->InitDevice(device_id, context); diff --git a/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.h b/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.h index 2e620a5273..e4899e9eea 100644 --- a/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.h +++ b/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.h @@ -129,7 +129,7 @@ class PsCacheManager { bool initialized_ps_cache() const { return initialized_ps_cache_; } size_t vocab_cache_size() const { return vocab_cache_size_; } int cache_indices_lower_bound() const; - void DoProcessData(uint32_t device_id, void *context); + void DoProcessData(uint32_t device_id, const void *context); void IncreaseGraphStep(const std::string &channel_name); void SyncEmbeddingTable(); void Finalize(); @@ -148,7 +148,7 @@ class PsCacheManager { void InitDataChannel(); void AllocMemForHashTable(); void SetLocalIdRank(); - void ProcessDataTask(uint32_t device_id, void *context); + void ProcessDataTask(uint32_t device_id, const void *context); bool ProcessData(); bool ParseData(const int *batch_ids, const size_t batch_ids_len, int *hash_index); bool WaitGraphRun(); diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.h b/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.h index e544a61d39..28c9873fc8 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.h +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.h @@ -54,7 +54,7 @@ class AscendKernelRuntime : public KernelRuntime { bool MemcpyAsync(void *dst, const void *src, uint64_t size, int32_t kind) override; void SetContext() override; void CreateContext() override; - void *context() const override { return rt_context_; } + const void *context() const override { return rt_context_; } void PreInit() override; uint64_t GetAvailableMemMaxSize() const override; DeviceAddressType GetTargetDeviceAddressType() const override { return DeviceAddressType::kAscend; }; diff --git a/mindspore/ccsrc/runtime/device/kernel_runtime.h b/mindspore/ccsrc/runtime/device/kernel_runtime.h index 2a96ad5b0a..e217335f19 100644 --- a/mindspore/ccsrc/runtime/device/kernel_runtime.h +++ b/mindspore/ccsrc/runtime/device/kernel_runtime.h @@ -78,7 +78,7 @@ class KernelRuntime { virtual void ClearGlobalIdleMem() {} virtual void CreateContext() {} virtual void SetContext() {} - virtual void *context() const { return nullptr; } + virtual const void *context() const { return nullptr; } uint8_t *MallocMem(MemType type, size_t size, const DeviceAddressPtr &address) { return mem_manager_->MallocMem(type, size, address); } diff --git a/mindspore/ops/op_info_register.py b/mindspore/ops/op_info_register.py index 5c913cee1d..668104cc28 100644 --- a/mindspore/ops/op_info_register.py +++ b/mindspore/ops/op_info_register.py @@ -451,7 +451,7 @@ class TBERegOp(RegOp): Whether the operator need cal op_select_format api. Args: - is_dynamic_format (bool): Value of is_dynamic_format_. Default: false. + is_dynamic_format (bool): The format needs to be dynamically obtained. Default: false. """ self._is_bool(is_dynamic_format) self.is_dynamic_format_ = is_dynamic_format