skypilot-org / skypilot

SkyPilot: Run AI and batch jobs on any infra (Kubernetes or 12+ clouds). Get unified execution, cost savings, and high GPU availability via a simple interface.
https://skypilot.readthedocs.io
Apache License 2.0
6.82k stars 513 forks source link

[DAG] Add DAG Visualization with Jupyter Support #4279

Closed andylizf closed 2 weeks ago

andylizf commented 2 weeks ago

Resolve #4277.

Adds a plot method to the Dag class to visualize task dependencies. Automatically displays inline in Jupyter or saves to a file in other environments.

Example:

from sky import Dag, Task

with Dag() as dag:
    task_a = Task(name="A")
    task_b = Task(name="B")
    task_c = Task(name="C")
    task_a >> task_b >> task_c

dag.plot()

Notes:

Tested (run the relevant ones):

andylizf commented 2 weeks ago

@cblmemo PTAL, thanks!

andylizf commented 2 weeks ago

Hi @cblmemo, could you handle the merge for me?