Live data from Hacker News

Ask HN: Resources for general purpose GPU development on Apple's M* chips?

news.ycombinator.com

61–70 of 86 posts

Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?

#61

Why not OpenCL or OpenGL? You'll not be constrained by the flavor of GPU.

Sounds like you've never actually tried running those two APis across platforms?

if you want portable use WebGPU either via wgpu for rust or dawn for C++ They actually do run on Windows, Linux, Mac, iOS, and Android portably

Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?

#62
post #61

Why not OpenCL or OpenGL? You'll not be constrained by the flavor of GPU.

Sounds like you've never actually tried running those two APis across platforms? if you want portable use WebGPU either via wgpu for rust or dawn for C++ They actually do run on Windows, Linux, Mac, iOS, and Android portably

wgpu Just Works from C++ as well. Both projects implement the webgpu.h API

Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?

#63
post #52

Earlier quoted context omitted.

What would a "llvm compilable" hello world look like that matches the libc GPU example for "AGX" (Apple Graphics)? It's not possible from MacOS, right? It'd have to be done from Linux?

No, I don't think it is impossible for MacOS. I might be missing a detail here, not sure. I have to think it over. I have seen [1] you can patch ANECompilerService, so you can even speed up existing code, because Apple compiles your code just in time (at runtime) on each machine. We could do that for MacOS libc too. [1] Some how-to hints in https://discussions.apple.com/thread/254758525?sortBy=rank

How do you issue/execute "GPU" machine code instructions from MacOS not through Metal?

Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?

#64
post #40
post #30

Earlier quoted context omitted.

I agree that it allows Apple to redefine Apple Silicon instruction sets without having do explain it to 3rd party software developers, but it is certainly not the main reason they hide the technical documentation of the chips.

Why not? Metal is the answer. Everything else is just implementation detail as GP said. Apple doesn’t provide developer support to other OSes. The only OS they do anything for* is macOS. So to them there’s no point. All they’d get is people relying on implementation details they shouldn’t, other companies stealing what they consider their trade secrets, or more surface area for patent trolls to scan. * Someone on the…

> Metal is the answer. Everything else is just implementation detail as GP said.

You can say this as long as you want, Nvidia makes money hand-over-fist supporting CUDA alongside OpenCL and DirectX. It's all just business to them - they don't have to play the same game as Apple because they're just not quite so petty with the ecosystem politics.

Look at MacOS, for example. Plenty of legacy software never was supported in Metal, it's "implementation detail" never manifested. It wasn't even really used in AI either until Apple upstreamed their own MPS hacks into Pytorch and people got BERT et. al. working, and even that was a pint-sized party trick that you could do on a Raspberry Pi. Apple themselves aren't even using their own servers for serious inference either, because you can't. It's gotta be offloaded to a lower-latency platform.

It's not just that Metal as a platform has failed it's users, although it's certainly contributed to developers giving up on Mac hardware for serious compute. Apple's GPU design is stuck in iPhone mode and they refuse to change their approach with Apple Silicon desktop hardware. It was Apple's big bet on NPUs that hamstrung them, not an implementation detail, and if you don't believe me then wait and see. Xserve didn't tear down the 1U market, Asahi didn't upend Linux HPC, and Metal isn't going to upend AI compute any more than DirectX will. This is the same "Apple will get 'em next year" quote we always hear when they fuck up, and they never actually seem to swallow their pride and take notes.

Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?

#65
post #52

Earlier quoted context omitted.

No, I don't think it is impossible for MacOS. I might be missing a detail here, not sure. I have to think it over. I have seen [1] you can patch ANECompilerService, so you can even speed up existing code, because Apple compiles your code just in time (at runtime) on each machine. We could do that for MacOS libc too. [1] Some how-to hints in https://discussions.apple.com/thread/254758525?sortBy=rank

How do you issue/execute "GPU" machine code instructions from MacOS not through Metal?

You (or your compiler) write the instructions and data into unified memory (up to 192 GB) and jump to the first instruction (usually of a loop) on each core. GPU and ANE processor cores are not fundamentally different from CPU cores, they just have fewer transistors (gates) and therefore more limitations in what a register can address, what data type or what instruction it can execute. Some cores can only execute the same instruction as there neighbor core in a team, but on different data. Or at a different time, synchronized with neighbors. But they still are Turing complete processors so in essence are the same as their cousins the CPU cores. Sometimes cores input or output addresses are in a pipeline between cores (so it limits its address offset).

MacOS only plays a role in allocating and protecting the instruction or data memory regions for the GPU and ANE processors.

Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?

#66

Earlier quoted context omitted.

CUDA didn't prevent anything at least not in the way you believe. Intel and AMD had no competitive offer, period. They still don't. NVIDIA is simply offering an ecosystem that is battle tested and is ready out of the box. Look at the recent semianalysis test to see how not ready AMD is, who would be the only company to have a real shot at this. Their HW on paper is better or equal, yet their software ecosystem is now…

> Look at the recent semianalysis test to see how not ready AMD is, who would be the only company to have a real shot at this. Their HW on paper is better or equal, yet their software ecosystem is nowhere ready. Reading that was kind of odd. It seems like their conclusion was that on paper AMD should be significantly less expensive and significantly faster, whereas in practice they're significantly less expensive and…

They literally spent months trying to work out the bugs. It’s an absolute admonishment of AMD’s software stack.

Just look at their market value and it says everything you need to know about how much “better” AMD is than NVIDIA.

Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?

#68

There is no general purpose GPU development on Apple M series. There is Metal development. You want to learn Apple M-series gpu and gpgpu development? Learn Metal! https://developer.apple.com/metal/

> There is no general purpose GPU

That's what GPGPU stands for. So your 2 sentences contradict each other.

Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?

#69
post #40

Earlier quoted context omitted.

Why not? Metal is the answer. Everything else is just implementation detail as GP said. Apple doesn’t provide developer support to other OSes. The only OS they do anything for* is macOS. So to them there’s no point. All they’d get is people relying on implementation details they shouldn’t, other companies stealing what they consider their trade secrets, or more surface area for patent trolls to scan. * Someone on the…

> Metal is the answer. Everything else is just implementation detail as GP said. You can say this as long as you want, Nvidia makes money hand-over-fist supporting CUDA alongside OpenCL and DirectX. It's all just business to them - they don't have to play the same game as Apple because they're just not quite so petty with the ecosystem politics. Look at MacOS, for example. Plenty of legacy software never was supporte…

Apple are using their own servers for inference, that's the whole private cloud compute thing. Siri and other things use models and probably aren't running on it (though it's not announced), but those are older.

> Apple's GPU design is stuck in iPhone mode and they refuse to change their approach with Apple Silicon desktop hardware.

Looks competitive to me.

https://venturebeat.com/ai/you-can-now-run-the-most-powerful...

Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?

#70

Earlier quoted context omitted.

idk about “known” considering they basically created OpenGL

That was SGI.

I think that's a typo. Apple created OpenCL.

OpenGL then added compute shaders to make twice the implementation cost for the same feature.

Post reply on HN