Browse Source

fix ps cache error print

tags/v1.1.0
limingqi107 5 years ago
parent
commit
5227d6d16d
2 changed files with 5 additions and 1 deletions
  1. +2
    -0
      mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc
  2. +3
    -1
      mindspore/ccsrc/runtime/device/kernel_runtime_manager.cc

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

@@ -856,6 +856,7 @@ void PsCacheManager::SyncEmbeddingTable() {


bool PsCacheManager::SyncHostEmbeddingTable() { bool PsCacheManager::SyncHostEmbeddingTable() {
MS_ERROR_IF_NULL(embedding_host_cache_); MS_ERROR_IF_NULL(embedding_host_cache_);
MS_ERROR_IF_NULL(embedding_host_cache_->host_hash_map_);
const auto &hash_id_to_index = embedding_host_cache_->host_hash_map_->hash_id_to_index(); const auto &hash_id_to_index = embedding_host_cache_->host_hash_map_->hash_id_to_index();
size_t swap_indices_lens = hash_id_to_index.size(); size_t swap_indices_lens = hash_id_to_index.size();
if (swap_indices_lens == 0) { if (swap_indices_lens == 0) {
@@ -899,6 +900,7 @@ bool PsCacheManager::SyncHostEmbeddingTable() {
bool PsCacheManager::SyncDeviceEmbeddingTable() { bool PsCacheManager::SyncDeviceEmbeddingTable() {
MS_ERROR_IF_NULL(embedding_device_cache_); MS_ERROR_IF_NULL(embedding_device_cache_);
const auto &device_hash_map = embedding_device_cache_->device_hash_map_; const auto &device_hash_map = embedding_device_cache_->device_hash_map_;
MS_ERROR_IF_NULL(device_hash_map);
const auto &hash_id_to_index = device_hash_map->hash_id_to_index(); const auto &hash_id_to_index = device_hash_map->hash_id_to_index();
size_t swap_indices_lens = hash_id_to_index.size(); size_t swap_indices_lens = hash_id_to_index.size();
if (swap_indices_lens == 0) { if (swap_indices_lens == 0) {


+ 3
- 1
mindspore/ccsrc/runtime/device/kernel_runtime_manager.cc View File

@@ -24,7 +24,9 @@ namespace mindspore {
namespace device { namespace device {
void KernelRuntimeManager::ClearRuntimeResource() { void KernelRuntimeManager::ClearRuntimeResource() {
#if (ENABLE_CPU && (ENABLE_D || ENABLE_GPU)) #if (ENABLE_CPU && (ENABLE_D || ENABLE_GPU))
ps::ps_cache_instance.SyncEmbeddingTable();
if (ps::PsDataPrefetch::GetInstance().cache_enable()) {
ps::ps_cache_instance.SyncEmbeddingTable();
}
#endif #endif
std::lock_guard<std::mutex> guard(lock_); std::lock_guard<std::mutex> guard(lock_);
for (auto &iter : runtime_map_) { for (auto &iter : runtime_map_) {


Loading…
Cancel
Save