Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tinygrad inference #3

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wpmed92
Copy link

@wpmed92 wpmed92 commented Jan 21, 2025

This PR adds support for tissue_fast brainchop inference through tinygrad's WebGPU.

  • Added net.js which contains the exported WebGPU kernels
  • Added net.safetensors which contains the weights in safetensor format
  • Replace ort inference calls with tinygrad calls

I tested with the dist build, had some issues with running the dev build.
To make it a de-factor drop-in replacement, the argmax is not included in the model, but I can move it in very easily.
Also, for now I just commented out the onnx calls, but for the final version I'd like to add a switch to change between onnx vs. tinygrad, plus some perf comparison.

Segmentation looks fine:

Screenshot 2025-01-21 at 14 30 16

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.

1 participant