I was experimenting with Ray job scheduling and had this basic doubt. Consider this simple program:
_____________________________ @ray.remote def f(x): time.sleep(5) return(x+1) x = f.remote(1) y = f.remote(2) print(ray.get(x)) print(ray.get(y)) __________________________
I thought this program will take ~5 sec, because each of x and y will be an independently running worker. In which case both x and y will be available at the end of about 5 sec
However, it takes 10 sec, implying that first x is computed and only then computing y starts.
Is this correct interpretation? Does this mean Ray doesn’t spawn different threads for workers?
Also, any good reading to get a quick overview of such topics in Ray?