5 ms·
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 eff
by kiwicopple 3y ago
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-webgpu-api https://deno.com/blog/v1.8#experimental-support-for-the-webg...
- oritsnile 3y agoJust yesterday I was looking to play around with webGPU and found the 1.8 release page. I had no idea it was removed. I hope that webGPU will gain adaptation as the best cross platform system. The incompatibility between platforms for openGL or Vulkan always made me not want to learn it.
- v3ss0n 3y agoJavaScript is useless for data exploration, that's why very little data scientist uses JavaScript and all kinds of none white spaces languages. Curly braces doesn't work well in iterative explorative programming
- mort96 3y ago"Languages with curly braces are categorically useless for data exploration" is certainly ... a take.
- throwawaymaths 3y agodon't nobody tell him about this double bracket [[]] language called mathematica!
- willio58 3y agoI don’t think even the creator of Python would agree with this..
- test098 3y agoi've built an entire career building apps and tools in JS for data scientists to explore complex data. tons of companies pay lots and lots of money for this - i'm currently at a FAANG doing exactly this with data scientists.
- mike_ivanov 3y agoDid you forget about R?
- v3ss0n 3y agoyet it doesn't even have a comparable market share ( even tho whole ecosystem is dedicated for datascience)
- throwawaymaths 3y ago> We believe JavaScript, instead of Python, could act as an ideal language for expressing mathematical ideas if the proper infrastructure existed 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.
- jampekka 3y agoI'd love to use JS instead of Python for math/numerical stuff for many reasons, but without operator overloading it's just hell.
- cnity 3y agoInterestingly I dislike Python for the exact same reason. Every time I look at a PR, I second guess every single operator and index. Does this attribute access carry a heavy penalty or side effects? Etc. I find it adds a large mental overhead to any given piece of code.
- jampekka 3y agoSide effects on operator overload or attribute read are just really bad practice and is very rarely done. Do you second guess every identifier in C because it could be a preprocessor macro? Yeah, stupid overloading like C++ IO is a mess, but I haven't encountered much such abuse in Python.
- cnity 3y agoFair points. I do find the scope of C macros to be far narrower than overloading, but you are right.
- mehagar 3y agoSee also Web Neural Network API: https://www.w3.org/TR/webnn/ https://www.w3.org/TR/webnn/
- notnullorvoid 3y agoSmall correction: It wasn't rolled back due to instability, it was because it increased deno startup time even for programs that weren't making use of WebGPU apis. That is no longer the case this time around. As someone who detests python, I really hope we can get some good TS WebGPU libs going. In fact any ML lib using WebGPU under the hood would be quite portable to other languages and platforms.