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

Does WEBGPU Truly Enhance Inference Time Acceleration? #586

Open
kishorekaruppusamy opened this issue Feb 14, 2024 · 8 comments · May be fixed by #545
Open

Does WEBGPU Truly Enhance Inference Time Acceleration? #586

kishorekaruppusamy opened this issue Feb 14, 2024 · 8 comments · May be fixed by #545
Labels
question Further information is requested

Comments

@kishorekaruppusamy
Copy link

Question

Recently, I've been extensively utilizing transformers.js to load transformer models, and Kudos to the team for this wonderful library ...
Specifically, I've been experimenting with version 2.15.0 of transformers.js.

Despite the fact that the model runs on the web-assembly backend, I've noticed some slowness in inference. In an attempt to address this issue, I experimented with webgpu inference using the v3 branch. However, the inference time did not meet my expectations.

Is it possible for webgpu to significantly accelerate the inference time?

@kishorekaruppusamy kishorekaruppusamy added the question Further information is requested label Feb 14, 2024
@kishorekaruppusamy kishorekaruppusamy changed the title Is really WEBGPU serves better in the terms of Inference time Acceleration Does WEBGPU Truly Enhance Inference Time Acceleration? Feb 14, 2024
@kishorekaruppusamy
Copy link
Author

Used model : Xenova/Whisper-tiny.en , Xenova/all-MiniLM-L6-v2
Model_quantization : quantized_model
transformer-js version : 3.0.0-alpha.0
executionProviders : ['webgpu'];
Hardware : MacBook M1 Pro with 10-core CPU and 16-core GPU
Ram : 16GB

is there any way to accelerate the speed of inference ??

@xenova
Copy link
Owner

xenova commented Mar 12, 2024

Encoder-decoder models are still a work in progress, but the bert-based embedding models work very well! For example, I get >100x improvement with all-MiniLM-L6-v2.

image

Try it out yourself: https://huggingface.co/spaces/Xenova/webgpu-embedding-benchmark

@xenova xenova linked a pull request Mar 12, 2024 that will close this issue
18 tasks
@wujohns
Copy link

wujohns commented Mar 13, 2024

Whether nodejs can also benefit from this speedup

@felladrin
Copy link
Contributor

Whether nodejs can also benefit from this speedup

I'm not sure if Node.js can benefit from this speedup, but it is possible that Deno can.

@hans00
Copy link
Contributor

hans00 commented Mar 19, 2024

Whether nodejs can also benefit from this speedup

onnxruntime-node not support WebGPU, but it support DirectML (Windows) or CUDA (Linux) (Official prebuilt)

@wujohns
Copy link

wujohns commented Mar 19, 2024

Whether nodejs can also benefit from this speedup

onnxruntime-node not support WebGPU, but it support DirectML (Windows) or CUDA (Linux)

But there is no device setting (ex: cuda) for transformerjs

@jhpassion0621
Copy link

@xenova When can I test encoder-decoder model with WebGPU? I can't wait anymore. I am very excited to see that asap.

@talavivi03
Copy link

Just tried it out, and wow, it's a huge upgrade! When are you thinking of launching it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants