| This is exciting > The WebGPU API gives developers a low level, high performance, cross architecture way to program GPU hardware from JavaScript. It is the effective successor to WebGL on the Web. The spec has been finalized and Chrome has already shipped the API. Support is underway in Firefox and Safari. Interestingly, the Deno team previously attempted[0] this and rolled it back due to instability. Once this is stable, it means that ML/AI workloads will be accessible to JS developers: > These days, most neural networks are defined in Python with the computation offloaded to GPUs. We believe JavaScript, instead of Python, could act as an ideal language for expressing mathematical ideas if the proper infrastructure existed. Providing WebGPU support out-of-the-box in Deno is a step in this direction. Our goal is to run Tensorflow.js on Deno, with GPU acceleration. We expect this to be achieved in the coming weeks or months. [0] https://deno.com/blog/v1.8#experimental-support-for-the-webg... |
Outside of "everyone uses js", why do we believe this? What makes JS "ideal".
I would think for machine learning one would want:
- generally default to non-mutating, functional representation of ideas, with convenient escape hatches
- treats the GPU as a concurrent (or better yet, distributed) resource
- can seamlessly run ML code as either immediate or an optimized graph.
- could swap out compute resources as asynchronous rpc, like, flex out to something more powerful if available and needed
Certainly most of these are possible in JS, but I would hardly call it "ideal" for these bullet points, not to mention other general concerns like a highly questionable dependency management ecosystem.