From c7d60ce44714d6888a5e50d29ab885fec16b995e Mon Sep 17 00:00:00 2001 From: zmxdream Date: Thu, 29 Sep 2022 14:56:24 +0800 Subject: [PATCH] [GPUPS]add afs OpenWriter (#46611) * add afs OpenWriter * update --- paddle/fluid/framework/fleet/ps_gpu_wrapper.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/framework/fleet/ps_gpu_wrapper.h b/paddle/fluid/framework/fleet/ps_gpu_wrapper.h index c48cf334757..45a406d2fe2 100644 --- a/paddle/fluid/framework/fleet/ps_gpu_wrapper.h +++ b/paddle/fluid/framework/fleet/ps_gpu_wrapper.h @@ -57,7 +57,7 @@ limitations under the License. */ #include "paddle/fluid/distributed/the_one_ps.pb.h" #endif #ifdef PADDLE_WITH_PSLIB -#include "afs_api.h" +#include "afs_api.h" // NOLINT #endif #ifdef PADDLE_WITH_PSLIB #include "downpour_accessor.h" // NOLINT @@ -504,7 +504,7 @@ class PSGPUWrapper { // set optimizer type(naive,adagrad,std_adagrad,adam,share_adam) optimizer_type_ = (config.find("optimizer_type") == config.end()) ? 1 - : int(config["optimizer_type"]); + : static_cast(config["optimizer_type"]); VLOG(0) << "InitializeGPUServer optimizer_type_:" << optimizer_type_ << " nodeid_slot:" << nodeid_slot @@ -556,7 +556,7 @@ class PSGPUWrapper { if (slot_info_initialized_) { return; } - SlotRecordDataset* dataset = (SlotRecordDataset*)(dataset_); + SlotRecordDataset* dataset = reinterpret_cast(dataset_); auto slots_vec = dataset->GetSlots(); slot_offset_vector_.clear(); for (auto& slot : slot_vector_) { @@ -620,6 +620,11 @@ class PSGPUWrapper { return afs_handler_.open_reader(filename); } + std::shared_ptr OpenWriter( + const std::string& filename) { + return afs_handler_.open_writer(filename); + } + void InitAfsApi(const std::string& fs_name, const std::string& fs_user, const std::string& pass_wd, -- GitLab