TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Apple AMX instruction set (M1/M2 matrix coprocessor)

210 pointsby rostayobover 2 years ago

9 comments

stephc_int13over 2 years ago
Knowing the history of Apple an open standard and given their success with their implementation of the ARM64 ISA, it is unfortunately highly probable that they will follow the proprietary route once again.<p>Indeed, they are already doing it, we&#x27;re lucky they weren&#x27;t in a dominant position when TCP&#x2F;IP or HTML were invented.
评论 #32725675 未加载
评论 #32724429 未加载
评论 #32731335 未加载
评论 #32726414 未加载
评论 #32728708 未加载
评论 #32726937 未加载
dan-robertsonover 2 years ago
Maybe I’m just slow but it wasn’t immediately obvious to me how to use this for matrix multiplication. Let me now try to explain.<p>Suppose we have some matrices we would like to multiply, a_ok and b_ij (and let’s say their sizes line up with the hardware because I think those details aren’t so relevant).<p>Their product is<p><pre><code> c_ik = a_ij b_jk = sum(a_ij * b_jk for all j). </code></pre> The hardware lets us cheaply compute and accumulate an outer product (see picture in OP):<p><pre><code> r_ij = r’_ij + p_i * q_j </code></pre> Now start with r = 0 and accumulate:<p><pre><code> r_ik = a_i1 * b1k + a_i2 * b2k + ... + a_in * b_nk = c_ik </code></pre> Each row corresponds to one AMX op on all the cells of the matrix.<p>Writing it out like this it seems quite straightforward. I think I was caught up on thinking about the per-cell computation too much. When computing based on cells in the output, you take a row from the left hand side and dot it with a column from the right hand side (n<i>n dot products). Here, we take a </i>column* from the left hand side and a <i>row</i> from the left hand side and outer product them (n outer products) and add up the result. Perhaps this is partly a victory for this kind of symbolic index notation. I think this would all be much less obvious if I wrote it all out as a sum of outer products with eg the tensor product symbol.
16890cover 2 years ago
So what software actually uses this &#x2F; what compiler supports this if it&#x27;s neither supported nor documented by Apple?
评论 #32722961 未加载
评论 #32723002 未加载
评论 #32723114 未加载
评论 #32722878 未加载
sufiyanover 2 years ago
I don’t get why other chip manufacturers don’t go this same route. For example AVX is done on the same core that also supports integer math. Many companies have a separate GPU but AVX seems to always come prepackaged.
评论 #32726598 未加载
评论 #32729510 未加载
ladyanita22over 2 years ago
Which compiler would be required for this (<a href="https:&#x2F;&#x2F;github.com&#x2F;corsix&#x2F;amx&#x2F;blob&#x2F;main&#x2F;aarch64.h" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;corsix&#x2F;amx&#x2F;blob&#x2F;main&#x2F;aarch64.h</a>)?<p>I understand the limitation is not at the OS side, as nothing can be done there, but at the compiler-side (I mean that the Apple-supplied compiler doesn&#x27;t compile against the AMX instruction set, so you&#x27;d need a compatible one that, I understand, doesn&#x27;t exist).<p>Or is it just undocumented and you can actually get it to work with a Standard xcode and macOS installation given the headers provided?
评论 #32725604 未加载
评论 #32725504 未加载
sabootover 2 years ago
Is there a comparison with other fast cpu methods of matrix multiplication?
评论 #32723215 未加载
评论 #32724872 未加载
评论 #32723160 未加载
评论 #32724198 未加载
coder543over 2 years ago
Doesn&#x27;t M2 add support for SVE2 as well?
评论 #32725218 未加载
评论 #32725256 未加载
zeristorover 2 years ago
Is this a repost the other day, I thought that was too good have been missed out.<p>Also I’m keen to see if this 60Gb.a-1 near field wireless data link for Apple Watches for diagnosis will be able to be used in some sort of MagSafe&#x2F;usb for iPhones.
评论 #32725878 未加载
评论 #32725903 未加载
scarface74over 2 years ago
What is the “non proprietary” alternative and why should Apple or it’s users be forced to wait on consensus?<p>This is the same reason that Apple wasn’t saddled with the horrible PC “standards” before USB became ubiquitous.<p>Not to mention even today, Bluetooth is a shit show outside of the Apple ecosystem as far as handoff an ease of pairing.
评论 #32723824 未加载
评论 #32723545 未加载
评论 #32723744 未加载
评论 #32724373 未加载
评论 #32730323 未加载
评论 #32726101 未加载
评论 #32723652 未加载
评论 #32724078 未加载