18 ms·
Benchmarking the Apple M1 Max
- m15i 5y agoRegarding training ResNet50, even though img/sec is less than the 3090, could a 64gb m1 max accommodate larger image sizes than the 24gb 3090?
- lopuhin 5y agoProbably they would be close - M1 still needs to use memory for the OS and other stuff, while 3090 can use fp16/mixed precision, which in many cases almost doubles effective memory. Also if we talk about training, then a more mature CUDA implementation of things like batch normalization and optimizers can also result in lower memory usage compared to a likely less mature TF Metal support.
- brrrrrm 5y agofor those curious about running their own matmul benchmarks, I wrote a script a while back that works with both linux and MacOS that should make comparison easy. https://jott.live/code/blas_test.cc https://jott.live/code/blas_test.cc I saw ~1.2tflops on the regular M1
- matja 5y agoOn Linux I had to use `-lcblas` instead of `-lblas`. "6.63171 gflops" with a 24-core AMD EPYC 74F3
- homerowilson 5y agoI used OpenBLAS on my cheap last-generation AMD Ryzen 7 4700U laptop like so: git clone https://github.com/xianyi/OpenBLAS https://github.com/xianyi/OpenBLAS && cd OpenBLAS && make PREFIX=/opt/openblas install && curl https://jott.live/code/blas_test.cc https://jott.live/code/blas_test.cc | sed -n "/<code>/,/code>/p" | tail -n +2 | head -n -1 > blas_test.cpp inspect blas_test.cpp file, and then... g++ -I/opt/openblas/include/ blas_test.cc -lopenblas -std=c++11 -O3 -L/opt/openblas/lib/ -o blas_test && ./blas_test 512 512 512 100 100 and got a peak of about 192 gflops, averaging closer to 180. So yeah, the M1 is > 6x faster in this simple single-precision matrix test.
- matja 5y ago541 gflops here, following those steps. Well done Apple for making a laptop CPU over 2x faster than a 250W server CPU released this year :)
- kitestramuort 5y agoWith my Ryzen 7 5800U laptop I get around 530 gflops, with a peak of 596 if I compile the test against MKL with g++ -I/opt/intel/mkl/include/ blas_test.cc -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -std=c++11 -O3 -march=native -L/opt/intel/mkl/lib/intel64 -o blas_test_mkl
- brrrrrm 5y agoIf you swap out “code” in the url for “raw” you get the raw text itself without a need to use sed https://jott.live/raw/blas_test.cc https://jott.live/raw/blas_test.cc
- YetAnotherNick 5y ago2.1 TFlops on 8(6 efficiency) core M1 pro
- PragmaticPulp 5y agoGreat detailed benchmarking. This mirrors my experience with my M1 Max: Absolutely amazing battery life and performance in a laptop. I’m thrilled to have it. Huge step up from last gen Apple laptops. But at the same time, it feels like some of the rhetoric around the performance claims got a little out of hand in the wake of the launch. It’s fast, but it’s not actually crushing my AMD/nVidia desktop like a lot of news outlets were suggesting it would. In fact, a lot of the GPU tests here show more or less what I’ve seen: That Apple has matched the power/performance of other leading-edge GPU hardware: > Pretty much what we would expect, with the M1 Max having about 8x less performance, but at 8x less power, so performance per watt is surprisingly quite comparable between the two. This is actually an impressive accomplishment out of Apple. I’m just afraid it might get overshadowed by the fact that it doesn’t live up to some of the fairly extreme performance claims that got tossed around in the days following the launch.
- BurningFrog 5y agoPretty sure the panegyric performance claims are from Mac people comparing it to the rather sad previous generation of Macbooks.
- whynotminot 5y agoBut the fact that you're even mentioning your desktop in the same breath is kind of the whole reason it is amazing. Like that's the rhetoric--holy shit your laptop is doing this. Apple hasn't even released the Pro desktop stuff yet.
- 2OEH8eoCRo0 5y agoI doubt that they can make another giant performance leap. I wager that most of their gains are from being a node ahead of the competition (5nm vs 7nm TSMC) and placing RAM on package for much fatter bandwidth. I am, however, very interested in seeing what the competition does in response.
- JohnBooty 5y agoYeah. I'm worried that they may have played their trump cards already, so to speak. I wonder if future perf gains will come, game console-style, from areas besides general purpose computation -- specialized instructions / cores for specialized tasks. Imagine an entire core optimized for Safari and its Javascript engine. Their next chip is called the "M1 Marathon Edition" and you get 36 hours of real-world battery life with Safari. And/or the iWork suite. And maybe they have a behind the scenes collab with Slack and select other app makers so that they can be a part of the "Marathon" program too. I dunno, just spitballing. Not saying that's likely or even what I'm pining for, just one possible avenue once they've plucked all the low-hanging general purpose computing fruit.
- newaccount74 5y agoI also got an M1 Max. The chip is amazing. Compile times are a lot faster than on the 6 core Intel Mac mini I had before. But at this point it's really held back by Apple's software. Anything related to Apple ID and iCloud regularly hangs 30-60 seconds, showing a spinner with no progress indicator whatsoever. Apps randomly take 20 seconds to launch, maybe because of [1]? The Open/Save dialog taking 30 seconds to show. ControlCenter using 8GB of RAM to show a few sliders (I hope they fix that bug soon). The scanning feature in Preview is so unreliable that I started using my Windows machine for scanning something on my HP all-in-one. Some of those problems may be issues with 3rd party software (drivers), and others are just things that slipped through QA, and will hopefully be fixed in an update. But some of the issues are structural issues, where Apple has made questionable decisions that means issues can never be fixed. Eg. designing a security architecture that requires synchronously checking a binary signature during app startup with a web service is bound to cause performance issues. Or the design of the XPC system, which uses asynchronous message passing between services that are implicitly launched on demand sounds nice in theory, but it has been the source of so many bugs, causing temporary or permanent app hangs that are impossible to debug. The system was introduced in macOS 10.7 (!) and it still doesn't work reliably! At this point I've lost hope it will ever work properly. [1]: https://sigpipe.macromates.com/2020/macos-catalina-slow-by-design/ https://sigpipe.macromates.com/2020/macos-catalina-slow-by-d...
- amelius 5y agoIf software is the issue, can't you run Linux on it?
- RealityVoid 5y agoWas playing around with it just this weekend. It's... not there yet. It will be, but it's a work in progress. You could run it today if you wanted to, but there are a bunch of things that are missing.
- cheeze 5y agoDoes anyone really think that running Linux on custom Apple hardware is actually going to make things _better_?
- willvarfar 5y agoExcellent investigation. I have the first M1 MBP pro 13” and have done a lot of data stuff on it. My experience was also that python flew - cpython on the M1 being almost as fast as pypy on my 2019 i7 laptop - and java compilation was much faster too. The CPU is fast and the memory is really fast. The performance pain points though was anything involving containers, random 10-30 sec stalls in boot and app startup (I think it’s corporate firewall stuff) and a general preference I have for Linux desktop over OSX (yeah I’m a programmer).
- akdor1154 5y agoFor all the (truly) amazing performance from the M1.*, how much of the benefits are just coming from Mac users not realising how laggy their OS is on non-extreme hardware? I used MacOS for two years on a '15 i5 MBP and didn't realise how persistently sluggish it was until i blew everything away and chucked on Xubuntu. (Nothing magic about linux here, Gnome and KDE were as bad as MacOS) Is the incredible performance of the M1 just going to enable a whole new generation of inefficient software?
- jonstewart 5y agoThis article literally benchmarks a variety of low-level compute heavy operations and compares them with a Ryzen. It’s about as far away from your take as possible.
- nicce 5y agoYou might have missed the point - he means that more we get performance from the hardware, less we care about optimising software. And this is already a problem with Electron for example.
- jonstewart 5y agoI get that point, thanks. Neither that glittering generality nor the supposition that Mac users are blown away by the M1 simply because macOS was running on creaky Intel hardware have anything to do with the article though.
- wayeq 5y agoYes.. software gets slower faster than hardware gets faster
- jeffbee 5y agoDidn't numpy remove Apple Accelerate support recently because it has numerical problems? Their docs are still warning against it.
- lopuhin 5y agoYes, but then they brought it back here https://github.com/numpy/numpy/pull/18874 https://github.com/numpy/numpy/pull/18874 - apparently Apple developers fixed these issues.
- matthewmacleod 5y agoGood to see a detailed benchmark. I’m pretty impressed by the performance in real-world applications as well - the machine is easily 2.5—3x as fast at running various builds and processing jobs as my 15” from 2018 was, and it’s cool and quiet while doing it. The performance claims have been a bit overblown in some quarters - it’s not going to replace a 5950X with a big GPU, and some of the rhetoric is a bit silly. But it’s surprisingly close - watching a silent laptop rip through a build faster than the 125W TDP i9-10900K we have in the office is pretty cool!
- Jack000 5y agoOne thing I don't see anyone mention is that the M1Max is the probably the cheapest GPU memory you can buy. The only other way to get >=64Gb GPU memory is with the A100 (?) which is like 20k by itself. So this would be great specifically for finetuning large transformer models like GPT-J, which requires a lot of memory but not a lot of compute. Just hoping for pytorch support soon..
- aantix 5y agoWould it make sense to mine BTC with it?
- officeplant 5y agoAt this point it doesn't make sense to mine BTC on any GPU.
- grishka 5y agoBTC mining isn't memory-bound, it's compute-bound. The more sha256 hashes you can compute per second, the better. And I'm highly doubtful that any general-purpose hardware at all could even begin to compete with mining ASICs.
- Behemoth66 5y agoWould you or someone happen to know/guess the hash rate of the M1 Max?
- grishka 5y agoI don't think there's a definite answer to this. There's no existing bitcoin miner software optimized for Apple hardware. So, do you use the CPU? The GPU? Both? If you do use the GPU, which API do you use to program it?
- sudosysgen 5y agoHmm, technically no, an R7 5700G system and 2x 32GB sticks would be around a fifth of the price. That's if you don't need a lot of compute. It's also right around 1/8th the performance of a 3080 but it doesn't have Tensor cores which is big downside in ML. In theory you could even push the 5700G to 128GB if you figured out a way to get ECC to work on it.
- musicale 5y agoThe memory bandwidth result is impressive.
- noveltyaccount 5y agoFinally some benchmarks beyond just encoding video (which is admittedly a huge use case for these CPUs). I've been on Windows for decades, and this step change in computing performance is a Siren's call for me to switch, I've never wanted an Apple product so much as this before.
- bee_rider 5y agoI wonder if they'll somehow include the AMX 'instruction' (or whatever it is) into BLIS kernels. GEMM isn't everything, but it is a pretty important building block in linear algebra. (I mean that's the big observation of these fancy tile based BLAS implementations).
- stephencanon 5y agohttps://www.youtube.com/watch?v=xMiWe07Rjss https://www.youtube.com/watch?v=xMiWe07Rjss
- jessriedel 5y ago> We already know that the M1 Max CPU should have really strong matrix multiplication performance due to Apple's "hidden"/undocumented AMX co-processor embedded in the CPU complex, and that it is leveraged when you use Apple's Accelerate framework Does this hold for the M1 Pro?
- protoax 5y agoI see no reason why not considering the core CPU component of the SOCs are very similar.
- lincpa 5y agoApple M1 unified memory architecture(published on November 11, 2020.) is my "warehouse/workshop model"(hardware architecture section published on February 06, 2019). It has not yet fully realized the warehouse/workshop model, It needs to further improve the programming language, compiler, and OS to support and promote my programming methodology. Reference 1. The Math-based Grand Unified Programming Theory: The Pure Function Pipeline Data Flow with Principle-based Warehouse/Workshop Model https://github.com/linpengcheng/PurefunctionPipelineDataflow https://github.com/linpengcheng/PurefunctionPipelineDataflow Its mathematical prototype is the simple, classic, vivid, and widely used in social production practice, elementary school mathematics "water input/output of the pool". My theory rebuilt the theoretical foundation of the IT industry, It makes the computer theory system fully & perfectly related to mathematics in a simple and unified way: from hardware integrated circuits and computer architecture, to software programming methodology, architecture, programming language and so on. It solve the most fundamental and core major problems in the IT industry: The foundation and core of the IT theory lack mathematical support. 2. Why my "warehouse/workshop model" can achieve high performance and low power consumption (take Apple M1 chip, Intel AVX-512, Qualcomm as examples) https://github.com/linpengcheng/PurefunctionPipelineDataflow/blob/master/doc/why_wwmodel_fast_en.md https://github.com/linpengcheng/PurefunctionPipelineDataflow... 3. In the future, OS will be a DB, and Clojure will be the best DML, The future OS kernel will be a data-oriented scheduler (with Computer hardware and software integration architecture diagram) https://github.com/linpengcheng/PurefunctionPipelineDataflow/blob/master/doc/OS_as_DB_en.md https://github.com/linpengcheng/PurefunctionPipelineDataflow... 4. Foxpro Database-oriented programming paradigm is the development direction of the future programming language https://github.com/linpengcheng/PurefunctionPipelineDataflow/blob/master/doc/Mummy4Foxpro.md https://github.com/linpengcheng/PurefunctionPipelineDataflow...
- YetAnotherNick 5y agoGood post. One thing to note is that the 3090 being 8 times faster is not very correct statement. The author is comparing FP16 3090 with FP32 M1. The difference between them is more like 3-4 times for FP32. Even that is not true FP32 for 3090 as tensorflow uses Nvidia's AI32 by default for convolution.
- rc_mob 5y agoDid I get the worst M1 Max in the world? In my one month with this computer so far -- its been problematic. It has this fun issue where it freezes up for a couple seconds randomly when watching youtube. Its frozen for a few seconds in other situations also. One time it just rebooted completely right in the middle of using it. Add to that I've never gotten more that 4 hours out of this battery. Personally I'm kind of regretting the purchase. My 2015 Macbook Pro is faster than it.
- easton 5y agoDid you use Migration Assistant to move your stuff over? You might be using Intel versions of your apps.
- susodapop 5y agoIf you haven't already, speak to Apple about replacement under warranty. Those numbers aren't justified by anything apart from hardcore video editing 100% of the time on battery.
- bilalq 5y agoGlad to see benchmarks and a writeup for an audience doing something other than video editing. It feels like Youtubers only make review videos for other Youtubers these days. Even if the methodology here isn't very scientific, it's at least useful as anecdotal info.
- cr3ative 5y agoPlease don't open sharing options when I highlight text - that's how many people including me keep track of reading position. I had to try and adblock the element which pops up to read this.