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

Is tch-rs is can be implemented with wasm #256

Closed
amiyamandal-dev opened this issue Oct 2, 2020 · 4 comments
Closed

Is tch-rs is can be implemented with wasm #256

amiyamandal-dev opened this issue Oct 2, 2020 · 4 comments

Comments

@amiyamandal-dev
Copy link

I have an idea to implement wasm and tch-rs so the app can leverage real-time machine learning models.
But build failed cause wasm uses wasm32-unknown-unknown toolchain whereas nightly-x86_64-unknown-linux-gnu for any project for tch-rs.
It's possible to do so with this crate.

@tiberiusferreira
Copy link

tiberiusferreira commented Oct 3, 2020

This crate depends on Pytorch itself and links to it during build time, so you would need the Pytorch C++ lib itself to compile to WASM.
Also, note that Pytorch tries to use Intel's library Math Kernel Library and Nvidia libraries for performance reasons, it would not be possible to compile these libs to Webassembly since they are very hardware specific (and binary only? not sure).

@amiyamandal-dev
Copy link
Author

@tiberiusferreira thanks, seem a bit impossible collaboration. So is there any way to do the integration

@tiberiusferreira
Copy link

Hello @amiyamandal-dev sorry for the delay. Yeah, it is theoretically possible to compile tch-rs + Pytorch C++ to wasm, but it would require compiling the CPU only non-vendor specific parts. I expect something like: https://webmachinelearning.github.io/webnn/ to make it easier to run Deep Learning in the browser.

@amiyamandal-dev
Copy link
Author

webnn seem pretty neat and I guess that the future and thanks for the reply.

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

No branches or pull requests

2 participants