How severe does this issue affect your experience of using Ray?
- High: It blocks me to complete my task.
Given a custom resource in ray (or even a non-custom one, such as GPU), it is useful to know which “portion” of that resource on a node has been allocated to a given task. Without it, it is impossible to determine which part of a shared (custom) resource a task (worker?) should use. For example, let us say you have 4 tasks running on a given node, each requiring CUSTOM_RESOURCE:1, and the node has CUSTOM_RESOURCE:4. Lets say there is some custom resource “canvas” with 4 “panels”, we want each task to write to one of the panels, we never want two tasks to try to write to the same one of the panels (at the same time). So, we either need some kind of (within-node) synchronization or way of checking what other task workers are doing on the node (which will be a pain in the butt). Or, we could simply get e.g. the “ID_ON_NODE” (or even just “ASSIGNED_CUSTOM_RESOURCE”), which will be one of [0, 1, 2, 3] (if there are 4 tasks).
Does anything exist? When I do ray.runtime_context().get_assigned_resources() it just tells me HOW MUCH of each resource I have been assigned (but not THE IDENTITY of the resource). What I need is something like ray.runtime_context().get_accelerator_ids(), which returns properly the ID of the GPU if you are using GPU, but it does not work for custom resources, only GPUs!
Am I missing some function that will tell me the ID of the currently executing worker (on the node), or the ID of the resource “chunk” (portion) that has been assigned to me? For example, if it was CPUs, and the node has 40 CPUs, and I am a task using 2 CPUs, I would want to know that I am currently on CPU #4 and CPU#18. CPUs are a bad example, but you get the idea. It does not even matter if those map on to any physical thing (they would just be logical/abstract resources, i.e. I may not actually be executing on those CPUs on the actual processor, similar to how when I get a 20GB chunk of memory as a resource, and I am the 5th 20GB chunk, it does not mean that I am on the RAM from 100-120GB addresses).