Hacker News new | ask | show | jobs
by skissane 610 days ago
> Apple is the only one making ARM chips fast enough to be competitive even with emulation.

My big problem is Rosetta 2 doesn’t emulate AVX which more and more software uses.

I work in an AI platform team. I’m not actually trying to do machine learning stuff under it, but I just want to start the Docker containers to test some unrelated functions on my laptop. And that happens to start Tensorflow and pgvector, even though I’m not really using either in anger in this case. And both try to use AVX, and then get a SIGILL, so those containers fail to start.

Maybe should just build Linux ARM Docker containers but trying to get some ARM CI machines to build them with (we could just use our laptops but want to do it properly)

1 comments

> My big problem is Rosetta 2 doesn’t emulate AVX which more and more software uses.

You can probably blame that on patents. Base x86-64, which includes SSE2, is old enough that all relevant patents have already expired (the x86-64 ISA documentation was first published by AMD 24 years ago, see https://web.archive.org/web/20000829042324/http://www.x86-64...). Other ISA extensions are newer, and might still be threatened by patents.

Maybe patents are involved, but there's a bigger issue too: the Apple chips don't have support for the equivalent Arm instructions (SVE/SVE2) nor wide enough vectors in their SIMD units. Any AVX/AVX2 emulation is going to be dog slow, even if it isn't encumbered by patents.
For my use case, I don’t really care much about AVX performance, since I am using it very minimally.

Using QEMU instead of Rosetta 2 gets past this, since QEMU doesn’t seem to be afraid of those patents, but it makes everything else a lot slower

Maybe, if Apple made available a plug-in API for Rosetta 2, to enable plugins to emulate additional instructions. Then some open-source plug-in could implement the missing AVX instructions, but if Intel tried to claim Apple was infringing on the AVX patent, Apple could (truthfully) say “we have nothing to do with that plug-in, we just created the API it calls”

Another approach would be if Apple open-sourced Rosetta 2, and then a community fork could implement this stuff. I doubt Apple will do that though - I think they view Rosetta 2’s superior x86 emulation as a commercial advantage over other ARM laptop vendors (such as Qualcomm’s ARM Windows systems), and they’d likely view open sourcing it as giving away that commercial advantage