M1 Apple Silicon for Chess?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: M1 Apple Silicon for Chess?

Post by Milos »

Ras wrote: Tue Nov 24, 2020 6:04 pm
Milos wrote: Tue Nov 24, 2020 5:35 pmThat depends on which 4000U series CPU you take into comparison.
4900U will almost certainly blow M1 out of the water.
I don't think so, even if the 4900U were not made of pure unobtanium. Geekbench 5 lists the M1 around 7500 in multicore. The fastest 4800U samples are around 7700 (generally rather in the 5000s or 6000s). It depends a lot on what RAM the machine is using (anything from DDR4-2666 to LPDDR4-4266), and the configured cTDP which can be 25W. The 4900U has only 100MHz more boost clock, 4.3GHz instead of 4.2GHz, but the base clock is the same.
Geekbench has relevance on chess performance specially for NNUE (i.e. SIMD instructions) as tropical rain forests have to polar bears population.
Plus Apple is known to hack Geekbench performance for marketing purposes. Performance in real life tasks is nowhere near as in those synthetic benchmarks.
Jhoravi
Posts: 291
Joined: Wed May 08, 2013 6:49 am

Re: M1 Apple Silicon for Chess?

Post by Jhoravi »

But Apple M1 has neural engine processors. Maybe NNUE can be optimized for it?
George Sobala
Posts: 44
Joined: Sat Feb 03, 2018 2:42 pm
Location: Yorkshire, England

Re: M1 Apple Silicon for Chess?

Post by George Sobala »

Benchmarks on a MacBook Air 16GB 8-core GPU

Stockfish compiled for M1 Apple Silicon, commit f9595828eb7e5e970b0be3ee5f84ddd726845523 Wed 11 Nov

Code: Select all

bench	2408119
bench 64 1 20	2270034
bench 64 2 20	4503092
bench 64 4 20	9069926
bench 64 6 20	10820178
bench 64 8 20	12438598
Cfish compiled for M1 Apple Silicon, commit 6193ed1c3809cb4b71ad8f630fa4f52160390fb6 Sun 15 Nov

Code: Select all

bench	2844055
bench 64 1 20	2614400
bench 64 2 20	5232224
bench 64 4 20	10152288
bench 64 6 20	12388337
bench 64 8 20	14935531
dragon-ox running under Rosetta-2

Code: Select all

command  nodes  sec      nps
bench 1	1915866	4.80	399139
bench 2	3653649	4.70	777372
bench 4	5690302	3.36	1693542
lc0, compiled for M1 running on CPU using Apple's Accelerate framework, output of benchmark first position only:

Code: Select all

--backend=blas --weights=J92-330	 97
--backend=blas --weights=T70net-703810   1703
lc0, compiled for M1 running on GPU using OpenCL, output of benchmark first position only:

Code: Select all

--backend=opencl --weights=J92-330	   104
--backend=opencl --weights=T70net-703810   3431
Jhoravi
Posts: 291
Joined: Wed May 08, 2013 6:49 am

Re: M1 Apple Silicon for Chess?

Post by Jhoravi »

George Sobala wrote: Wed Nov 25, 2020 8:00 am Benchmarks on a MacBook Air 16GB 8-core GPU

Stockfish compiled for M1 Apple Silicon, commit f9595828eb7e5e970b0be3ee5f84ddd726845523 Wed 11 Nov

Code: Select all

bench	2408119
bench 64 1 20	2270034
bench 64 2 20	4503092
bench 64 4 20	9069926
bench 64 6 20	10820178
bench 64 8 20	12438598
Thank you George! Is that the NNUE version of SF running at 12M NPS on 8 cores?
George Sobala
Posts: 44
Joined: Sat Feb 03, 2018 2:42 pm
Location: Yorkshire, England

Re: M1 Apple Silicon for Chess?

Post by George Sobala »

Its what you get by running bench from the command line, which is classical and (hybrid) NNUE on alternate positions.

stockfish bench 64 8 20 default depth NNUE gives 9818973 (8 cores using just hybrid NNUE)

