How severe does this issue affect your experience of using Ray?
- Medium: It contributes to significant difficulty to complete my task, but I can work around it.
- I wonder if ray will set cpu affinity to actor ?
- Is ray core can ensure different actors which own cpu resources are not scheduled on same physical cpu core at same time ?
Here is my experiment code. The result of cpu count is not meet my expectations.
demo.py
import ray
import subprocess
from ray.util.placement_group import placement_group
@ray.remote
class Actor:
def exec(self):
p = subprocess.Popen("python /gpfs/public/infra/zhangrb/AlignOrch/env.py", shell=True)
return True
ray.init()
bundles = [{"GPU": 4, "CPU": 4*8}]
pg = placement_group(bundles)
actor = Actor.options(num_cpus=4*8,num_gpus=4,placement_group=pg).remote()
ref = actor.exec.remote()
ray.get(ref)
env.py
import os
import psutil
process = psutil.Process()
cpu_affinity_count = len(process.cpu_affinity())
print(f"CUDA_VISIBLE_DEVICES: {os.environ.get('CUDA_VISIBLE_DEVICES')}")
print(f"CPU Count: {cpu_affinity_count}")