Moody Edghaim
02/27/2023, 3:35 PM@job
def A():
job_a_graph()
@graph
def job_A_graph():
some_op()
Jobs A, B, and C, are strung together to form a fourth "mega" job, using the graph from each job (of A, B, and C). It's important that I maintain the ability to run these separately, but also through the mega job if the situation arises.
I would like these graphs to run sequentially, but job B doesn't have any dependencies, so it runs concurrently with job A.
Creating data dependencies in the 'mega' job is tricky, because it uses the graph from every other job. Graphs seem to be a lot more strict than ops (each input must map to an op and be "used", return types cannot be None), so it's quite difficult to tie these graphs together without introducing extra boilerplate.
The abstraction for creating a nothing dependency between ops/graphs leaves a bit to be desired (it's hard to read, and reason with imo - see here).
A few questions:
• is there a reason we can't utilize the None return of a graph to create a data dependency to another graph? This is possible with ops. I'm trying to understand the context as to why
• is there a 'cleaner' way to create dependencies between graphs? In my example, there would be quite a lot of extra boilerplate to:
◦ create a graph 'wrapper' around graphs which need a dependency
◦ previous graph should pass in some "unused" input to graph wrapper
◦ graph wrapper introduces a new op just to consume the unused input.sandy
02/27/2023, 7:48 PMMoody Edghaim
02/27/2023, 9:01 PM@graph
def graph_A(foo):
run, skip = should_run(foo)
find_bar(run)
skip_bar(skip)
sandy
02/28/2023, 12:10 AMPiotr Danielczyk
05/19/2023, 1:38 PMsandy
05/31/2023, 11:57 PM