Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You probably won't get this performance when webgpu is finalized. It has to add bounds and sanity checks. It's unclear how much worse the perf will be.


Assuming the M1 GPU works like most modern GPUs then bounds checking is already built into every memory operation.

Memory operations in modern GPUs basically evolved from fetching textures (which intrinsically have bounds checking built in, they have a width and height). All modern desktop GPUs (and probably mobile GPUs these days) use "descriptors" for textures and buffers which specify both address and size. Out of range fetches from a buffer return 0 and out of range writes are no operations.

There have been some GPUs in the past that could literally write to any address in main memory (famously the GPU in the XBox360 could do this), but its not true of any modern GPU as far as I know.

On a different note, 900 GFlops from a GPU is not really that impressive. Desktop GPUs reached this kind of performance nearly 10 years ago, but I guess its not bad for a first generation new design.


I guess it's not bad for a fanless 10-watt SoC the size of a stamp on an entry-level portable computer in a browser.

To get that kind of performance nearly 10 years ago in a desktop GPU, I bet you would need a whole lot of dollars, watts, and cube inches.

It is impressive unless you compare apples to oranges.

Plus, on bare metal it reaches 2.6 TFLOPs already.


>entry-level portable computer

Not all computers are Macs and at €1000 starting price, it's the entry level Mac but by no means an entry level computer.

Entry level computers are in the €400 ballpark (i5/4500U, 8GB RAM, 256 SSD).

For €1000 you could get a pretty strong gaming computer which is by no means entry level.


Entry level m1 is a quite a bit cheaper than that in euros.


MSRP is actually quite a bit more, almost €1129.

https://www.apple.com/at/shop/buy-mac/macbook-air

Not saying you can't find it under that on some promotion somewhere but that really depends on market timing and on where you live.

For example in Austria you can't find it under €999 and that's definitely not entry level money as Apple's entry level comes at a premium and is not representative of the entire PC market entry level.


Note that the price in Euro (almost?) always includes VAT, while in USD it almost never does. Which explains why albeit $1 < 1€, the displayed euro price is higher than the dollar price.

That being said, I agree with all you said.


I was looking at Mac mini m1 on the German Apple store, for 799.


Nearly 10 years ago a 2.6 TFLOP (FP32) GTX 660ti cost about $300 and had a TDP of 150w.


Kinda proving my point then? Power usage 15x higher and $300 is just for a card that is probably as big as a whole Mac Mini.

Now add the rest of the components and the prices, wattage and size shoots up exactly as described.


See, that's what I also thought, but I've heard that the built-in bounds checking can be pretty buggy. I'm not an expert though.

Yeah, compared to modern desktop GPUs, which can hit probably 20-30 times this, it's not that impressive. That being said, they're also consuming 20-30 times the power.


this is a good point, and I'm quite curious what the hit will be.

Safari makes it substantially easier to enable WebGPU than Chrome does (requiring a canary version and flags), which leads me to believe there's already some security mechanisms in place. But, time will tell!


I tried it with Chrome Canary with the relevant flag but unfortunately it didn't seem to work with this particular site failing with "TypeError: Failed to execute 'createBindGroupLayout' on 'GPUDevice': required member entries is undefined.".

Shame as I wanted to see what happened if I pitted my desktop against it. Of course it's likely the WebGPU implementations between browsers are not equivalent from a performance point of view.


Unfortunately the browsers haven't quite settled on a standard, so the code posted only works in Safari.

More context here: https://news.ycombinator.com/item?id=22022962


It's pretty clear that SPIR-V should be chosen.


You may want to read this summary of the arguments pro and con SPIR-V, made by Kvark a gfx engineer at Mozilla, so you have a more balanced view of the topic :

The summary exists in two variants: a graphic summary[1] and a textual one[2].

[1] https://kvark.github.io/webgpu-debate/SPIR-V.component.html

[2] https://kvark.github.io/webgpu-debate/SPIR-V.html


WGSL has been chosen as of 2021, nothing more to discuss.

https://gpuweb.github.io/gpuweb/wgsl.html


> I tried it with Chrome Canary with the relevant flag but unfortunately it didn't seem to work with this particular site failing with "TypeError: Failed to execute 'createBindGroupLayout' on 'GPUDevice': required member entries is undefined.".

Firefox also raises the same error. It looks like Safari implements a former version of the WebGPU draft[1] where Chrome and Firefox implement a more recent one.

[1] :https://gpuweb.github.io/gpuweb/#dictdef-gpubindgrouplayoute...


They would show real usage performance though.

Still valuable.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: