LC0 For Android!!! History Made!!

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
jp
Posts: 754
Joined: Mon Apr 23, 2018 5:54 am

Re: LC0 For Android!!! History Made!!

Post by jp » Sat May 25, 2019 4:54 am

Nay Lin Tun wrote:
Fri May 24, 2019 10:20 am
jp wrote:
Fri May 24, 2019 9:22 am
Nay Lin Tun wrote:
Fri May 24, 2019 9:07 am
I downloaded 11258 112x8 SE net which is the highest in the list.

This is 2 min bullet on my Galaxy S10+
Leela played like random. :(
Does it show how many nodes per move it's calculating?
Approx 200knps. I am using small net.
I don't know why it was playing quasi-randomly in your game. It should be able to play normal-looking, even if not extremely strong, moves with very few nodes per move.

User avatar
abik
Posts: 740
Joined: Fri Dec 01, 2006 9:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik
Contact:

Re: LC0 For Android!!! History Made!!

Post by abik » Sat May 25, 2019 6:47 am

abik wrote:
Fri May 24, 2019 9:28 pm
Thank you for those data points. I am now running a 5 minutes for 40 moves gauntlet between LC0 and some other Android engines. I will post the results when available.
Here are the results of the gauntlet, using 11258-48x5-se.pb weights file, 40 moves in 5 minutes, 10 games from random opening book.

Code: Select all

Chess for Android Gauntlet
Lc0 v0.22.0-dev   - Komodo 11.3.1 64-bit      2.0 - 8.0    +2/-8/=0    20.00%
Lc0 v0.22.0-dev   - DiscoCheck 5.2.1          4.5 - 5.5    +4/-5/=1    45.00%
Lc0 v0.22.0-dev   - Cinnamon 1.2b             8.0 - 2.0    +8/-2/=0    80.00%
Lc0 v0.22.0-dev   - BikJump v2.5 (32-bit)     8.5 - 1.5    +8/-1/=1    85.00%

User avatar
Laskos
Posts: 9414
Joined: Wed Jul 26, 2006 8:21 pm
Full name: Kai Laskos

Re: LC0 For Android!!! History Made!!

Post by Laskos » Sat May 25, 2019 7:58 am

abik wrote:
Sat May 25, 2019 6:47 am
abik wrote:
Fri May 24, 2019 9:28 pm
Thank you for those data points. I am now running a 5 minutes for 40 moves gauntlet between LC0 and some other Android engines. I will post the results when available.
Here are the results of the gauntlet, using 11258-48x5-se.pb weights file, 40 moves in 5 minutes, 10 games from random opening book.

Code: Select all

Chess for Android Gauntlet
Lc0 v0.22.0-dev   - Komodo 11.3.1 64-bit      2.0 - 8.0    +2/-8/=0    20.00%
Lc0 v0.22.0-dev   - DiscoCheck 5.2.1          4.5 - 5.5    +4/-5/=1    45.00%
Lc0 v0.22.0-dev   - Cinnamon 1.2b             8.0 - 2.0    +8/-2/=0    80.00%
Lc0 v0.22.0-dev   - BikJump v2.5 (32-bit)     8.5 - 1.5    +8/-1/=1    85.00%
Thanks. How many NPS you get with Lc0 after 10s from starting position? I get around 400 on 4 cores. Were the regular emgines on one core or more? It seems your FIDE rating will be in 2800 ballpark. I have at 10s/move with a tweaked power consumption (strong 4 cores used almost always) Lc0 beating again BikJump 9:1 and losing to Ethereal 9.00 again with 2:8. This puts it in 2600 FIDE ballpark. With these smartphones it's hard to get reliable results, the core usage is moody depending on temperature, and throttling is an issue in my case.

Ferdy
Posts: 4079
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: LC0 For Android!!! History Made!!

Post by Ferdy » Sat May 25, 2019 8:05 am

petero2 wrote:
Fri May 24, 2019 10:19 pm
Ferdy wrote:
Fri May 24, 2019 5:25 am
Tried the 64bit compile and it worked.
...
Weak at tactics but plays an opening as if it is using an opening book.
...
Tried to install it at different gui.
1. Droidfish, ok
DroidFish has an old optimization that makes it not send the complete game history to the chess engine. Moves in the history that cannot affect the game theoretical value of the current game are not sent. This is bad in the lc0 case since it will cause the history planes to not get set up correctly.

This optimization is very old and made sense at a time when smart phones were a lot slower than today and when Android did not even JIT-compile the bytecode. With modern devices this optimization is likely no longer useful.
Perhaps history no longer have significant impact on the strength as there is even an option

Code: Select all

option name HistoryFill type combo default fen_only var no var fen_only var always
whose default is fen_only.

BTW is it possible to run different engine match in Droidfish? AFAIK it can only do same engine match.

flither
Posts: 16
Joined: Thu Aug 02, 2018 9:16 pm
Full name: Raf Levsky

Re: LC0 For Android!!! History Made!!

Post by flither » Sat May 25, 2019 10:16 am

Laskos wrote:
Sat May 25, 2019 7:58 am
Thanks. How many NPS you get with Lc0 after 10s from starting position? I get around 400 on 4 cores. Were the regular emgines on one core or more? It seems your FIDE rating will be in 2800 ballpark. I have at 10s/move with a tweaked power consumption (strong 4 cores used almost always) Lc0 beating again BikJump 9:1 and losing to Ethereal 9.00 again with 2:8. This puts it in 2600 FIDE ballpark. With these smartphones it's hard to get reliable results, the core usage is moody depending on temperature, and throttling is an issue in my case.
Using 48x5 net I got around 1000-2500 nodes on 8 cores (Xiaomi Mi 6, Snap 835). But I'm running custom AEX 6.5 Pie ROM, which is having very useful Kernel profiles (set to Performance) and Thermal control profiles (set to performance too). I'm not sure if vanilla roms have these options.
This gives quite steady NPS without switching off cores for long time (only with occasional short dips), but CPU is hovering around 75°C which is killing battery fast.

petero2
Posts: 581
Joined: Mon Apr 19, 2010 5:07 pm
Location: Sweden
Contact:

Re: LC0 For Android!!! History Made!!

Post by petero2 » Sat May 25, 2019 7:29 pm

Ferdy wrote:
Sat May 25, 2019 8:05 am
petero2 wrote:
Fri May 24, 2019 10:19 pm
Ferdy wrote:
Fri May 24, 2019 5:25 am
Tried the 64bit compile and it worked.
...
Weak at tactics but plays an opening as if it is using an opening book.
...
Tried to install it at different gui.
1. Droidfish, ok
DroidFish has an old optimization that makes it not send the complete game history to the chess engine. Moves in the history that cannot affect the game theoretical value of the current game are not sent. This is bad in the lc0 case since it will cause the history planes to not get set up correctly.

This optimization is very old and made sense at a time when smart phones were a lot slower than today and when Android did not even JIT-compile the bytecode. With modern devices this optimization is likely no longer useful.
Perhaps history no longer have significant impact on the strength as there is even an option

Code: Select all

option name HistoryFill type combo default fen_only var no var fen_only var always
whose default is fen_only.
I don't know about that but I have fixed this in DroidFish now. It is included in the current development version: DroidFish.apk
Ferdy wrote:
Sat May 25, 2019 8:05 am
BTW is it possible to run different engine match in Droidfish? AFAIK it can only do same engine match.
No, not in the current version. It can only run one engine at a time. This has been requested by several people though, so this might be the next big thing I will implement in DroidFish.

supersharp77
Posts: 746
Joined: Sat Jul 05, 2014 5:54 am
Location: Southwest USA

Re: LC0 For Android!!! History Made!!

Post by supersharp77 » Sat May 25, 2019 8:57 pm

I thought this might be a problem...none of the LC0 Arm7 compiles are working for me in chess for android or Droidfish
most/all of the success stories are with Arm8 compiles.... :wink: :cry:

Ferdy
Posts: 4079
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: LC0 For Android!!! History Made!!

Post by Ferdy » Sun May 26, 2019 4:18 am

abik wrote:
Fri May 24, 2019 5:18 pm
Ferdy wrote:
Fri May 24, 2019 5:25 am
2. Chess for android, not ok
Actually you can run LC0 in Chess for Android too with an extra setup step.
  • Copy lc0 binary and weights files to /sdcard
  • Install engine from SD card on lc0
  • Install engine from SD card on weights file (not intuitive, but this puts file in right place)
  • Import engine lc0
After this you can play lc0. The auto-discover default will find the weights file in the same directory.
Tried to setup two lc0 engine versions but with different weight files.
1. Create dir 16x2 which contains lc016x2 bin and w16x2 weight files
2. Create dir 48x5 which contains lc048x5 bin and w48x5 weight files

bin files lc016x2 and lc048x5 are the same only the filenames are different.

3. Install and import

Created a tournament but the recorded game has the same engine name Lc0 v0.22.0-dev.

[Event "Chess for Android Tournament"]
[Site "United States"]
[Date "2019.05.26"]
[Round "1"]
[White "Lc0 v0.22.0-dev"]
[WhiteElo "-"]
[Black "Lc0 v0.22.0-dev"]
[BlackElo "-"]
[Result "0-1"]
[PlyCount "104"]
[TimeControl "180+2"]
[Device "Lenovo TB-7504X"]

1. d4 {opening reply 0.001} Nf6 {opening reply 0.02}
2. c4 {opening reply 0.0} c5 {opening reply 0.003}
3. d5 {opening reply 0.008} e5 {opening reply 0.001}
4. Nc3 {opening reply 0.001} d6 {opening reply 0.0}
5. e4 {[4/6]35/f8e7 6.519} Be7 {[4/7]-34/f1e2 6.566}
6. Be2 {[4/7]33/e8g8 5.922} O-O {[4/7]-30/g1f3 5.957}
7. Nf3 {[4/9]31/f6e8 5.91} Ne8 {[4/9]-25/e1g1 5.955}
8. h3 {[5/9]29/f7f5 5.909} f5 {[5/11]-28/e4f5 5.59}
9. exf5 {[5/10]36/c8f5 5.154} Bxf5 {[5/10]-32/g2g4 4.431}
10. Bd3 {[5/9]41/f5d3 6.62} Bxd3 {[5/10]-41/d1d3 7.759}
11. Qxd3 {[5/10]42/b8d7 4.49} Na6 {[4/9]-32/e1g1 5.95}
12. O-O {[5/9]47/d8d7 7.176} Qd7 {[4/8]-42/f3g5 5.947}
13. Ng5 {[5/10]45/e7g5 5.58} Bxg5 {[6/10]-38/c1g5 5.99}
14. Bxg5 {[6/10]40/a6b4 4.563} Nb4 {[5/10]-35/d3e2 5.608}
15. Qe2 {[6/10]44/h7h6 6.777} h6 {[5/10]-38/g5h4 6.192}
16. Bh4 {[5/11]48/d7f5 5.699} Rf4 {[5/10]-47/h4g3 6.014}
17. Bg3 {[6/12]62/f4d4 4.951} Rd4 {[5/10]-54/f2f4 5.274}
18. f4 {[6/10]59/e5f4 7.384} exf4 {[6/11]-36/f1f4 5.871}
19. Rxf4 {[6/10]41/e8f6 6.476} Nf6 {[6/11]-29/e2e6 5.078}
20. Raf1 {[6/10]24/a8e8 5.952} Re8 {[6/11]-22/e2f3 6.105}
21. Qf3 {[6/10]44/d4f4 4.79} Rd3 {[7/13]-23/f3f2 5.58}
22. Qf2 {[7/11]41/d3e3 6.069} Rde3 {[6/12]-18/f4f3 5.875}
23. Rf3 {[6/11]42/e3f3 4.875} Nd3 {[9/15]-21/f2e3 6.408}
24. Qxe3 {[8/15]56/e8e3 6.879} Rxe3 {[8/13]-34/f3e3 4.565}
25. Rxe3 {[7/12]44/d3b2 4.267} Nxb2 {[7/13]-3/c3e4 4.871}
26. Ne4 {[6/12]15/f6e8 6.689} Nh5 {[6/14]40/e3c3 7.276}
27. Rc3 {[5/13]-2/h5g3 7.676} Qe7 {[6/13]104/f1e1 6.206}
28. Re1 {[6/10]-134/h5g3 5.881} Nxg3 {[6/12]122/c3g3 5.454}
29. Rxg3 {[6/11]-82/b2c4 4.43} Qe5 {[6/10]128/g3b3 7.631}
30. Rb3 {[5/9]-99/b7b6 7.306} b6 {[6/11]145/b3b2 6.561}
31. Ra3 {[5/8]-118/b2c4 5.728} a5 {[5/9]194/a3c3 5.836}
32. Rc3 {[5/8]-192/e5d4 5.931} Qd4+ {[6/9]229/g1h1 4.698}
33. Kh1 {[5/9]-167/b2c4 5.826} Nxc4 {[5/9]219/c3g3 5.319}
34. Rg3 {[4/8]-158/b6b5 5.172} b5 {[5/9]228/g3g6 5.655}
35. Rg6 {[5/9]-177/g8h7 6.387} Kh7 {[5/10]211/g6e6 6.81}
36. Re6 {[5/11]-176/d4d5 5.731} b4 {[5/10]227/e6e7 6.459}
37. Ng3 {[4/8]-190/d4f2 5.569} Qf2 {[4/7]318/h1h2 6.109}
38. Kh2 {[4/8]-208/f2a2 5.713} a4 {[4/8]238/e1e2 5.662}
39. R1e2 {[4/8]-232/f2d4 5.591} Qd4 {[5/10]270/g3f5 5.339}
40. Nf5 {[5/8]-300/d4f4 5.505} Qf4+ {[5/9]252/f5g3 5.715}
41. Ng3 {[5/9]-248/c4d2 4.963} Nd2 {[5/10]442/e2e4 4.327}
42. Re7 {[5/10]-456/d2f1 5.764} Nf1+ {[6/11]710/h2g1 5.533}
43. Kg1 {[5/10]-570/f1g3 4.573} Nxg3 {[5/9]938/e2f2 5.93}
44. Rf2 {[5/9]-733/f4d4 5.659} Qd4 {[5/8]921/e7e8 5.143}
45. Rf7 {[4/8]-929/g3e4 5.037} b3 {[4/8]1030/a2b3 4.943}
46. axb3 {[3/7]-959/a4b3 4.83} axb3 {[4/6]989/f7f3 4.796}
47. Kh2 {[4/6]-960/g3e4 4.686} Ne4 {[3/6]884/f2f6 4.628}
48. R2f6 {[3/6]-878/e4f6 4.516} Nxf6 {[4/6]1173/f7f6 4.456}
49. Rxg7+ {[3/6]-1031/h7g7 4.35} Kxg7 {[3/4]1237/h2g3 4.275}
50. Kg3 {[5/8]-1182/b3b2 4.179} Qe3+ {[3/4]1870/g3h2 4.118}
51. Kh2 {[3/9]-1177/e3e5 4.015} Ng4+ {[3/8]5881/h2h1 3.926}
52. Kh1 {[2/4]-12800/e3e1 3.841} Qe1# 0-1

Is there a way in the app such that the engine name in the pgn headers will be different?

In Acid Ape Chess app engine names can be renamed so its resulting white/black tag values in the game are different. This app lacks tournament mode where you can setup for more than 1 game, but it can do a match between engine for 1 game at a time.

[Event "3+2 engine duel"]
[Site "?"]
[Date "2019.05.24"]
[Round "?"]
[White "Lc0 v0.22.0-dev w11258-48x5"]
[Black "Lc0 v0.22.0-dev w11258-64x6"]
[Result "1-0"]
[WhiteElo "3049"]
[BlackElo "3049"]
[TimeControl "3+2"]
[Time "17:42:41"]
[AacWhitePlayerType "Engine"]
[AacBlackPlayerType "Engine"]
[AacIsRated "0"]
[AacDuration "05:59.085"]

1. e4 d6 {[%clk 03:01]} 2. d4 {[%clk 03:01]} g6 {[%clk 03:02]} 3. c4 {[%clk 03:02]} Bg7 {[%clk 03:03]} 4. Nf3 {[%clk 03:03]} Nf6 {[%clk 02:58]} 5. Nc3 {[%clk 03:04]} O-O {[%clk 03:00]} 6. h3 {[%clk 03:06]} e5 {[%clk 03:01]} 7. d5 {[%clk 03:07]} a5 {[%clk 03:02]} 8. Be3 {[%clk 03:05]} Na6 {[%clk 03:00]} 9. Nd2 {[%clk 03:02]} Nd7 {[%clk 02:58]} 10. g4 {[%clk 03:00]} Ndc5 {[%clk 02:55]} 11. h4 {[%clk 02:58]} f5 {[%clk 02:53]} 12. gxf5 {[%clk 02:55]} gxf5 {[%clk 02:51]} 13. Rg1 {[%clk 02:53]} f4 {[%clk 02:48]} 14. Bxc5 {[%clk 02:51]} Nxc5 {[%clk 02:46]} 15. Qh5 {[%clk 02:49]} Qf6 {[%clk 02:43]} 16. O-O-O {[%clk 02:46]} Bd7 {[%clk 02:40]} 17. Nf3 {[%clk 02:43]} Be8 {[%clk 02:38]} 18. Qg4 {[%clk 02:40]} Kh8 {[%clk 02:35]} 19. Ng5 {[%clk 02:37]} Bh6 {[%clk 02:32]} 20. Ne6 {[%clk 02:34]} Nxe6 {[%clk 02:29]} 21. dxe6 {[%clk 02:32]} Bc6 {[%clk 02:26]} 22. Bh3 {[%clk 02:30]} f3+ {[%clk 02:23]} 23. Kb1 {[%clk 02:28]} Rg8 {[%clk 02:20]} 24. Qh5 {[%clk 02:25]} Raf8 {[%clk 02:17]} 25. Nd5 {[%clk 02:20]} Bxd5 {[%clk 02:14]} 26. cxd5 {[%clk 02:18]} a4 {[%clk 02:11]} 27. Bf5 {[%clk 02:15]} Rg2 {[%clk 02:07]} 28. Qxf3 {[%clk 02:11]} Rh2 {[%clk 02:04]} 29. Qc3 {[%clk 02:08]} Qe7 {[%clk 02:01]} 30. Rdf1 {[%clk 02:04]} c6 {[%clk 01:57]} 31. dxc6 {[%clk 02:01]} bxc6 {[%clk 01:54]} 32. Qxc6 {[%clk 01:58]} a3 {[%clk 01:51]} 33. Qd7 {[%clk 01:55]} Re8 {[%clk 01:47]} 34. Qxe7 {[%clk 01:51]} Rxe7 {[%clk 01:44]} 35. bxa3 {[%clk 01:47]} Rb7+ {[%clk 01:40]} 36. Kc2 {[%clk 01:43]} Rc7+ {[%clk 01:36]} 37. Kd3 {[%clk 01:38]} Rxh4 {[%clk 01:32]} 38. Rb1 {[%clk 01:35]} Bf8 {[%clk 01:28]} 39. Rb8 {[%clk 01:31]} Rh3+ {[%clk 01:24]} 40. Kd2 {[%clk 01:25]} Rh6 {[%clk 01:19]} 41. Rxf8+ {[%clk 01:23]} 1-0

User avatar
abik
Posts: 740
Joined: Fri Dec 01, 2006 9:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik
Contact:

Re: LC0 For Android!!! History Made!!

Post by abik » Sun May 26, 2019 8:43 am

Ferdy wrote:
Sun May 26, 2019 4:18 am
Tried to setup two lc0 engine versions but with different weight files.
1. Create dir 16x2 which contains lc016x2 bin and w16x2 weight files
2. Create dir 48x5 which contains lc048x5 bin and w48x5 weight files

bin files lc016x2 and lc048x5 are the same only the filenames are different.

3. Install and import
After the install step, everything ends up in the same directory, so I am not sure what weight files are picked up by the binaries. Just because one binary originally resided parallel to the weights file has little impact on how it is used later (does the name have any impact? probably not). I am afraid you will have to wait for the proper UCI options feature so you can setup two binaries with different configurations more easily. Perhaps it will be even useful to give the engine + options a unique name, so that one binary can compete in a tournament under two options (but this is for later). For now, I plan to release the options setup part really soon now, so please stay tuned....

Ferdy
Posts: 4079
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: LC0 For Android!!! History Made!!

Post by Ferdy » Sun May 26, 2019 9:05 am

abik wrote:
Sun May 26, 2019 8:43 am
For now, I plan to release the options setup part really soon now, so please stay tuned....
If you partially support Lc0 options, be sure to include the RamLimitMb. Depending on the device, this option is dangerous which could crash the system when user lets the engine analyze for a long time.

Code: Select all

option name RamLimitMb type spin default 0 min 0 max 100000000

Post Reply