mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 08:37:06 +08:00
Sync v2.0 version of code to github repo
This commit is contained in:
@@ -23,28 +23,31 @@ bool RemoteCacheKvIpc::kv_complete_signal_shmem_opened = false;
|
||||
RemoteCacheKvIpc::save_cache_kv_complete_signal_layerwise_meta_data
|
||||
RemoteCacheKvIpc::open_shm_and_get_complete_signal_meta_data(
|
||||
const int rank_id,
|
||||
const int device_id,
|
||||
const bool keep_pd_step_flag) {
|
||||
if (RemoteCacheKvIpc::kv_complete_signal_shmem_opened){
|
||||
if (keep_pd_step_flag) {
|
||||
return RemoteCacheKvIpc::kv_complete_signal_meta_data;
|
||||
}
|
||||
int32_t current_identity = (*reinterpret_cast<int32_t*>(RemoteCacheKvIpc::kv_complete_signal_identity_ptr));
|
||||
int32_t* write_ptr = reinterpret_cast<int32_t*>(RemoteCacheKvIpc::kv_complete_signal_identity_ptr);
|
||||
*write_ptr = (current_identity + 1) % 100003;
|
||||
RemoteCacheKvIpc::kv_complete_signal_meta_data.layer_id = -1;
|
||||
int32_t* layer_complete_ptr = reinterpret_cast<int32_t*>(kv_complete_signal_meta_data.shm_ptr);
|
||||
*layer_complete_ptr = -1;
|
||||
int32_t current_identity = (*reinterpret_cast<int32_t*>(RemoteCacheKvIpc::kv_complete_signal_identity_ptr));
|
||||
int32_t* write_ptr = reinterpret_cast<int32_t*>(RemoteCacheKvIpc::kv_complete_signal_identity_ptr);
|
||||
*write_ptr = (current_identity + 1) % 100003;
|
||||
return RemoteCacheKvIpc::kv_complete_signal_meta_data;
|
||||
}
|
||||
|
||||
std::string flags_server_uuid;
|
||||
if (const char* iflags_server_uuid_env_p = std::getenv("SHM_UUID")){
|
||||
std::string iflags_server_uuid_env_str(iflags_server_uuid_env_p);
|
||||
flags_server_uuid = iflags_server_uuid_env_str;
|
||||
}
|
||||
|
||||
std::string step_shm_name = ("splitwise_complete_prefilled_step_"
|
||||
+ std::to_string(rank_id) + "_" + flags_server_uuid);
|
||||
+ std::to_string(rank_id) + "." + std::to_string(device_id));
|
||||
std::string layer_shm_name = ("splitwise_complete_prefilled_layer_"
|
||||
+ std::to_string(rank_id) + "_" + flags_server_uuid);
|
||||
+ std::to_string(rank_id) + "." + std::to_string(device_id));
|
||||
if (const char* use_ep = std::getenv("ENABLE_EP_DP")){
|
||||
if(std::strcmp(use_ep, "1") == 0){
|
||||
step_shm_name = "splitwise_complete_prefilled_step_tprank0_dprank"
|
||||
|
Reference in New Issue
Block a user