For the security, it is not allowed to add “–ipc=host” in our company.
So if I can change the path of shm from /torch_XXX to /cahe in pytorch without source code?
The path is fixed in the source as follows:
#ifndef THC_GENERIC_FILE
// TODO: move this somewhere - we only need one version
static std::string THPStorage_(_newHandle)() {
static std::random_device rd;
std::string handle = "/torch";
#ifdef MSC_VER
handle += std::to_string(GetCurrentProcessId());
#else
handle += std::to_string(getpid());
#endif
handle += "";
handle += std::to_string(rd());
return handle;
}