opendatahub-io / notebooks

Notebook images for ODH
Apache License 2.0
16 stars 53 forks source link

Please add Graphviz so Karpathy's neural networks zero to hero tutorial will work #471

Open jeremiahbuckley opened 5 months ago

jeremiahbuckley commented 5 months ago

Why you need this feature: This youtube series ( https://www.youtube.com/playlist?list=PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ ) has 1.5M views and the author, Andrej Karpathy, is a very influential educator on AI/ML topics. There is an accompanying github account here: https://github.com/karpathy/nn-zero-to-hero/tree/master which has 10K stars.

When running the micrograd notebooks in this repo ( https://github.com/karpathy/nn-zero-to-hero/tree/master/lectures/micrograd ), they fail on the draw_dot(param) command, because that calls out to a binary outside of the jupyter notebook to render the graph. In order to really use graphviz you need to be able to run [yum install graphviz]*

I have tried including graphviz as a pip requirement. That makes most of graphviz usuable, but it doesn't make the draw_dot() functionality useable because of this outside-of-notebook functionality.

This is usying the pytorch notebook.

*It is impossible to use yum install graphviz in a ubi container because it is not available as part of the ubi-9-appstream-rpms, it is available as part of rhel-9-for-x86_64-appstream-rpms .

Describe the solution you'd like:

  1. Easiest, have graphviz already installed as part of a notebook image.
  2. Maybe best: at least allow graphviz to be installed, so that the end user could create a forked container like this and use it for graphviz-requiring workflows: FROM quay.io/modh/cuda-notebooks:cuda-jupyter-tensorflow-ubi9-python-3.9-2023b-20240209-0cf5af6 USER 0 RUN yum install graphviz USER 1001

2.a. Maybe all that is needed is to make graphviz available as part of the ubi-9-appstream-rpms repository.

Anything else you would like to add:

jeremiahbuckley commented 5 months ago

By the way, the rest of the notebook works if draw_dot() is commented out. So, this is a last-piece-of-the-puzzle type change.