You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "caiwanli (via GitHub)" <gi...@apache.org> on 2023/11/16 06:55:08 UTC

[I] How to implement numa-aware memory management? [arrow]

caiwanli opened a new issue, #38743:
URL: https://github.com/apache/arrow/issues/38743

   ### Describe the enhancement requested
   
   I'm using arrow::Array in my project to store my data, but I want to be able to specify which numa node the memory used by the Array comes from.I looked at the MemoryPool's interface and it couldn't meet my needs. Because you need to specify the numa node when actually allocating memory,but none of the default MemoryPool interfaces provide this parameter (for example, I need to allocate memory on numa-1, so I must pass in the node id).So, is there any way I can achieve my needs?
   
   ### Component(s)
   
   C++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] How to implement numa-aware memory management? [arrow]

Posted by "caiwanli (via GitHub)" <gi...@apache.org>.
caiwanli commented on issue #38743:
URL: https://github.com/apache/arrow/issues/38743#issuecomment-1822890450

   I'm using jemalloc, but it doesn't support NUMA-aware memory allocation either. None of your suggestions seem to suit my needs, but I have come up with a better solution. My solution is this: If I need to use arrow objects on memory on numa-1, I use a thread bound to a CPU on numa-1 and force that thread to use the allocation of bound memory. This way, my object will be on the actual numa node without having to modify any memory-management related code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] How to implement numa-aware memory management? [arrow]

Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on issue #38743:
URL: https://github.com/apache/arrow/issues/38743#issuecomment-1814785368

   NUMA nodes are all on the CPU, so the `Device` interface may not make much sense for this (even if your memory is on a different node, it's still readable by the current CPU).
   
   I would simply recommend several `MemoryPool`s as you suggested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] How to implement numa-aware memory management? [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on issue #38743:
URL: https://github.com/apache/arrow/issues/38743#issuecomment-3921965976

   This issue has been marked as stale because it has had no activity in the past 2 years. Please remove the stale label or comment below, or this issue will be closed in 14 days.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] How to implement numa-aware memory management? [arrow]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #38743:
URL: https://github.com/apache/arrow/issues/38743#issuecomment-1814726820

   I think the current route to doing something like this would be to have separate memory pool objects for each numa node. Then you would control which node to allocate on by deciding which of those memory pool objects to pass in / call allocate on. 
   
   We have the `Device` interface which has an `id` member, and could manage what memory pool to utilize. That would be my suggestion at least as to how to handle this situation. 
   
   @pitrou @bkietz @kou any of you have any better suggestions?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] How to implement numa-aware memory management? [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic closed issue #38743: How to implement numa-aware memory management?
URL: https://github.com/apache/arrow/issues/38743


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] How to implement numa-aware memory management? [arrow]

Posted by "bkietz (via GitHub)" <gi...@apache.org>.
bkietz commented on issue #38743:
URL: https://github.com/apache/arrow/issues/38743#issuecomment-1816885410

   What allocator are you using? Depending on build configuration, jemalloc can be used by the default arrow memory pool and that allocator can be configured with http://jemalloc.net/jemalloc.3.html#opt.percpu_arena IIUC using "phycpu" there will provision an independent arena for each physical node, and calls to `malloc` will automatically interact with the arena of the node which executes the call. Would that address your use case?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org