Is WebAssembly & WebGPU the new lazy deployment pipeline?
Image by author

Is WebAssembly & WebGPU the new lazy deployment pipeline?


Are you tired of?using server-based architectures, or compilers to generate machine-native code just to utilize specific hardware?… are you tired of setting up API KEYS, or downloading?dev packages?

Do you want to just run ML models in your browser and get rid of all this fuss?… then keep on reading!

How about running a ML model?in your browser?… that means running the model on your iPhone, iPad or any Android device. Wouldn’t this be cool?

At the end of the day what it really matters is how all this AI power will reach end devices .

Let me introduce you WebAssembly [1] or otherwise known as WASM!…?a groundbreaking code format for modern web browsers. With its low-level assembly-like language and compact binary format, WebAssembly empowers languages like C/C++, C#, Python, and Rust to seamlessly run on the web while delivering near-native performance. Using WASM you can?

?? Unleash Speed: Experience blazing-fast performance with WebAssembly. Compared to Java, Python, or JavaScript runtimes, WebAssembly can achieve speeds that are 10x to 100x faster, revolutionizing web application performance. (How is this possible?)

?? Embrace Safety: WebAssembly establishes a secure sandbox environment with a capability-based security model. It not only surpasses the safety of native binaries but also outperforms OS-level containers like Podman/Docker. Enjoy system access and leverage cutting-edge hardware features with peace of mind.

?? Foster Portability: Write WebAssembly apps in popular languages like C, C++, Python Rust, and Go, and watch them effortlessly run on different operating systems and hardware platforms. Seamlessly deploy your applications across diverse environments.

It is backed-up with a strong community where you can find help and more recourse (https://github.com/mbasso/awesome-wasm) and several runtimes to select: e.g. Washer?https://github.com/wasmerio/wasmer and?

and WasmEdge ( https://github.com/WasmEdge/WasmEdge, https://wasmedge.org/docs/develop/rust/ai_inference/pytorch/)


Revolutionize web performance?? and unlock new possibilities?by building your model by firing up your favorite library (e.g., PyTorch, TensorFlow etc) and then compiling your model to WASM. Presto!…. You now have?back an executable file that can be used with JavaScript.?

Quick recipe:

1. Get a?pre-trained?model

2. Export model to?ONNX format

3. Convert ONNX format?to Web Assembly [3]

4. Get the REST endpoint and

5 Deploy!


OK, WebAssembly is not that new technology… but say hello to the game-changer: WebGPU API!?(https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API)?

This revolutionary technology empowers web developers to harness the full potential of the system's GPU (Graphics Processing Unit) for high-performance computations and stunningly complex image rendering, all within the browser. Google too believes so (https://developer.chrome.com/blog/webgpu-io2023/, https://developer.chrome.com/blog/webgpu-release/). Utilizing WebGPU you can?


?? Unleash Power: With WebGPU, experience a whole new level of compatibility with modern GPUs. Say goodbye to limitations and embrace the full potential of your hardware for jaw-dropping graphics and lightning-fast operations.

?? Empower Creativity: WebGPU goes beyond traditional graphics rendering. It opens the doors to general-purpose GPU computations, allowing developers to tap into the immense parallel processing capabilities of GPUs for a wide range of applications.

?? Accelerate Performance: Say goodbye to sluggishness and welcome speed! WebGPU paves the way for faster operations, enabling seamless real-time rendering of intricate visuals. Brace yourself for a truly immersive web experience.

?? Embrace Advanced Features: Gain access to a treasure trove of advanced GPU features. WebGPU lets you leverage cutting-edge capabilities, empowering you to create mind-blowing visual effects and push the boundaries of web graphics.


Join the revolution! Embrace the power of WebGPU,?and unlock limitless possibilities for high-performance computing and breathtaking graphics. Let's redefine what's possible on the web! ?????

#WebGPU #WASM #AI #MachineLearning

[1] WebAssembly. (n.d.). Retrieved 12 July 2023, from https://webassembly.org/

[2] WebAssembly | MDN. (2023, May 31). https://developer.mozilla.org/en-US/docs/WebAssembly

[3] Build for web. (n.d.). Onnxruntime. Retrieved 12 July 2023, from https://onnxruntime.ai/docs/build/web.html

[4] Jangda, A., Powers, B., Berger, E. D., & Guha, A. (2019). Not So Fast: Analyzing the Performance of {WebAssembly} vs. Native Code. 107–120. https://www.usenix.org/conference/atc19/presentation/jangda

要查看或添加评论,请登录

Nikolaos Tsinganos, PhD的更多文章

社区洞察

其他会员也浏览了