Universal binaries for libtorch Mac?

With Apple M1 machines now available since November, is there any plan to provide universal binaries (x86_64+ARM) for libtorch Mac ? Hopefully starting with libtorch 1.9.0 ?

thanks !


If you try to install from nightly (and 1.9 when it will be out) from a arm python on mac, you will see that you already get an arm binary :smiley:
We don’t plan to do a universal binary right now though. It will be two independent binaries that pip/conda will automatically choose for you.

Does that work for you?

Hi @albanD that’s good to know ! Although, while it’s certainly fine for PyTorch (the python framework), it’s more an issue regarding libtorch (the c++ library, which was my primary concern, in particular because it’s embedded into consumer softwares).
I have a macOS/Windows software which uses libtorch for inference. I’m planning to port it to x86_64+ARM M1 by the end of the year; however it entirely depends if libtorch is also available in that format as well.

If universal binary is not available for libtorch, it’d be nice to at least have libtorch x86_64 and libtorch ARM M1 as two downloads, which I can then probably stitch into an universal binary library.

I am not sure we have an arm libtorch yet indeed.

cc @malfet

  • Do we have a convenient way for users to create universal binaries (both python and libtorch)? (even if we don’t distribute them) Or they would have to modify the build by hand?
  • Do we have an arm libtorch?