4 ms·
You can now use WebGPU in Cloudflare Workers
- latchkey 3y agoDawn supports OpenGL, but that was left out of the blog post.
- fidotron 3y agoThe most surprising aspect of this seems to be that Cloudflare would think of deploying it, given the apparent cost of GPUs. It almost suggests they are using GPUs for their own workloads already. Honestly the clear case for this will be in online video distribution; both the video processing itself (encoding, compositing, enforcing privacy masks) and using inference to decide how to route it (including choosing bandwidth, configuring the internal distribution graph).
- deleted 3y ago[deleted]
- no_wizard 3y agoThis is pretty amazing. This allows you to do all kinds of stuff around video, manipulation stands out to me, though they mention GPGPU as a use case without further elaboration, which makes me wonder if they might be coming out with something soon where you can use WebGPU APIs for GPGPU scenarios.
- paulgb 3y agoIf by GPGPU you mean compute shaders, they do support that today according to the announcement. > we fully support the part of the API that the compute shaders and the compute pipeline require, but we are not yet focused on fragment or vertex shaders used in rendering pipelines.
- alex7o 3y agoYou might be interested in this https://github.com/webonnx/wonnx https://github.com/webonnx/wonnx
- et-al 3y agoI couldn't find out the VRAM limit, but I assume for video manipulation one would need quite a bit. Also, it looks like the workers themselves only have access to 128MB of RAM unless this has changed? https://developers.cloudflare.com/workers/platform/limits/#memory https://developers.cloudflare.com/workers/platform/limits/#m...
- anonbanker 3y agoConsidering how CloudFlare was just implicated in destroying secure email at Defcon [1], the addition of GPUs to that active assault is terrifying. 1. https://www.youtube.com/watch?v=NwnT15q_PS8 https://www.youtube.com/watch?v=NwnT15q_PS8
- drunkendog 3y agoI believe the secure email issue linked is exploitable by any MailChannels customer, not just Cloudflare Workers.
- ttul 3y agoAll Workers API calls to MailChannels must send email from a domain that has a Domain Lockdown record authorizing the Worker by its CF-Worker header. Docs are here: https://support.mailchannels.com/hc/en-us/articles/4565898358413-Sending-Email-from-Cloudflare-Workers-using-MailChannels-Send-API https://support.mailchannels.com/hc/en-us/articles/456589835... Since you cannot forge the CF-Worker header in API requests (this header is added by Cloudflare's back end), it is not possible to send email for any domain that hasn't been locked down to your specific Worker.
- stri8ted 3y agoThe CloudFlare worker is just being used to make a POST request to MailChannels. How is this a CloudFlare problem?
- weird-eye-issue 3y agoIt was Mailchannels, and Cloudflare was only one of the many companies that they fooled into doing an integration. As far as the CF Workers <> Mailchannels integration, the security issues are pretty much fixed now, but I still wouldn't trust Mailchannel
- thereisnojesus 3y ago[flagged]
- 3y ago
- btown 3y agoSecuring multiple tenants on a GPU is a really, really hard problem. As https://gpuweb.github.io/gpuweb/#malicious-use https://gpuweb.github.io/gpuweb/#malicious-use notes, there's a tremendous surface for undefined behavior. Now, it does appear that the security model https://developers.cloudflare.com/workers/learning/security-model/ https://developers.cloudflare.com/workers/learning/security-... ensures that any nodes to which the GPU is connected aren't running the full JS Workers code, just the WebGPU functionality. So secrets that are maintained on the JS side aren't likely vulnerable to Cloudbleed-esque attacks: https://en.wikipedia.org/wiki/Cloudbleed https://en.wikipedia.org/wiki/Cloudbleed . But I'd be incredibly wary in sending sensitive information to the WebGPU calls themselves - assume any other WebGPU-using tenant can arbitrarily access data sent to any GPU and modify your outputs.
- toddmorey 3y agoHelp: I can wrap my head around WebGPU for in browser & on device 3D, video, and ML like face or hand tracking, etc. I struggle to imagine the use cases where WebGPU runs on the edge / servers & makes more sense than other ways to access GPUs. Anyone have a good layman’s example use case?
- andrejguran 3y agoThey have pretty cool examples here: https://ai.cloudflare.com/?gpu https://ai.cloudflare.com/?gpu Text Generation Speech Recognition Image Classification Text Classification Text Embedding Translation
- celso 3y agoThe demos in this page are using Workers AI, not WebGPU APIs. However, yes, you can perfectly run an ML inference runtime that takes advantage of GPUs using just Wasm and WebGPU APIs. That's exactly what we have here: https://github.com/cloudflare/workers-wonnx https://github.com/cloudflare/workers-wonnx
- vineyardmike 3y ago1. You want or have a “serverless” function. 2. You want to add some sort of ML work to that serverless function. 3. The serverless function runs on a maimed browser environment (v8) Specific examples… you have an API that takes a picture returns if there’s a hotdog in the picture. Or an API to generate images from customer input. Etc. Why is this better or why does it make more sense? If you’re already using the above environment for your functions it makes sense to keep using it. In this way, you don’t have to manager or provision GPUs at all.
- fragmede 3y agoYeah, but why edge for that? It makes sense for something like Stadia (rip) so i guess that's one example, but is the user experience for hotdog-or-not really improved that much by the extra 50 Ms or whatever of latency that edge gives you over closest core?
- antimora 3y agoHooray. Now I can run WebGPU ML on a cloudflare worker using Burn framework in Rust (https://github.com/burn-rs/burn https://github.com/burn-rs/burn). Burn has WebGPU backend in Rust.
- celso 3y agoWe'd love to see it!
- millerhooks 3y agoI’ve been working on and towards similar for nearly six years now. CloudFlare just eliminated so much stack complexity for me in one swoop and cleared a considerable amount of my todo list. Good work y’all!
- bostonvaulter2 3y agoCould this be used to run playwright.dev with GPU acceleration?
- celso 3y agoWe do support Puppeteer https://developers.cloudflare.com/browser-rendering/platform/puppeteer/ https://developers.cloudflare.com/browser-rendering/platform...