-
Notifications
You must be signed in to change notification settings - Fork 44
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
Investigate WebAssembly integration #102
Comments
I'm using victorious in the browser now, it would be awesome if I could leverage wasm integration and use BLAS in the browser! |
To what extent is it worth working on our own lower level implementations, or using existing libraries such as blas and glmw? AssemblyScript looks very useful. Maybe it would be worth me coding in TypeScript to try it. Since we already have (or soon will have) Vectorious in TypeScript, AssemblyScript looks like a good route to greater performance. I'm interested in that, as well as porting some JS code to C++ or Rust. |
Check this out. I did a quick test with the the saxpy routine in TypeScript, WASM, C (Node.js addon) and C with system linked BLAS (nblas). |
Unfortunately cost of calls wasm <-> host is pretty significant so using bench tools like |
Also pretty interesting results you could got if you slightly modify part of algorithm (and changes this for every versions as well) from: for (i = m; i < n; i += 4) {
y[i + 0] += alpha * x[i + 0];
y[i + 1] += alpha * x[i + 1];
y[i + 2] += alpha * x[i + 2];
y[i + 3] += alpha * x[i + 3];
} to for (; i < n; i += 4) {
y[i + 0] += alpha * x[i + 0];
y[i + 1] += alpha * x[i + 1];
y[i + 2] += alpha * x[i + 2];
y[i + 3] += alpha * x[i + 3];
} Results:
|
Moved to discussions. |
WebAssembly has reached Browser Preview and offers high performance typed array manipulation. It also makes it possible run C code in the browser, which might be very interesting for this project. We should investigate in which ways we can interface with WASM once it's released for general users.
The text was updated successfully, but these errors were encountered: