Hi all, Is there a way to get “eager” execution of...
# ask-community
a
Hi all, Is there a way to get “eager” execution of graphs? I know it's possible to execute ops by calling them outside of graph-decorated functions. What I'm looking for is a way to get op calls inside graphs to return Outputs rather than output handles. This would be handy for debugging nested graphs, especially when one calls the same ops over and over again.
s
what would be the difference to just doing a
result = <http://my_graph.to|my_graph.to>_job('test_job'_)
?
y
To debug a nested graph, you can subset the job/graph to narrow down to only execute the subgraph:
Copy code
@job
def supergraph():
    add_one(subgraph())

supergraph.execute_in_process(op_selection="subgraph")
a
Sure, that makes sense, but that only solves part of the problem. I'm specifically interested in workflows that allow one to inspect intermediate outputs. The @graph decorator executes the wrapped function upon import of that function to define the graph. When I execute it using in process executor, the wrapped function is no longer used. When running under a debugger, I'd like to be able to actually “ignore” the @op and @graph decorators, so that I work with values rather than handles. My intuition is that this can be accomplished with a “@debug/eager” decorator that skips the dag construction and just works with values. My question is, are there easier ways to inspect intermediate values? The only way I came up with is by using an io_manager that just dumps everything to disk and load it up later.