Open jelmervdl opened 1 year ago
What if we have a separate binary? Would that be too bad? How is usually Apple software distributed?
Usually universal binary. You never really have to choose which chipset you have when downloading stuff. Only open source stuff makes you choose. OBS would be a popular example. So it is not unheard of.
Apple itself is moving towards shipping stripped & pre-optimised binaries through their App Store but that's all automated and not really relevant for us right now.
So, should we open an issue on cpuinfo? What do we use cpuinfo for anyways? Setting the right cmake flags? Our usecase is to compile for generic architecture...
ruy and fbgemm embed cpuinfo. I am able to compile an intel-only or arm-only version now.
My intuition now is that cpuinfo will probably need quite a bit of refactoring to support mutlicpu compilation (because they rely on cmake for defining cpu features…)
We can get rid of fbgemm since their models aren't compatible with multiple architecture... But not ruy... Maybe with onednn later..?
Maybe indeed. My suggestion right now is to just deal with it at a later stage, and distribute an Apple Silicon build separately right now.
I've been trying to make a universal binary for x86 and M1/2 hardware so we can distribute just one app for all of macOS. This issue is here for tracking findings.
Getting rid of CMAKE_BUILD_ARCH is necessary. Right now I'm stuck on cpuinfo not supporting it, because it does assume it is being built for a single architecture.
Command (and many changes to the CMake files so not entirely useful on its own):
Issues: https://github.com/loongson/cpuinfo/blob/5d5348e000f91baa9849d7b30b22fce8a77ae3da/CMakeLists.txt#L167-L169
https://github.com/loongson/cpuinfo/blob/5d5348e000f91baa9849d7b30b22fce8a77ae3da/CMakeLists.txt#L55-L57