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

Uncaught (in promise) Error: no available backend found. ERR: [webgpu] TypeError: Failed to fetch dynamically imported module: #761

Closed
5 tasks
ucalyptus2 opened this issue May 13, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@ucalyptus2
Copy link

System Info

Chrome v124

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

image


backend-impl.ts:137
Uncaught (in promise) Error: no available backend found. ERR: [webgpu] TypeError: Failed to fetch dynamically imported module: http://localhost:5173/ort-wasm-simd-threaded.jsep.mjs at pt (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=61f84580:1386:13) at async e.create (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=61f84580:1906:20) at async createInferenceSession (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=61f84580:9952:10) at async constructSessions (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=61f84580:17549:21) at async Promise.all (index 0) at async Phi3ForCausalLM.from_pretrained (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=61f84580:17847:14) at async AutoModelForCausalLM.from_pretrained (http://localhost:5173/node_modules/.vite/deps/@xenova_transformers.js?v=61f84580:20680:14) at async Promise.all (index 1) at async load (http://localhost:5173/src/worker.js?worker_file&type=module:137:32)
  | pt | @ | backend-impl.ts:137 -- | -- | -- | --   | Show less



Reproduction

npm run build && npm run dev on the webgpu-chat example directory in v3 branch

@ucalyptus2 ucalyptus2 added the bug Something isn't working label May 13, 2024
@ucalyptus2
Copy link
Author

ucalyptus2 commented May 13, 2024

I can use your webgpu hf space (see below) but not the webgpu-chat example so I think Chrome and WebGPU are not enemies on my system.
image

@ucalyptus2
Copy link
Author

Does #748 solve it ? I mean do I wait for v3 PR to merge for this to work ?
cc: @xenova

@xenova
Copy link
Owner

xenova commented May 13, 2024

As already mentioned in this comment, this will only work when onnxruntime-web 1.18.0 releases.

@ucalyptus2
Copy link
Author

@xenova also is it possible to install the onnxruntime-web from https://github.com/microsoft/onnxruntime/tree/rel-1.18.0 directly instead?

@ucalyptus2
Copy link
Author

@xenova I still get the error coz https://cdn.jsdelivr.net/npm/onnxruntime-web@1.18.0-dev.20240430-204f1f59b9/dist/ort-wasm-simd-threaded.jsep.mjs doesn't exist. See screenshot below:

image

@ucalyptus2 ucalyptus2 reopened this May 18, 2024
@ucalyptus2
Copy link
Author

ucalyptus2 commented May 18, 2024

@xenova tried the same with 1.19.0-dev

https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.0-dev.20240509-69cfcba38a/dist/ort-wasm-simd-threaded.jsep.mjs does not exist

I am a noob at javascript so I don't know how these .mjs exist

@ucalyptus2
Copy link
Author

@xenova can't run this example as well:
https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js/chat
image

I don't get it. I can easily run your huggingface spaces, then why not this?
https://huggingface.co/spaces/Xenova/experimental-phi3-webgpu

@xenova
Copy link
Owner

xenova commented May 18, 2024

We recently updated the dependencies, so if you pull the latest changes from v3, delete your vite cache and try run it again, it should work.

@congphuong
Copy link

This is workaround:
env.backends.onnx.wasm.wasmPaths = "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.0-esmtest.20240513-a16cd2bd21/dist/";

@ucalyptus2
Copy link
Author

Thanks @congphuong , you are a fuckin life saver!!!!!!!

@trtm
Copy link

trtm commented May 23, 2024

@ucalyptus2 @congphuong Where did you made this changes? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants