calebwin / emu

The write-once-run-anywhere GPGPU library for Rust
https://calebwin.github.io/emu
MIT License
1.59k stars 53 forks source link

Questions regarding the project #41

Open Joe23232 opened 4 years ago

Joe23232 commented 4 years ago

I am interested in using emu but I have a few questions regarding this project:

What does it mean by being privacy-focused compute?

calebwin commented 4 years ago

What does it mean by being privacy-focused compute?

Since Emu has wider cross-platform support than OpenCL and CUDA, it's particularly well-suited for expensive on-device computation. The idea here is that instead of off-loading expensive compute to a server, doing it on the user's device reduces latency and better respects user's privacy. This is especially useful in ML (where Apple, Google, and others actively work on on-device machine learning specifically for privacy) but even for stuff like GIS/mapping, data processing, recommendation systems, etc.

What does it mean by being privacy-focused compute?

WebGPU is a bit of a misnomer. Emu is built on top of wgpu-rs which is a native implementation of WebGPU (a standard being developed by Google, Apple, Mozilla) with backends including Vulkan, Metal, DX. So yes, Emu can run as software without a browser. But it is already possible - but not yet released as stable - to compile WebGPU to WebAssembly and run GPU code in the browser with no API changes. When this is released, Emu will also be able to compile to WebAssembly and run on a web browser with no API changes.

Is this project stable or Beta?

For the most part stable. Emu is a transparent abstraction over WebGPU, meaning that you can always remove the abstraction and work directly with WebGPU at no cost. This switching between Emu and the underlying WebGPU is not something you will likely do often and naturally isn't stable yet since internal implementation details will probably change in the near future.

When using WebGPU, does it have native performance or does it lose performance as it is WebGPU (I apologise for my lack of knowledge in this field)?

You can expect performance as close as possible to Vulkan/Metal/DX that remains cross-platform. If you don't want to write 3 different versions of your code, then this is probably the best performance you can get.

I should mention - the biggest change yet to come to Emu is a few internal optimizations (no API changes). These are mentioned here.