0

The Dask graph that I'm creating has multiple outputs.

I was wondering if it's possible to visualise multiple dask outputs at the same time.

When I try using dask.visualize(graph). Where graph is a tuple or dictionary of Dask nodes. It appears to fail by producing an empty image.

For example:

import dask

@dask.delayed
def op(x, y):
    return x + y

def graph():
    a = 1
    b = 2
    c = 3
    d = 4

    f = op(a, b)
    g = op(c, d)
    h = op(a, d)

    output1 = op(f, g)
    output2 = op(g, h)

    # works
    dask.visualize(output1, filename='output1.png')
    dask.visualize(output2, filename='output2.png')

    # empty small square box
    dask.visualize((output1, output2), filename='output1and2.png')
    # only outputs the name of the keys
    dask.visualize({'output1': output1, 'output2': output2}, filename='output1and2_.png')

graph()
CMCDragonkai
  • 6,222
  • 12
  • 56
  • 98

1 Answers1

1

The dask.visualize function takes many arguments, rather than a sequence of arguments

Do this

dask.visualize(output1, output2, filename='output1and2.png')

Instead of this

dask.visualize((output1, output2), filename='output1and2.png')
MRocklin
  • 55,641
  • 23
  • 163
  • 235