Normally to construct dependant tasks I do:
@ray.remote
def t1():
print('t1')
return 't1'
@ray.remote
def t2_depends_on_t1(t1_result):
res = 't2 ' + str(t1_result)
print(res)
return res
dag = t2_depends_on_t1.bind(t1.bind())
ray.get(dag.execute())
this works fine, i get t1
and then t2 t1
But what do I do if both t1
and t2_depends_on_t1
don’t return anything and don’t take in params, but I still want to enforce execution order in DAG?
I try
@ray.remote
def t1():
print('t1')
return 't1'
@ray.remote
def t2_depends_on_t1():
print('t2')
return 't2'
dag = t2_depends_on_t1.bind(t1.bind())
ray.get(dag.execute())
but I get TypeError: too many positional arguments
How do I do this?