6 ms·
It appears the decision was made to hardwire AVX support to "on" recently as all the hardware for Big Sur supposedly supported AVX, not noticing that Rosetta 2
by rincebrain 6y ago
It appears the decision was made to hardwire AVX support to "on" recently as all the hardware for Big Sur supposedly supported AVX, not noticing that Rosetta 2 violated this, and then the bug report(s) started coming in about precompiled binaries being broken under Rosetta 2 since that change.
So I personally find it interesting because I would not have expected Rosetta 2 to be missing AVX instructions if all the supported Big Sur hardware possessed them, and this is an interesting failure mode to watch and see how the Brew developers handle.
- als0 6y ago> I would not have expected Rosetta 2 to be missing AVX instructions AVX can’t be emulated by Rosetta due to Intel patents.
- trollian 6y agoThey're implemented by other emulation systems like bochs: https://sourceforge.net/p/bochs/news/ https://sourceforge.net/p/bochs/news/
- colejohnson66 6y agobochs is probably just too small a fish for Intel to care. But Apple is a big money maker for Intel, so they’d have an incentive to push back legally. The patents aren’t on the implementation, but the function, so I’d wager that bochs is actually infringing. But IANAL, so take it with a grain of salt.
- phire 6y agoRegardless of the patent issue, emulating AVX on the M1 (which only has 4-wide SIMD) would actually be significantly slower than forcing the x86 application to use it's SSE fallback path and emulating that.
- Diggsey 6y agoEmulating AVX via Rosetta should be just as fast as re-compiling the original without AVX support and then emulating it. Emulating larger SIMD instructions is very easy, you just use multiple smaller SIMD instructions. On the other hand, disabling AVX for all Intel machines would make those programs significantly slower, so it's clear why there is reluctance to do that...
- a-dub 6y agoplus doesn't the M1 have specialized hardware. what's the neuro-engine or whatever it is that they call it for speeding up ML? i imagine at it's core it's a bunch of instructions for doing vector operations. side bar: is there documentation for the instruction set or abi for that hardware?
- mhh__ 6y agoThe value of SIMD on a CPU these days is really a middle-ground where you value latency above throughput, so you probably would have the same trade off as getting the data to and from a GPU
- a-dub 6y agoi thought the M1 was a SoC with a unified memory architecture?
- mhh__ 6y agoThat definitely changes the calculus, but as I've mentioned in a different comment there doesn't seem to be literally any microarchitectural documentation to read, so I (don't own an M1) have nothing to go off unfortunately. I'll make a wild guess that getting data to the neural engine is still probably not quick because I assume it's some kind of statically scheduled type affair (exposed pipeline?). We literally seem to know almost nothing about it sadly. https://jobs.apple.com/en-gb/details/200205070/neural-engine-hw-architect-platform-architecture https://jobs.apple.com/en-gb/details/200205070/neural-engine... Even the job listing gives away next to nothing, other than poor English "Knowledge in compiler is a plus" ;)
- loeg 6y agoCan you elaborate on what patents, and how they prevent emulating AVX but allow emulating the rest of x86?
- colejohnson66 6y agoEvery new feature set (the many SSEs, AVXs, and others) is patented. But newer processor features (like AVX) don’t “renew” the patents on the older features. So when AVX-512 was patented, it didn’t change the expiration dates for AVX2 and prior. The base requirements for x86-64 mandate SSE2 IIRC. Those patents expired this year, so Apple was now able to release an x86-64 “emulator” without negotiating patents.
- tempay 6y agoThis leaves me wondering if Apple had waited until now for ARM macs solely because of the patent situation.
- loeg 6y agoHuh. Is AMD paying licensing fees for the privilege of implementing the AVX and AVX2 instruction sets? It seems weird and anticompetitive that patents are granted for what amounts to an API. (Do you have links or identifiers for the specific patents, by any chance?)
- colejohnson66 6y agoThe situation with AMD is a bit complicated. Basically, there was an antitrust lawsuit led by AMD years ago, and as part of the settlement, Intel and AMD would share patents to allow collaboration. I can’t recall the actual specifics though. As for patents, I don’t, but someone else here linked in the one for FMA[0]. It’s a bit more complicated than just an API, but it seems broad enough that anything implementing that API would be covered. But IANAL. [0]: https://patents.google.com/patent/US7499962 https://patents.google.com/patent/US7499962
- varispeed 6y agoCan't they rename it to ABX and switch things here and there? Or get someone to do clean room implementation of ISA specification? You can't patent an API.
- mhh__ 6y agoThe patents aren't on the API but what the API does. Like it or not they are patented https://patents.google.com/patent/US7499962 https://patents.google.com/patent/US7499962 (FMA, for example)
- xoa 6y ago>Like it or not they are patented https://patents.google.com/patent/US7499962 https://patents.google.com/patent/US7499962 (FMA, for example) Yeah, and AVX is also relatively new, intro'd in 2008 and first shipped in a chip in 2011. AVX2 wasn't until 2013. So even with R&D and patents happening years beforehand it'll still be a good long while before they expire (that FMA example being a case in point, not until end of 2026). Granted in Apple's specific case that's actually not a bad thing. Precisely because AVX is so new, many Macs supported up until the last version or two of macOS didn't have it. So AVX isn't at all a widely expected dependency for the kind of older software that may never get an ARM port and in turn most needs Rosetta 2.
- Const-me 6y agoIf FMA is patented, how comes ARM has equivalent instructions, called MLA? And GPUs have FMA as well.
- mhh__ 6y agohttps://news.ycombinator.com/item?id=14523587 https://news.ycombinator.com/item?id=14523587 Discussion of Intel patents from a few years ago
- HexagonalKitten 6y agoCan't be emulated efficiently, or at all? Has it been tested or is it based on this comment from Intel? "Emulation is not a new technology, and Transmeta was notably the last company to claim to have produced a compatible x86 processor using emulation (“code morphing”) techniques. Intel enforced patents relating to SIMD instruction set enhancements against Transmeta’s x86 implementation even though it used emulation"