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

[web/js] need for more methods on tensor object #17372

Open
guschmue opened this issue Aug 31, 2023 · 1 comment
Open

[web/js] need for more methods on tensor object #17372

guschmue opened this issue Aug 31, 2023 · 1 comment
Labels
platform:web issues related to ONNX Runtime web; typically submitted using template

Comments

@guschmue
Copy link
Contributor

original mentioned here: #17167

Methods that are commonly used by users are here:
https://github.com/xenova/transformers.js/blob/main/src/utils/tensor.js
and here:
https://github.com/dakenf/stable-diffusion-webgpu-minimal/blob/main/src/lib/Tensor.ts

We will take a look what can be done.

fyi @dakenf, @fs-eire, @xenova

@guschmue guschmue added the platform:web issues related to ONNX Runtime web; typically submitted using template label Aug 31, 2023
@dakenf
Copy link
Contributor

dakenf commented Sep 1, 2023

Maybe worth mentioning that i thought JS operations with tensors are slow but sampling for stable diffusion takes about 10ms with this code https://github.com/dakenf/stable-diffusion-webgpu-minimal/blob/main/src/lib/schedulers/PNDMScheduler.ts

I haven't measured time spent to download the result from GPU, pass it back to JS and then upload back, so keeping tensors on GPU might be a good idea. But not sure if it's worth the effort though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:web issues related to ONNX Runtime web; typically submitted using template
Projects
None yet
Development

No branches or pull requests

2 participants