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

running in web (js, wasm, webgl) #188

Open
danbri opened this issue Dec 7, 2021 · 3 comments
Open

running in web (js, wasm, webgl) #188

danbri opened this issue Dec 7, 2021 · 3 comments

Comments

@danbri
Copy link

danbri commented Dec 7, 2021

Is there any prospect of this ever being ported to run on the web platform? ie state represented on the GPU, code compiled to WASM.

@erwincoumans
Copy link
Owner

If the web has a C++17 compiler it is likely possible. Do you have any suggestions what to do with a web version?
At the moment we use the library for training, which can run in a Colab, which is on the web but using Google servers as backend (so the code is not executed in local browser runtime).

I like those web examples, using the older emscripten: http://guillaumeblanc.github.io/ozz-animation/
By the way: that multicore CPU (AMD Ryzen 12 or higher cores) is competitive with CUDA.

@danbri
Copy link
Author

danbri commented Dec 7, 2021

Thanks, Erwin! I have been looking at JS continuous time neural net (ctrnn) controllers with a view to plugging them into some cartoon world environment (I was initially thinking box2d) and doing the evolutionary computing / alife thing. So the differentiation isn't directly of interest; rather just potentially speeding up simulations by keeping params and world all on GPU.

Whether there is value in doing all this in the web environment - I think time will tell. If the number of params is small maybe moving computation server-side isn't worth the hassle. But equally one could argue that GPU is overkill for "agents" that are closer to Braitenberg Machines than to gpt-3 in scale. You once reminded me that it takes 0 neurons to ride a bike in a straight line, and that seems a good ballpark figure to start adding nodes from.

More generally, there is interest around Tensorflow-JS for accessing vectors/matrices without pulling all the data off of the GPU. Either for visualizations or for eg (if a suitable GPU backed physics environment could be found) a toy world simulation to do more vectorized computation.

tensorflow/tfjs#1607 (comment)

After learning about this aspect of tfjs I figured it was worth at least poking around to see what gpu-backed physics options might be possible from JS. Hence this question!

@danbri
Copy link
Author

danbri commented Dec 7, 2021

Apparently c++17 is viable, per emscripten-core/emscripten#5513

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