Benchmarking nested do loops, MATMUL and Blas DGEMM Apple's Accelerate framework outperforms GitHub Copilot-generated BLAS Level 3 dtrsm routines on Apple M1 and M2 chips, with performance jumps at matrix sizes that are multiples of 8 attributed to the AMX matrix coprocessor, according to a benchmark by corsix. The M1 and M2 feature a matrix coprocessor, while newer chips like M4 may use the Arm SME extension. The M1 and M2 also have a matrix coprocessor a special matrix acceleration unit : GitHub - corsix/amx: Apple AMX Instruction Set · GitHub https://github.com/corsix/amx . In newer chips M4 and later? they upgraded this to the Arm SME extension https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-scalable-matrix-extension-introduction . In the past I did some benchmarking of the BLAS Level 3 dtrsm https://www.netlib.org/lapack/explore-html/d9/de5/group trsm ga7120d931d7b1a15e12d50d328799df8a.html routine; in the plot below label dtrsm is for Apple Accelerate and the rest are variants written by GitHub Copilot, some with explicit vectorization using NEON intrinsics:Accelerate is the fastest. Notice the the big jumps when the matrix size is a multiple of 8? I believe that’s the AMX extension.