[BugFix] replace ftok with custom_ftok in get_output/save_output ops (#6822)

* [BugFix] replace ftok with custom_ftok in get_output/save_output ops

* [Test] add unit test for custom_ftok

* [Chore] create custom_ftok.h

* [Chore] reorganize header file

* [Fix] fix cache messager msg_queue_id+rank_id conflict
This commit is contained in:
Yonghua Li
2026-03-16 14:22:18 +08:00
committed by GitHub
parent 4d39232553
commit 7c8c0a3c02
24 changed files with 126 additions and 34 deletions
@@ -17,6 +17,7 @@
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/types.h>
#include "custom_ftok.h"
#include "paddle/extension.h"
#ifndef PD_BUILD_STATIC_OP
@@ -53,7 +54,7 @@ void GetOutputTopK(const paddle::Tensor& x,
#endif
msg_queue_id = inference_msg_queue_id_from_env;
}
static key_t key = ftok("/dev/shm", msg_queue_id);
static key_t key = custom_ftok("/dev/shm", msg_queue_id);
static int msgid = msgget(key, IPC_CREAT | 0666);
#ifdef GET_OUTPUT_DEBUG