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

For v3 of transformers.js, which image models does webgpu speed up? #1

Open
legut2 opened this issue Aug 13, 2024 · 4 comments
Open

Comments

@legut2
Copy link

legut2 commented Aug 13, 2024

Great work on all this! I thought I'd just quickly ask this here. I've been playing around with a demo of xenova/swin2SR-realworld-sr-x4-64-bsrgan-psnr and am wondering if I update it to use latest version of transformers.js will it see performance improvements from the webgpu support? I plan on publishing the demo as a write-up.

I'm curious about the image models that might see improvements from webgpu. Could you tell me which ones you've published that could see speed ups?

@legut2 legut2 changed the title For v3 of transformers.js, what models does the speed improvement of webgpu work with? For v3 of transformers.js, what models does webgpu work with? Aug 13, 2024
@legut2 legut2 changed the title For v3 of transformers.js, what models does webgpu work with? For v3 of transformers.js, which image models does webgpu speed up? Aug 13, 2024
@xenova
Copy link
Collaborator

xenova commented Aug 15, 2024

Hi there 👋 Vision models are perfect candidates for WebGPU speedups, like background removal, depth estimation, image classification, and many many more.

Let me know if you get it working!

@legut2
Copy link
Author

legut2 commented Aug 16, 2024

Thank you for sharing! Currently I am using version 2 and will try out version 3 when I can. Previous version seems to take 25 seconds to upscale image on my macbook air from 2020. The project takes images and sends them as compressed images to then be upscaled on the web app side in order to save bandwidth. I'll let you know when I try v3 and how it compares when I get to it!

@legut2
Copy link
Author

legut2 commented Aug 31, 2024

Unfortunately ran into an issue of upgrading to v3 and reported it at the end of this issue: huggingface/transformers.js#911

Mostly it seems to be an issue with using webpack with v3. Seems to work fine on v2.

@legut2
Copy link
Author

legut2 commented Sep 17, 2024

Although I wasn't able to get it to run faster because of time constraints, I just published earlier today and got featured on the front page of a hardware site called hackster.io. 😁 I gave you and the contributors to transformers.js a credit at the end.
Screenshot 2024-09-17 182317

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

No branches or pull requests

2 participants