Skip to content

Conversation

@fangpenlin
Copy link
Contributor

I installed tinygrad with uv to try it out

uv add tinygrad

Then wrote a simple tinygrad program and run it with the VIZ web tool:

VIZ=1 NOOPT=1 uv run python hello.py

But the web UI is not working. I looked into Chrome console and noticed that the index.js cannot be found:

image

I looked at the package installed by uv at my virtualenv folder, and realized that the js files in the viz/js are not there. Checked with the setup.py file, it turns out that the js folder is missing there. This PR adds the missing path.

I just tried it with python setup.py sdist:

...
copying tinygrad/viz/assets/unpkg.com/@highlightjs/cdn-assets@11.10.0/styles/tokyo-night-dark.min.css -> tinygrad-0.1.0/tinygrad/viz/assets/unpkg.com/@highlightjs/cdn-assets@11.10.0/styles
copying tinygrad/viz/js/index.js -> tinygrad-0.1.0/tinygrad/viz/js
copying tinygrad/viz/js/worker.js -> tinygrad-0.1.0/tinygrad/viz/js
copying tinygrad.egg-info/SOURCES.txt -> tinygrad-0.1.0/tinygrad.egg-info
Writing tinygrad-0.1.0/setup.cfg
creating dist
Creating tar archive

Then run

tar -tf dist/tinygrad-0.1.0.tar.gz

And can confirm now the missing js files are included

...
tinygrad-0.1.0/tinygrad/viz/assets/unpkg.com/@highlightjs/cdn-assets@11.10.0/styles/tokyo-night-dark.min.css
tinygrad-0.1.0/tinygrad/viz/index.html
tinygrad-0.1.0/tinygrad/viz/js/
tinygrad-0.1.0/tinygrad/viz/js/index.js
tinygrad-0.1.0/tinygrad/viz/js/worker.js
tinygrad-0.1.0/tinygrad/viz/perfetto.html
...

@Qazalin Qazalin merged commit b091329 into tinygrad:master Jun 4, 2025
35 checks passed
@Qazalin
Copy link
Collaborator

Qazalin commented Jun 4, 2025

Could repro, thanks for the fix. I'll investigate while the use as external package CI did not catch this earlier.

@fangpenlin fangpenlin deleted the add-missing-viz-js-pkg-data branch June 4, 2025 08:38
@Qazalin Qazalin mentioned this pull request Jun 4, 2025
utkarshgill pushed a commit to utkarshgill/tinygrad that referenced this pull request Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants