How severe does this issue affect your experience of using Ray?
- None: Just asking a question out of curiosity
- Low: It annoys or frustrates me for a moment.
- Medium: It contributes to significant difficulty to complete my task, but I can work around it.
In the paper, One Ray node may contain a driver, workers, or actors. I run a program as fellowing and check the log files.
from pickletools import read_uint1
import click
import ray
import time
import numpy as np
sleep_time = 30
cpus_per_task = 1
def test_max_running_tasks(num_tasks):
@ray.remote(num_cpus=cpus_per_task)
def task(a,b):
r=np.multiply(a,b)
time.sleep(sleep_time)
return r
refs = [task.remote(np.random.normal((1000,1000)),np.random.normal((1000,1000)) ) for _ in range(num_tasks)]
while len(refs):
done,refs=ray.wait(refs)
time.sleep(1)
x=ray.get(done)
@click.command()
@click.option("--num-tasks", required=True, type=int, help="Number of tasks to launch.")
@click.option("--num-cpus", required=True, type=int, help="Number of CPUs.")
def test(num_tasks, smoke_test,num_cpus):
ray.init(address="auto")
print(ray.available_resources())
print(num_cpus)
while not 'CPU' in ray.available_resources() or int(ray.available_resources()['CPU']) != num_cpus:
pass
start_time = time.time()
test_max_running_tasks(num_tasks)
end_time = time.time()
del monitor_actor
while not 'CPU' in ray.available_resources() or int(ray.available_resources()['CPU']) != num_cpus:
pass
rate = num_tasks / (end_time - start_time - sleep_time)
print(
f"Success! Started {num_tasks} tasks in {end_time - start_time}s. "
f"({rate} tasks/s)"
)
if __name__ == "__main__":
test()
I run this program in two nodes. The command I run in two nodes is ray start --block --num-cpus=0 --head --node-ip-address=xxxxx --port=6379
and ray start --address='xxxx:6379' --block --num-cpus=32
.
Then I check the log files. I get 37 files named starting with ‘python-core-worker’. How this happen?
I want to know when and who will start a core worker.