11 ms·
ARM MacBook vs. Intel MacBook: A SIMD Benchmark
- epmaybe 6y agoAre there any good real-world applications that take heavy advantage of SIMD? I imagine it would be very prolific given the benefits offered but SIMD, but I honestly have no idea.
- kevingadd 6y agoIt's very common in image and audio processing algorithms, and overall lots of general-purpose libraries used in software will use SIMD instruction sets. Even things like memcpy or String.IndexOf are vectorized in modern runtimes. IIRC Facebook released a very carefully tuned hashmap that uses SIMD instructions to do many of its search operations.
- The_rationalist 6y agoSource for the Facebook hashmap? Is is faster than swisstable? Edit: found it https://news.ycombinator.com/item?id=19759630 https://news.ycombinator.com/item?id=19759630
- blake1 6y agoI do lots of simulation, and make extremely heavy use of SIMD.
- jamesnaismith 6y agoBiological sequence alignment.
- haxiomic 6y agoSIMDs are big in computer graphics – you'd expect them to be used heavily in physics simulation and CPU-based rendering engines. Would be interesting to see how blender's Cycles or say Arnold Renderer performs on M1
- pengaru 6y agoDo video games qualify? Anything that does stuff like lots of matrix multiplication is a prime candidate for SIMD optimization.
- espadrine 6y agoA heavy SIMD user is in all things cryptographic. You can read what Google did on Android phones to encrypt drives here for instance: https://lwn.net/Articles/776721/ https://lwn.net/Articles/776721/
- zamadatix 6y agoIn real world though anything but the lowest end hardware will have cryptographic offloads either in the CPU or storage controller (or both). The M1 actually excels at AES throughput for instance. For esoteric/custom crypto it could play a part though but you have to have good reasons to not want to use standard crypto at higher speed for it to be your use case which is why I say it'd be uncommon.
- espadrine 6y agoThat is especially true for algorithms that are not so easy to put in SIMD. Modern designs tend to be very SIMD-aware, such as BLAKE3[0] and Gimli[1]. [0]: https://github.com/BLAKE3-team/BLAKE3/blob/master/c/README.md#arm-neon https://github.com/BLAKE3-team/BLAKE3/blob/master/c/README.m... [1]: § 5.6 https://gimli.cr.yp.to/gimli-20170627.pdf https://gimli.cr.yp.to/gimli-20170627.pdf
- chongli 6y agoIsn’t that already handled by crypto instructions on the chip?
- robert_foss 6y agoVideo en/de-coding
- umanwizard 6y agoPyTorch and NumPy make heavy use of SIMD for most tensor/ndarray operations.
- makapuf 6y agoWhen done on cpu ; the computation done on the gpu can be the majority for pytorch.
- umanwizard 6y agoIndeed -- but it's worth noting out that GPU code is closely analogous to SIMD, anyway. (And PyTorch can be and often is run on pure CPU.)
- devwastaken 6y agoJpegs (libjpegturbo), video decode/encode (libavcodec), encryption/decryption, ZFS filesystem, any workload that does high throughput. SIMD is the next generation of computing, without it we would have very very slow computers. Technologies like HEVC don't work well without SIMD, they're designed around it. Take a look into ffmpeg and see the tremendous amount of hand written simd assembly for various platforms.
- garmaine 6y agoThose are all implemented in dedicated hardware on Apple’s chip though.
- devwastaken 6y agoAll of them? I'd need a source on that. Also how do you think these algorithms became popular in the first place? If implimenting an algorithm around SIMD didn't give proper performance then they wouldn't exist. You have to understand that current software exists because it solved a goal. If you have to first have your algorithm implimented in hardware then nobody can make anything. Without SIMD these projects simply wouldn't be able to exist. That's the hard math of it.
- viraptor 6y agoMost serious software video/audio codecs will try to use those as much as possible. For example x264 https://github.com/corecodec/x264/blob/master/common/x86/x86util.asm https://github.com/corecodec/x264/blob/master/common/x86/x86...
- Teknoman117 6y agoThis is something that I've been torn on with all of the M1 benchmarks. All of the benchmarks that are saying "the M1 is so much better than my Intel machine at video work" are all taking advantage of hardware video encode / decode blocks in the M1 (and unified memory between the GPU and video codecs). Discounting their existence is entirely unfair, as one of the whole points of Apple Silicon is to give Apple the opportunity to put whatever hardware into their computer that accelerates the use cases they envision for their computers. Dedicated hardware is way more power efficient that software implementations. However, what happens if you work in a video codec that Apple didn't build in hardware support for? Software video codecs depend heavily on SIMD instructions to be performant.
- kevingadd 6y agoIn the first place, using the hardware encoder is only feasible if the output is up to your quality/size standards and is compatible with the decoders that are going to consume your content. If your goal is to quickly render near-lossless mp4/mkv files for uploading to youtube, any regular old hardware encoder is probably fine. If your goal is to render out 6000kbps footage to store on your own CDN, the quality per bit becomes EXTREMELY IMPORTANT and suddenly it may not be feasible to use a particular hardware encoder. FWIW, NVIDIA has made significant improvements to quality for their hardware encoders in each of their last 3 generations, and you definitely saw reviewers and creatives talking about that in particular when it came to purchasing decisions. Apple's encoder is probably quite good at least, but I don't think it's meaningful to consider it for most benchmarks. The scenarios where you both are willing to use the hardware encoder and care about how fast it is are relatively few and far between - if you're just doing a zoom call all that matters is whether it can pump out 60fps and how good it looks, not whether it uses 3% cpu instead of 5%. I'd rather see quality/bitrate comparisons of their encoder with x264, not benchmarks.
- gameswithgo 6y agoa ton of the .net core libraries use simd now, ripgrep uses it, json parsing, video games
- mhh__ 6y agoAnything that does number crunching can benefit from SIMD (just look at pretty much any modern compiler output on godbolt, icache be damned). The tradeoff with using it is basically between instruction density, power (AVX-512), and latency (GPUs are seriously powerful, but getting the data going takes time and a lot of driver bullying).
- gpapilion 6y agoMemcopy. These instructions can be beneficial when leveraged providing significant speed ups for larger transfers.
- burntsushi 6y agoripgrep, and to a lesser extent, GNU grep both do. Whenever you run a query and it seems to execute very quickly, it's almost certainly because of SIMD. GNU grep will use SIMD somehow in many patterns. ripgrep uses it in even more.
- BeeOnRope 6y agoDoes GNU grep actually make explicit use of SIMD via intrinsics or assembly, or just through autovectorization and/or calling libc methods like memchr that are vectorized under the covers?
- burntsushi 6y agoYeah, I was being a bit succinct. As far as I'm aware, GNU grep has no explicit SIMD in it other than memchr through glibc. While some libc implementations utilize auto-vectorization of sorts (musl comes to mind), glibc does have Assembly implementations of memchr for several platforms that do indeed make use of SIMD explicitly. ripgrep does the same, except for Intel at least, its memchr is implemented in Rust using SIMD intrinsics explicitly. And it also has a specialized SIMD algorithm (taken from Hyperscan mostly) for dealing with multiple patterns: https://github.com/BurntSushi/aho-corasick/tree/8b479a60906d20c38796fb7f2fd212616e64844b/src/packed/teddy https://github.com/BurntSushi/aho-corasick/tree/8b479a60906d... Hyperscan takes this to a different level though. It has oodles more SIMD. I should have mentioned it in my original comment.
- BeeOnRope 6y agoThanks for the answer. I was curious mostly because I never recalled any SIMD intrinsics in GNU code (ok, probably GIMP has them, so maybe I should say GNU utilities), so that would be a first. It's interesting how much stuff leans on memchr, shame there aren't systematic wider versions taking more bytes to avoid false positives for longer literals (ignoring wmemchr): these could be nice and fast with SIMD.
- burntsushi 6y ago
- berkut 6y agoRaytracing (Ray / BVH traversal / bbox intersection, and ray primitive intersection can all be SIMD-fied fairly well (very well up to 4-wide, fairly well up to 8-wide, depending on how things are packed).
- 37ef_ced3 6y agoIf neural net inference is a small part of a larger computation, doing it locally (in cache) on the CPU (with AVX-512 instructions) can be a big win (for example, https://NN-512.com https://NN-512.com)
- gumby 6y agoMost FORTRAN code is highly vector-oriented, and many numerical systems like R need FORTRAN.
- jessehattabaugh 6y agoLies, damned lies, and benchmarks
- deleted 6y ago[deleted]
- spockz 6y agoI wonder how many use cases will be impacted. I can imagine specific use cases like video encoding switching to the built-in co-processors. Which part of usage remains that is hampered by this? Is there a killer reason/use case I should stick to amd? Also, it would probably be relatively trivial to add the 256bit instructions in the next iteration of the chip.
- temptemptemp111 6y agoIt is a huge LARP to benchmark when you "Apple customers" don't have any say in the matter. "Oh we're really gonna push them and make them compete..." Hilarious.
- vtantia 6y agoI'm not quite sure that SIMD is a relevant benchmark for comparing the processors. Wouldn't the GPU and/or neural engine take care of SIMD on the ARM Macbook?
- calaphos 6y agoYou can still benefit from AVX for short workloads, the latency of them is no more than other instructions. Running things on some accelerator (gpu, etc.) usually involves writing a specific kernel in a language subset, manually copying data and generally long latencies. Unless there is a lot of data it won't be faster. With AVX in the best case the compiler can just vectorize some loop, speeding it up 5x without any added latency or source code changes.
- __s 6y agoThere are many applications that still need the general purpose of CPUs while being vectorized See libjpeg-turbo, ffmpeg, crypto, hashing in general, ripgrep, simdjson, ... https://woboq.com/blog/utf-8-processing-using-simd.html https://woboq.com/blog/utf-8-processing-using-simd.html See also: https://www.reddit.com/r/compsci/comments/4cq0ls/when_is_simd_better_than_the_gpu https://www.reddit.com/r/compsci/comments/4cq0ls/when_is_sim... If simd was obsoleted by GPUs intel & amd wouldn't keep introducing wider simd extensions
- tbenst 6y agoSIMD and ie Nvidia WARP are not the same. Idk about Apple’s GPU, but for example there is no GPU alternative to the SQRTPD instruction (Square root of double precision). Also, when there is branch divergence across threads, CPUs still do a much better job than GPUs. Curious to think about how unified memory may change the ratio of flops/memory access when it makes sense to shift job from CPU (better for low number) to GPU (better for high ratio)
- tbenst 6y agoFor many linear algebra heavy workflows, (numpy, R, Julia, etc.) I expect that AMD and especially Intel processors with AVX-512 will crush the M1 on real-world benchmarks. But this isn’t a reflection of RISC vs CISC, and Apple could choose to add hardware acceleration for wider instructions and hopefully will in the future.
- glup 6y agoBut then again, if your workflow is linear algebra heavy, shouldn't you be doing that on a workstation or a cluster and not your little MacBook? Given you are probably doing that over Jupyter notebooks, SSH, or some cloud IDE, then the new ARM MacBooks will provide a better user experience?
- tbenst 6y agoI think we effectively agree with each other and the author. The M1 is better day-to-day processor but not a AMD/Intel killer for (edit: some) compute-heavy workflows...(yet?). Discussion more pertinent for Mac Pro, where current M1 would be worse than last gen Intel for some common workflows on those devices.
- judge2020 6y agoThe test will be the M1X Apple is apparently pushing for MBP or iMac usage[0]. 0: https://news.ycombinator.com/item?id=25225764 https://news.ycombinator.com/item?id=25225764
- sulam 6y agoI agree if you add the clarifying statement ...not an AMD/Intel killer for __some__ compute-heavy workflows... It’s clear there are other workflows which some people characterize as “compute-heavy” where the M1 is superior.
- tbenst 6y agoTotally fair, edited
- acdha 6y agoThis is a great post showing why you have to measure the specific tasks you care about rather than relying on general assumptions. Another example I remember seeing was crypto/hashing performance where you could find embedded processors competing with much faster general chips because they had dedicated instructions for those use-cases, and performance would fall off of a cliff if you used different encryption or hashing settings or an unoptimized libssl. I’d be curious how the unified memory architecture shifts the cost dynamic for GPU acceleration. There’s a fair amount of SIMD work where the cost of copying to/from the GPU is greater than the savings until you get over a particular amount of data and that threshold should be different on systems like the M1.
- calaphos 6y ago> I’d be curious how the unified memory architecture shifts the cost dynamic for GPU acceleration. Correct me if I'm wrong, but is this actually different from regular integrated graphics that have been in intel and amd chips for decades? I remember there being some initiatives from amd proposing similar offloading under the name HSA almost a decade ago. I don't think there are actually any software really using it.
- deleted 6y ago[deleted]
- uluyol 6y agoGood point. Some Intel chips have had an on-package on-die?) 128MB "L4 cache" made of DRAM. That certainly sounds a lot like the M1's integrated memory.
- addaon 6y agoOn-package, but not on-die. The GT[34]e processors used an external die with 64MB (GT3e) or 128MB (GT4e) of eDRAM.
- klelatti 6y agoI don't think it is different. For example, the OpenCL specification allows for the possibility that data doesn't need to be copied between CPU and GPU. In a recent interview (I think with the Changelog podcast) I heard an Apple engineer explain that the M1 had an advantage over previous systems in that not only did the data not need to be copied (which implies this isn't new) but also that no changes to the format of the data were needed given Apple's end to end control.
- gigatexal 6y agoAs the ARM chips proliferate we will see NEON or GPU/neural engine APIs adopted in lieu of the SIMD from the x86 side. Until Now ARM just wasn’t relevant with the ubiquity of x86 and that the x86 family of chips have been the desktop standard since the 80s of course there will be hardware that takes advantage of this. I wonder what final cut and other software suites tailored for the new Macs are doing under the covers as they seem to perform very quickly. Also this isn’t really all the relevant as cryptographic validation is required more and more on the server side of things whereas Apple doesn’t have a SKU for the server market.
- pjmlp 6y agoIt was relevant on mobile OSes, on Android via the ART JIT/AOT compiler and RenderScript runtime. On iOS via the Accelerate framework. I doubt many would bother dealing with NEON intrics directly unless in some performance critical cases, though.
- janoc 6y agoNEON is not API, it is literally the SIMD instruction set for ARM. https://developer.arm.com/architectures/instruction-sets/simd-isas/neon https://developer.arm.com/architectures/instruction-sets/sim... So x86 is certainly not going to adopt it. The GPU/neural stuff is basically nothing else but SIMD, just in slightly different guise and running on different hardware. On PC it is the difference between MMX/AVX (CPU) and shaders/CUDA/"compute" (GPU), on M1 which is all-in-one SoC it is just a different part of the CPU being used, optimized for somewhat different tasks. SIMD is only a technical term for one type of parallel computation - single instruction, multiple data. It is not some sort of Intel-specific magic technology (and the term far predates Intel's support for it, going back to vector processing on Crays and such).
- gigatexal 6y agoAhh yeah sorry API was used wrong here. I knew it’s a type of CPU instruction set. Of course NEON is specific to ARM so x86 won’t get it. I didn’t know the neural engine is basically SIMD though.
- dmmalam 6y agoI assume SVE [1]/ SVE2 [2] will be implemented in future Apple Silicon processors. Possibly along with ARMv9. [1] https://community.arm.com/developer/tools-software/hpc/b/hpc-blog/posts/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture https://community.arm.com/developer/tools-software/hpc/b/hpc... [2] https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/new-technologies-for-the-arm-a-profile-architecture https://community.arm.com/developer/ip-products/processors/b...
- onedognight 6y agoSVE is interesting because it gives you forward binary compatibility. i.e. your binary, written for a 128bit wide vector unit, will benefit directly from a newer 256bit wide unit without recompilation.
- dirtypersian 6y agoWho says they don't already support SVE; is it publicly known they support it or not? Especially if the binary doesn't have to be recompiled you'd never know whether they implemented it or not right?
- bwasti 6y agoYou can just try the instructions with an off-the-shelf assembler. They're not supported.
- andy_ppp 6y agoI’m kind of interested about what happens if you throw random opcodes at processors now!
- dirtypersian 6y agoI would guess the processor would just cause an exception/interrupt and it would just call an OS level exception/interrupt handler which would probably tell the user what the exception/interrupt was that occured; in this case an unsupported instruction.
- cannam 6y agoSeems fair. Idly speculating, if this architecture favours characteristics of higher-level languages (I'm thinking of the widely-reported measurements of primitives used in automatic memory management), relatively disfavours straight-line branchless SIMD-ready streaming algorithms, and is also shipped with a matrix-friendly neural coprocessor... could that invite a change in the types of programs that perform the best? That is, is it possible that good algorithms nicely structured and straightforwardly written in higher-level languages with good separation of concerns might actually get the most benefit? Or is this a daydream?
- lambda_obrien 6y agoApple is in a good position to create a software-hardware symbiosis to ensure their compilers work flawlessly on their hardware and are more efficient than any other combination of hardware and software. If they ensured that combo worked perfectly with the best practice for their languages, well that's a winning combo.
- lock-free 6y agoI think Apple is banking on coprocessors on their SoC to handle heavy workloads instead of general purpose SIMD. The applications that benefit enormously from SIMD outside the GPU (like ML, multimedia codecs, etc) are being migrated to proprietary function blocks interfaces through Swift frameworks, and not hand rolling optimized blocks of code in C and assembly. I would not be surprised if we see similar things added for audio DSP to support their creative software (it was alluded to in some marketing materials, haven't read much on it yet). Other applications like language parsing and compiling is likely going to be a second class citizen moving forward, since Apple doesn't care about using their machines for general purpose development regardless of how many of us buy them for being solid Unix platforms.
- pjmlp 6y agoBeing UNIX was never part of neither Apple or NeXT's culture, it was more a way to get a foot into the workstation market, and a question of survival in not closing doors. Now they are way beyond that, so they can focus on what was the soul of Mac design during the System days.
- gumby 6y ago> Being UNIX was never part of neither Apple or NeXT's culture Why do you say this? True, Mach is architecturally different from the BSD kernel but user space started out as NetBSD and its still fundamentally a POSIX system. I never worked for either company but have worked with NeXT and Apple engineering teams on projects and wouldn’t say that I was working with people who took a non-Unix orientation, especially when compared, say, to Windows. Would you not have considered AIX Unix? Or Unicos? People considered that Unix but it was more alien than the macos due to then constraints of the hardware.
- pjmlp 6y agoWhat mattered on A/UX for application developers on Apple platforms was the System APIs layer ported to run on top of X Windows integration. Likewise, anyone doing NeXT development was focused on Objective-C frameworks all the way down to driver kit. As Application developer on a NeXT, the tune was all about WebObjects, Renderman, EOF. Applications like Lotus Improv, Wingz, and those being put out by Omni Group were the meat of the kind of applications that people considered to use NeXTSTEP, not BSD command line utilities. Pretty much patent on commercials like NeXT vs Sun. https://www.youtube.com/watch?v=UGhfB-NICzg https://www.youtube.com/watch?v=UGhfB-NICzg Or Steve Jobs opinion on UNIX users, https://www.cake.co/conversations/rZXhqtP/that-time-i-had-steve-jobs-keynote-at-unix-expo https://www.cake.co/conversations/rZXhqtP/that-time-i-had-st... and later when back at Apple https://www.computerworld.com/article/2591327/apple-hopes-to--tame-unix--with-os-x.html https://www.computerworld.com/article/2591327/apple-hopes-to... AIX is definitly UNIX, because it isnt' like A/UX, NeXTSTEP, OS X or iOS, where the UNIX layer is there more to bring stuff into the platform, while the main developer stack is something else.
- deleted 6y ago[deleted]
- CodeWriter23 6y agoI think this benchmark deserves a little drill down on how the ARM v. Intel compilers implement their SIMD output. If the M1 lacks 256-but SIMD, what exactly is being measured here?
- masklinn 6y agoWhat's measured is how a SIMD-optimised routine differs between AVX and NEON, under the assumption that most of the difference would come down to the difference between 256b (AVX) and 128b (NEON) SIMD. In a previous post[0], lemire confirmed that NEON was competitive with SSE (which is also 128b) comparing older µarch (Intel's Skylake versus Apple's A12). [0] https://lemire.me/blog/2019/07/10/parsing-json-using-simd-instructions-on-the-apple-a12-processor/ https://lemire.me/blog/2019/07/10/parsing-json-using-simd-in...
- schlu 6y agoI think it is important to point out that this is the worst ARM computer Apple will ever ship. I am guessing that these laptops are nowhere near comparable in price.
- neogodless 6y agoBrand new, a 2017 15-inch Macbook Pro was $1999. The 2020 13-inch Macbook Pro is $1299 with 8GB/256GB. (A used 2017 Macbook Pro is around $500-800 on eBay.)
- The_Colonel 6y agoMy assumption is that Intel and AMD CPUs will improve in time as well.
- addaon 6y agoI'm a little bit surprised that Apple hasn't moved beyond 128-bit NEON, either with a custom 256 bit extension, or with an early implementation of SVE. This seems to be an area where vertical integration of software makes transitions easier -- getting Accelerate.framework over to something wider would have immediate pay-off, and especially at higher power budgets it seems clear from looking at the rest of the industry that somewhat wider vectors is a good perf to area trade-off.
- wmf 6y agoYou mean like the AMX instructions?
- api 6y agoThey probably don’t want to go beyond the standard. It could lead to compatibility and support headaches and accusations of “embrace extend extinguish” later. Not sure but I seem to recall the ARM licensing terms discouraging this.
- addaon 6y ago(As a side-note, can someone who has explored SVE in more detail than I comment on whether it's possible for a big.LITTLE-style implementation to use different vector widths on the big and little cores? One obvious challenge of going to wider vectors on something like the M1 is that you either pay the cost (area and power) for the capability on the small cores, or you lock threads that use those capabilities to big cores, neither of which is ideal. If you could have 128-bit SVE registers on little and 512-bit on big, it would help with that; but it's not clear to me how complex it would be to allow an SVE instruction to be interrupted and restart it on a core with a different vector width. I guess in extremis one could emulate the remainder of the instruction before restart, but eww.)
- tus88 6y agoOuch. The hive-mind will be mightily upset over this.
- dleslie 6y ago> It has allowed Apple to sell the first ARM-based laptop that is really good. The Pinebook Pro is really good. Not excellent, but really good. And seeing as I prefer FOSS, and general computing over walled gardens, it's superior to the Apple alternative.
- fastball 6y agoWhat general computing can't you do on MacOS?
- dleslie 6y agohttps://lapcatsoftware.com/articles/unsigned.html https://lapcatsoftware.com/articles/unsigned.html
- fastball 6y agoYes, untrusted software has warnings now, but can still be run. Where is MacOS falling down for general computing?
- dleslie 6y agoNot just warnings; user-hostile popups that make it unclear whether such apps can be run at all. And because Apple users have given the keys to their hardware to someone else, they get things like this happening: https://techcrunch.com/2020/11/12/macos-apps-wont-launch/ https://techcrunch.com/2020/11/12/macos-apps-wont-launch/ It will only get worse; Apple has little incentive to support general computing over a walled garden where they get a cut of every software purchase.
- alwillis 6y agoIt will only get worse; Apple has little incentive to support general computing over a walled garden where they get a cut of every software purchase. About 92% of all iOS apps on the App Store are free; pretty sure the numbers for macOS are similar: https://www.statista.com/statistics/263797/number-of-applications-for-mobile-phones/ https://www.statista.com/statistics/263797/number-of-applica...
- st3fan 6y agoWhat would be much more interesting is a comparison of Apples frameworks for numerical processing. Like Accelerate. Those do not just use SIMD but actually take advantage of all the additional things they put in their SoC. What we are looking at now is some specific benchmark for a random library that who knows how makes use of things.
- YetAnotherNick 6y agoDoes using one obscure application of SIMD even count as benchmark? It just could be that the library is specifically optimized for x86. Run something like BLAS matrix multiplication which could use the full power of SIMD in both the platforms(I don't have access to M1 macbook).
- bacon_blood 6y agoThis article has a mistake. I actually ran the benchmark, and it doesn't return a valid result on arm64 at all. The posted numbers match mine if I run it under Rosetta. Perhaps the author has been running their entire terminal in Rosetta and forgot. As I write this comment, the article's numbers are: (minify: 4.5 GB/s, validate: 5.4 GB/s). These almost exactly match my numbers under Rosetta (M1 Air, no system load): % rm -f benchmark && make && file benchmark && ./benchmark c++ -O3 -o benchmark benchmark.cpp simdjson.cpp -std=c++11 benchmark: Mach-O 64-bit executable arm64 minify : 1.02483 GB/s validate: inf GB/s % rm -f benchmark && arch -x86_64 make && file benchmark && ./benchmark c++ -O3 -o benchmark benchmark.cpp simdjson.cpp -std=c++11 benchmark: Mach-O 64-bit executable x86_64 minify : 4.44489 GB/s validate: 5.3981 GB/s Maybe this article is a testament to Rosetta instead, which is churning out numbers reasonable enough you don't suspect it's running under an emulator. Update, I re-ran with the improvements from downthread (credit messe and tedd4u): % rm -f benchmark && make && file benchmark && ./benchmark c++ -Oz -o benchmark benchmark.cpp simdjson.cpp -std=c++11 -DSIMDJSON_IMPLEMENTATION_ARM64=1 benchmark: Mach-O 64-bit executable arm64 minify : 6.7234 GB/s validate: 17.7723 GB/s Note that my version also uses a nanosecond precision timer `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` because I was trying to debug the earlier broken version. That puts Intel at 1.16x and 1.07x for this specific test, not the 1.8x and 3.5x claimed in the article. Also I took a quick glance at the generated NEON for validateUtf8 and it doesn't look very well interleaved for four execution units. I bet there's still M1 perf on the table here.
- lilactown 6y agowhat does "inf GB/s" mean in this circumstance? I can't figure out exactly how these compare yet; the minify number makes it look like native M1 underperforms Rosetta2.
- bacon_blood 6y agoThe benchmark program itself is obviously broken on ARM, as Rosetta is jitting ARM behind the scenes, so you could write a program + compiler that emitted the same ARM as Rosetta. This means it's a problem with the program and not a problem with the M1. I'm not sure what's actually wrong with it yet. Edit: messe found the issue in sibling thread
- tester756 6y ago>Yet I was criticized for making the following remark: >In some respect, the Apple M1 chip is far inferior to my older Intel processor. The Intel processor has nifty 256-bit SIMD instructions. The Apple chip has nothing of the sort as part of its main CPU. So I could easily come up with examples that make the M1 look bad. >I am not saying that the Apple M1 is not great. It is. It's sad that this needs to be written.
- deleted 6y ago[deleted]
- ksec 6y agoYes. The whole Apple M1 chip has turn up the volume of fanboyism. I think it would be better to wait a little longer for things to settle before any serious discussions.
- rsynnott 6y agoPer this thread it does seem like they were severely overstating the problem: https://news.ycombinator.com/item?id=25409535 https://news.ycombinator.com/item?id=25409535 (tl;dr, their benchmark is likely running _under rosetta_. NEON with native code is far more competitive).
- marmaduke 6y agoThe Intel MBA 2020 sports AVX512 which works well without underclocking issues. This would have been the comparison to make.
- marmaduke 6y agoIt might been a more interesting comparison to use SIMD units from the GPU given the unified memory.
- bwasti 6y agoI've found the M1's 128bit instructions to be quite fast. My M1 MacBook Air can hit 90GFlops on a single core. My 2019 16" MacBook Pro is only 1.5 times faster at 135GFlops per core, despite double the vector width. Benchmark here: https://github.com/bwasti/mac_benchmark https://github.com/bwasti/mac_benchmark If anyone has the new 2020 MBP with AVX512 I'll update the benchmark to include avx512 instructions! I'm very curious about those numbers
- beached_whale 6y agoWith my JSON library parsing directly to C++ data structures, I was seeing an M1 mini getting perf as fast as a 16" MB Pro with i9. It was quite nice to see.
- chunsj 6y agoWhy doesn't people run the simple BLAS/LAPACK benchmark for comparison? Isn't this one the benchmark for the speed of the processor?
- kristianp 6y agoIn this case, Dr Lemire is using software he co-wrote to test the performance of the M1. It makes sense that he'd be focussing on that software (Simdjson) which wrings as mich speed out of the processor as possible by using vector instructions and avoiding branches. His coauthors blog iirc is even called https://branchfree.org https://branchfree.org, to indicate the importance of avoiding branch mispredictions to keep the cpu foing quickly.
- rsynnott 6y agoSomething which I think isn’t made clear enough here is that the point of comparison is a 45W part. A comparison with a 10-15W Intel part might be more interesting.
- TinkersW 6y agoThe updated benchmark is about what I'd expect, they have similar top end SIMD capabilities given that both are effectively able to compute 512 bits of SIMD per cycle. Intel: 2x256 = 512 M1: 4x128 = 512 I'd expect Zen3 would beat them both pretty easily given that it has 4x256, as would any of the Intel chips with 2x512. Intel better be widening its execution engine, they have focused on MgHz for far too long..
- deleted 6y ago[deleted]