News for hackers. Stuff that matters.
Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by yayr on Tuesday February 22, 2022 @05:53PM (#30435038)
there is also some hint about performance/watt vs an NVIDIA A100 using BERT models:

> The A100 draws 131W peak during the training run, the M1MAX GPU draws a maximum of 15.4 W. The A100 runs an iteration at 7ms vs 104ms (with SHARK) and 196ms (with TF-Metal)

Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by sudosysgen on Tuesday February 22, 2022 @06:15PM (#30435231)
So the A100 is 75% more efficient despite being in a high power variation of a larger node. Seems Apple still haw a lot of work to do in the GPU/ML side of things.
Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by olliej on Tuesday February 22, 2022 @06:28PM (#30435339)
My reading implied that they weren't able to use the apple hardware acceleration for AI, which given the massive perf delta I suspect the A100 is using. If they weren't using the A100's ML hardware I'd be both amazed by Nvidia's engineers, and also unhappy as it would be unfair for the test to not use the features of the hardware (this is a common refrain in some benchmarking circles where you disable features to get "fairness" in comparisons).

Honestly though I'm more concerned about the other aspects of apple's software: "The OSX Window Server crashes when all GPUs are used to the maximum"

Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by noxa on Tuesday February 22, 2022 @06:34PM (#30435398)
Correct! We're currently compiling to SPIR-V and then going through MoltenVK/spirv-cross to get to Metal - and our SPIR-V needs quite a bit of work (currently tuned for Mali, which is a very different architecture). The biggest limiter though is as you note Apple doesn't have a way to use the fancy hardware instructions whereas our CUDA version is using the Tensor Cores.

The good news (for us) is that this is all effectively -O1 today; there's still potential for 2-8x speedups over these numbers and that's not even factoring in the inaccessible HW features that maybe one day Apple will expose :crossed-fingers: :)

// IREE dev

Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by AceJohnny2 on Wednesday February 23, 2022 @01:35AM (#30438359)
Any chance of using the Neural Engine (otherwise exposed by CoreML) ?
Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by magic_at_nodai on Wednesday February 23, 2022 @06:20PM (#30448056)
unlikely since the interface from ANE is not public and it may change between hardware versions.
Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by yayr on Tuesday February 22, 2022 @06:30PM (#30435356)
yeah, you could also say the performance is only 57% in this particular test for the M1 vs A100. Still not bad for a laptop though with a first gen chip.
Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by smoldesu on Tuesday February 22, 2022 @06:32PM (#30435371)
The M1 is (supposedly) specialized for ML calculations and on a decidedly denser node, though. I guess it's a testament to either CUDA's power or machine learning GPGPU optimization.
Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by simondotau on Tuesday February 22, 2022 @07:00PM (#30435633)
> The M1 is (supposedly) specialized for ML calculations

It is, but they’re not using any of that. Only the M1 GPU at this time.

Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by magic_at_nodai on Tuesday February 22, 2022 @07:07PM (#30435704)
Yeah the ANE and AMX on cpu are wrapped behind Accelerate Framework and CoreML. So you will have to use CoreML (which wasn't able to compile the latest TF BERT). ANE is also inference only. So if you want training you will have to use the GPU with Apple's Tensorflow-Metal.

//part of nod.ai / SHARK team.

Re:PyTorch on Apple M1 MAX GPUs with SHARK – faster than Ten... by yayr on Tuesday February 22, 2022 @06:40PM (#30435447)
I like this blog to understand NVidia perf stats (search for "Normalized GPU deep learning performance"):

https://timdettmers.com/2020/09/07/which-gpu-for-deep-learni...

It seems that their consumer GPUs also have a gap