+1 vote
asked by (140 points)

Hello,

Does the iTensor C++ version runs without any issue with Apple's new M1 processor? Or is there any possible decrease in performance?

Thank you!
Jun

1 Answer

+1 vote
answered by (70.1k points)

Hi Jun,
Thanks for the interesting question. So I just tried the C++ version of ITensor on a Macbook Air with the M1 processor, and it was a smooth experience. I just cloned ITensor from Github, and then used the options.mk.sample file provided as the template for options.mk. The only change I needed to make was to use clang as the C++ compiler, rather than g++. Otherwise I got an error about the -fconcepts flag not being recognized. I did not try to install MKL and build ITensor against that; it would be an interesting thing to try and important to compare the speed to Apple's default "vecLib" framework (default BLAS provided by MacOS).

The performance was very good. The speed I got running the exthubbard sample code was comparable to a workstation at our office that has a 24-core, 3.4 GHz Xeon chip, whereas from what I have read, the M1 has 8 3.2 GHz cores. It was more than two times faster than my Intel Macbook Pro which has a 2.9 GHz chip!

I also installed Julia and the Julia version of ITensor, ITensors.jl, without any issue. That surprised me because I had read that Julia was not yet working for the M1, so perhaps it is using the Rosetta compatibility layer? Also I was able to install the MKL Julia package which we have found significantly speeds up ITensors.jl on Intel chips. It would be interesting to compare Julia with and without MKL on the M1 chip.

Best regards,
Miles

commented by (100 points)
It is happing when I try to run the file myappname.cc from tutorial/project_tamplate. Or even when trying to run Hello_ITensor.cpp.
commented by (70.1k points)
I see –  did you adjust the LIBRARY_DIR variable inside the Makefile? Does it point at the correct directory where you placed the ITensor library?
commented by (100 points)
Yes, I did.

LIBRARY_DIR=/Users/myfolder/itensor

Should I change here too:
include $(LIBRARY_DIR)/this_dir.mk
include $(LIBRARY_DIR)/options.mk
commented by (70.1k points)
Let's discuss this more via email – I think I will need to ask you more questions and that will be quicker.
commented by (100 points)
Ok, no problem. Thanks.
Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.

Categories

...