-
-
Notifications
You must be signed in to change notification settings - Fork 103
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 for wasm32-unknown-unknown
#75
Comments
|
Thanks @decahedron1! |
That's great! Stupid question, but would this also work for |
Unfortunately no, because ONNX Runtime is built with Emscripten and thus relies on a lot of Emscripten symbols. |
Is there any guide or examples for using |
I was actually in the middle of writing some docs about this very issue 😂 From what I can tell, compiling to |
Seeing how requested WASM support is, I'll keep working on solutions. It may be possible to shim the needed Emscripten APIs but that's a lot of work and I can't guarantee it'll be successful. |
wasm32-unknown-unknown
This comment was marked as outdated.
This comment was marked as outdated.
Please give it a try: [dependencies]
ort = { git = "https://github.com/pykeio/ort.git", branch = "wasm32-unknown-unknown" } A few notes:
|
Thank you SO much! I'll give it a go and let you know :) |
After compiling with Upon inspecting with To reproduce, code is available here. Please refer to References
|
This indicates the ONNX Runtime library wasn't being linked against, which I was unable to reproduce. Did you have any alternative linking configuration set for I got things compiling here, though I ran into an |
Thank you for the PRs :) In short, I'm not sure. It would be advantageous to use static linking (i.e., keep everything as default) ... right? I noticed that your example actually specifies The |
Static linking is the only supported route for WASM (are you looking at the right example?) If you enabled |
I am looking at this example, and I haven't used I see — I will try again in a different machine! |
Was able to reproduce the same error ( |
Checked that the same error occurs with a small app using the example package provided in More Info:
Questions
|
Couldn't repro on Ubuntu 22.04, I think there's a problem with your environment somehow. Could you try:
|
@k2m5t2 Got a repro, the issue is rustc stable. It compiles fine with nightly, still trying to figure out what commit fixed it. |
Thanks for looking into it! Switching to rustc nightly fixed it! Thank you! Fyi (in response to the previous comment):
Verbose Build Logs
|
You should be compiling with |
Hi Build and load of wasm module in the browser is successful. But when inferencing the model, I face following error:
I'm using an |
What
ONNXRuntime
supportswasm
targets via it'sonnxruntime for web
bindings.According to this page you can build a
static lib of onnxruntime for wasm targets
which you can then bundle with yourC++
WebAssembly. project.From what I understand, the
wasm
lib provides the sameC API
that regular onnxruntime provide.Why
Supporting
wasm
targets will make it easy to deploy models built withort
to web browsers andwasm
runtimes such as WasmTime and Wasmer.Since wasm-runtimes are cross-platform, users can bundle their models along with pre and post processing code in a single, universal, executable module that they can then run on browsers or on any wasm-runtime.
The text was updated successfully, but these errors were encountered: