Browse Source

!15054 clean code

From: @hwjiaorui
Reviewed-by: @jjfeing,@zhoufeng54
Signed-off-by: @jjfeing
tags/v1.2.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
df0d5a99be
8 changed files with 8 additions and 10 deletions
  1. +1
    -1
      mindspore/ccsrc/backend/optimizer/ascend/format_type/check_consistency.cc
  2. +0
    -1
      mindspore/ccsrc/backend/optimizer/ascend/ir_fission/gather_v2_ds_fission.cc
  3. +0
    -1
      mindspore/ccsrc/debug/data_dump/e2e_dump.cc
  4. +2
    -2
      mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc
  5. +2
    -2
      mindspore/ccsrc/ps/ps_cache/ps_cache_manager.h
  6. +1
    -1
      mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.h
  7. +1
    -1
      mindspore/ccsrc/runtime/device/kernel_runtime.h
  8. +1
    -1
      mindspore/ops/op_info_register.py

+ 1
- 1
mindspore/ccsrc/backend/optimizer/ascend/format_type/check_consistency.cc View File

@@ -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()) {


+ 0
- 1
mindspore/ccsrc/backend/optimizer/ascend/ir_fission/gather_v2_ds_fission.cc View File

@@ -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;


+ 0
- 1
mindspore/ccsrc/debug/data_dump/e2e_dump.cc View File

@@ -32,7 +32,6 @@
#endif

namespace mindspore {

bool E2eDump::IsDeviceTargetGPU() {
auto context = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context);


+ 2
- 2
mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc View File

@@ -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);


+ 2
- 2
mindspore/ccsrc/ps/ps_cache/ps_cache_manager.h View File

@@ -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();


+ 1
- 1
mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.h View File

@@ -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; };


+ 1
- 1
mindspore/ccsrc/runtime/device/kernel_runtime.h View File

@@ -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);
}


+ 1
- 1
mindspore/ops/op_info_register.py View File

@@ -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


Loading…
Cancel
Save