-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New device type: kDLCPUShared #41
Comments
Can you elaborate what exactly CPU shared is? Is it a DRAM region? Any special support from OS? |
I think this is referring for example |
The "shared memory" referred here is a RAM region created by one process that can be accessed by other processes. It is mainly used for inter-process communication or a shared data buffer . One such scenario is on NUMA machine, we want to launch one process for each NUMA core. The processes might share some common data (in our case, a graph structure), so we put it in shared memory. OS does have special support for shared memory. The most commonly used is the POSIX shared memory APIs: |
Ping to re-active this discussion. It it's hard to add another enum type, I wonder what's the best workaround? For shared memory, I could see two concerns.
Thus, I could see two technical routes:
|
Is there any working example of /dev/shm support now? I am thinking of using dlpack to implement some high performance IPC solution for a program that need to exchange data between a C++ process and a Python process. |
Similar to
kDLCPUPinned
, CPU shared memory is allocated and managed quite differently from normal CPU memory. In DGL, we use shared memory to store large graphs so it is quite common to see operation to copy data between CPU memory and shared memory. I guess we could also use the extension type to handle that, but want to bring up this issue to see whether it is better to have a type for that in DLPack.cc @zheng-da
The text was updated successfully, but these errors were encountered: