CPU Affinity for Ray Workers


I am using RLlib (based on Ray) and got forwarded to ask the question here (original thread: CPU Affinity for Workers)

I would like to bind workers to specific specific CPU HW threads. Background is that the workers run benchmarks on the CPUs and are not side-effect free in case they are assigned random HW threads (The Ryzen CPU I am using has multiple groups of HW threads, each group shares a common L3 cache that is relevant for the benchmark).

Does Ray Core support this feature? In case not, could you hint me to a good place where to implement this, please?

Many thanks!

Ray doesn’t natively support the cpu affinity. If you’d like to do this, you need to use psutil documentation — psutil 5.8.1 documentation per each task & actor