stockfish bench 64 8 20 default depth classical gives 16097762 which is as fast as my 8-core Xeon iMac Pro
George Sobala
Posts: 44
Joined: Sat Feb 03, 2018 2:42 pm
Location: Yorkshire, England

Re: M1 Apple Silicon for Chess?

Post by George Sobala »

Comparison of Stockfish and Cfish running on 8 cores, classical v NNUE, on M1 and iMac Pro Xeon W

run using

stockfish|cfish 64 8 20 default depth classical|NNUE

Code: Select all

		        Stockfish	Cfish
M1	classical	16319718	17118388
M1	NNUE	        10100445	12759621
Xeon W	classical	16900088	17929299
Xeon W	NNUE	        13631405	14191552
iMac Pro compile options:

Code: Select all

george@Georges-iMac-Pro-2 ~ % stockfish 
Stockfish 141120 by the Stockfish developers (see AUTHORS file)
compiler

Compiled by g++ (GNUC) 10.2.0 on Apple
Compilation settings include:  64bit AVX512 BMI2 AVX2 SSE41 SSSE3 SSE2 POPCNT
__VERSION__ macro expands to: 10.2.0

quit
george@Georges-iMac-Pro-2 ~ % cfish
Cfish 141120 64 BMI2 by Syzygy based on Stockfish
compiler

Compiled by gcc (GNUC) 10.2.0 on Apple
Compilation settings include: 64bit AVX512 BMI2 AVX2 SSE41 SSSE3 SSE2 POPCNT
__VERSION__ macro expands to: 10.2.0

quit
twobeer
Posts: 20
Joined: Sat Feb 22, 2020 6:43 pm
Full name: Leif Aronsson

Re: M1 Apple Silicon for Chess?

Post by twobeer »

Pretty lackluster performance for a brand new 1000+ usd computer 2020 :-(
You can get a new i7-gen 10 (with avx support) Nvidia discrete graphics, touch-screen etc. with 16GB.ram for less than an Air M1 8GB on black-friday, that can also run most versions of Linux, windows (and even hackintosh)...
Lets hope Apple does better with M2.

P.S. comparing with Apples own even more underperforming/overpriced Macs seems pretty useless, at least from a chess perspective :-)
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: M1 Apple Silicon for Chess?

Post by Milos »

George Sobala wrote: Wed Nov 25, 2020 10:02 am Comparison of Stockfish and Cfish running on 8 cores, classical v NNUE, on M1 and iMac Pro Xeon W

run using

stockfish|cfish 64 8 20 default depth classical|NNUE

Code: Select all

		        Stockfish	Cfish
M1	classical	16319718	17118388
M1	NNUE	        10100445	12759621
Xeon W	classical	16900088	17929299
Xeon W	NNUE	        13631405	14191552
Wow, that's even worse than what I predicted. That is around 6.5Mnps from a starting position for current SF-NNUE-dev and 10.5Mnps for SF classical.
Btw. I get 13013186 and 16423498 for NNUE and classical bench receptively on E5-2689 8 core Xeon CPU (with HT on) that is almost 9 years old.
So basically one can expect almost 2x better SF-NNUE numbers on AMD 4900U than on M1 even with HT off. With HT on, 4900U should be around 3x better.
So much about how great M1 chip is :lol:.
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: M1 Apple Silicon for Chess?

Post by Ras »

twobeer wrote: Wed Nov 25, 2020 5:37 pmPretty lackluster performance for a brand new 1000+ usd computer 2020 :-(
People who are after maximum performance shouldn't be buying a device designed for maximum battery life in the first place.
Rasmus Althoff
https://www.ct800.net
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: M1 Apple Silicon for Chess?

Post by Milos »

Ras wrote: Wed Nov 25, 2020 8:35 pm
twobeer wrote: Wed Nov 25, 2020 5:37 pmPretty lackluster performance for a brand new 1000+ usd computer 2020 :-(
People who are after maximum performance shouldn't be buying a device designed for maximum battery life in the first place.
Yeah right, ppl who actually need the laptop for work, should not buy a tablet with a keyboard.