-
Notifications
You must be signed in to change notification settings - Fork 2k
Add WASM backend #1497
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
Comments
Hi, thanks for filing this issue. A WASM backend is on our roadmap for this quarter. We can use this issue for updates. |
Folks at intel have been making webml/webnn and recently made some amazing strides of hitting 31fps running coco SSD models. intel/webml-polyfill#650 (comment) They are implementing it natively mimicking the android NN API and for the changes to reach end user, they have to be merged into chromium source code. Where as WASM backend would be awesome and I hope it can hit as much performance as they are able to |
Hi folks update on this, curious to see the performance compared to tflite and tensorflow |
Thanks for the reference. We are closely following the amazing work that Intel has done, led by @huningxin. Our wasm backend will most likely not be able to reach that level of performance since we won't be able to access hardware acceleration beyond SIMD 128bit, but it will provide other benefits, such as:
We will start developing our WASM backend in the open, on GitHub, very soon. Stay tuned! |
Thanks for the update @dsmilkov . As you know, webml-polyfill currently reuses tfjs-core WebGL kernels for GPU implementation and compiles tf-lite kernels to WASM for CPU implementation. It's a great news that tfjs will have a WASM backend soon. It would simplify the webml-polyfill and benefit the webnn spec development. Highly looking forward to that. |
Hey, guys. Are there any updates on this issue? |
We just started by adding the framework (skeleton) code around it: tensorflow/tfjs-core#1863 We will be slowly ramping up on this. |
While fully understanding that this a new and still experimental backend, are you planning on publishing the alpha/beta builds to npm? |
We are still very early in the process so publishing something to npm is not useful at this time. I'll ping this issue when we have more updates. |
For out of browser WASI I just opened tensorflow/mlir#140 in the MLIR repo. |
This has been done and should be available in latest releases.Thank you. |
Great news! Which release has now Wasm support? And are there any instructions about it? Looking forward to trying it out. |
This is actually still in progress we’ll update this when we’re ready to release :) |
Hello, do you have any updates? |
Hi all, We are excited to share that we just released our first alpha release of the WASM backend. We would love to get your feedback, testing, and help as we are polishing towards a general release! Thanks! |
Closing this issue since it's a general issue tracking our WASM release. Feel free to file separate issues if you run into problems. |
Thanks @dsmilkov |
@dsmilkov Are you involved as team in https://bytecodealliance.org/? |
Thanks for finding that out. We just released |
It looks to be working so far in the sense that our application hasn't crashed or thrown errors. I will you know how it goes 👍 |
Great new congrats on alpha, Cameron, pls do share the performance improvements you notice during your experiments with wasm backend. |
@chirva-ivan which browser are you using? If you open the initialization error what does it say? |
@nsthorat using Chrome 78 |
@chirva-ivan is it possible for you to stand up a demo for us to look at? |
Are you using Parcel? Can you share a small project/build script that we can reproduce? Thanks! |
@dsmilkov Here is a codesandbox with above error: |
Make the WASM backend work in node. Also: - Enable node tests in CI - Reduce log outputs when running tests in core. - Fix #1497 (comment) (tfjs_backend_wasm.default is not a fuction) - Remove pre-install script which causes yarn of a third-party project that uses the wasm backend to spin indefinitely. FEATURE
@dsmilkov I am still getting the error in the browser, was the fix just for node? |
I just sent #2559 for review where I document how to use the WASM backend with bundlers and also added starter projects for webpack and parcel. See update readme from the PR. Note also that you have to depend on the latest alpha |
TensorFlow.js version
1.0.4
Browser version
Chrome 73
Describe the problem or feature request
Has there been any further discussion about using WASM to optimize performance? I noticed there was discussion in #36, but it was decided to wait and eventually
tfjs-node
was created.Possible Benefits of WASM
The text was updated successfully, but these errors were encountered: