Alternatives for compiling C++ on a Macbook Pro with Intel x86_64?

I was trying to look into the C++ code to fix a bug but couldn’t get a full compile without an error. I did try with some flags to short circuit some potentially unnecessary parts but ended up with the same errors.

DEBUG=1 USE_DISTRIBUTED=0 USE_MKLDNN=0 USE_CUDA=0 BUILD_TEST=1 USE_FBGEMM=0 USE_NNPACK=0 USE_QNNPACK=0 USE_XNNPACK=0 python setup.py develop

following this pytorch/CONTRIBUTING.md at main · pytorch/pytorch · GitHub

It also looks like x86_64 is deprecated now - PyTorch macOS x86 builds deprecation starting January 2024

So a couple of questions - has anyone recently built on Intel Macs? Do people recommend using something like Docker to do development and how’s the experience? Do people develop on bulky remote machines?

Thanks!

Hey!

We still have macos x86 CI as the moment since it was not removed yet so it should still work (at least for some versions of macos).
Compiling on your local x86 mac will take quite a bit of time I’m afraid so might not be the best experience indeed.

One alternative is to use github.dev that will use the provided devcontainer at pytorch/.devcontainer/README.md at main · pytorch/pytorch · GitHub to have an easier setup

Awesome thanks for the advice!

I’m rebuilding atm and so far so good? I’m on a 16GB ram laptop and have docker restricted to 12GB and it’s hitting it’s head on the ceiling. Might have to bump it up or if that won’t be enough, I’ll checkout Github codespaces for a remote environment.

Update: Ran OOM on my 16GB macbook. I’ll give codespaces a try the next time I try debugging a C++ bug.

Are other ppl compiling on machines with more than 16GB of RAM?

Hi,

You should reduce parallelism using MAX_JOBS= to reduce memory pressure.

1 Like
  • We do build on x86_64 Mac in CI every day
  • One can also compile for x86_64 on M1 machine by specifying CMAKE_OSX_ARCHITECTURES=x86_64
  • If your build fails for latest release (2.1 at the time of writing, 2.2 soon), please create an issue against PyTorch, as it should still work
1 Like

Got it working - thanks yall!