New engine: a0lite

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

Moderators: Harvey Williamson, bob, hgm

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
dkappe
Posts: 542
Joined: Tue Aug 21, 2018 5:52 pm
Full name: Dietrich Kappe

New engine: a0lite

Post by dkappe » Sat Mar 28, 2020 9:14 pm

For those wanting to tinker with their own NN engine, I present a0lite. It's written in python. The core of the algorithm is just 95 lines.

https://github.com/dkappe/a0lite
It's meant for tinkering. As such, more complex developments will be in branches rather than in the master. Also check out the forks and see what others are doing.

You will need to install badgyal for the neural nets.

By default it uses MeanGirl-8 (32x4) net on CPU. Plays about ~2050 CCRL in this configuration. The shell script a0lite.sh works as a uci engine. You can find a log file, a0lite.log in the same dir as the script.

dkappe
Posts: 542
Joined: Tue Aug 21, 2018 5:52 pm
Full name: Dietrich Kappe

Re: New engine: a0lite

Post by dkappe » Sun Mar 29, 2020 3:55 am

I've created a branch called 'fancy' that has tree reuse and 'smart' pruning. On a 2070 with Bad Gyal it plays about 2500 CCRL.

https://github.com/dkappe/a0lite/tree/fancy

Jamal Bubker
Posts: 313
Joined: Mon May 24, 2010 2:32 pm

Re: New engine: a0lite

Post by Jamal Bubker » Mon Mar 30, 2020 3:22 pm

thank you !

jhellis3
Posts: 485
Joined: Fri Aug 16, 2013 10:36 pm

Re: New engine: a0lite

Post by jhellis3 » Mon Mar 30, 2020 4:39 pm

This seems like it would be a good test bed for ideas; I wonder what happens if one only increments visits for own moves...

jhellis3
Posts: 485
Joined: Fri Aug 16, 2013 10:36 pm

Re: New engine: a0lite

Post by jhellis3 » Mon Mar 30, 2020 5:12 pm

I don't really know python syntax but I am guessing

Code: Select all

if turnfactor > 0:
	current.number_visits += 1
in the while loop would get the job done.

cucumber
Posts: 136
Joined: Sun Oct 14, 2018 6:21 pm
Full name: JSmith

Re: New engine: a0lite

Post by cucumber » Mon Mar 30, 2020 5:16 pm

Your code is beautifully succinct.

dkappe
Posts: 542
Joined: Tue Aug 21, 2018 5:52 pm
Full name: Dietrich Kappe

Re: New engine: a0lite

Post by dkappe » Mon Mar 30, 2020 7:28 pm

I've created a branch called 'batching' that uses virtual loss to gather batches of positions for the gpu. https://github.com/dkappe/a0lite/tree/batching

The speed now seems dominated by the python-chess code, and my inefficient implementation.

On a 2070, the difference with batching is

Code: Select all

info depth 1 seldepth 1 score cp 22 nodes 10000 nps 1170 pv e2e4
bestmove e2e4
and without

Code: Select all

info depth 1 seldepth 1 score cp 28 nodes 10000 nps 446 pv e2e4
bestmove e2e4
Will try to fold in tree reuse in another branch and also get a 256x20 net working.
Last edited by dkappe on Mon Mar 30, 2020 7:30 pm, edited 1 time in total.

dkappe
Posts: 542
Joined: Tue Aug 21, 2018 5:52 pm
Full name: Dietrich Kappe

Re: New engine: a0lite

Post by dkappe » Mon Mar 30, 2020 7:29 pm

Ah, you'll need to reinstall badgyal, as it has some bulk eval support added.

dkappe
Posts: 542
Joined: Tue Aug 21, 2018 5:52 pm
Full name: Dietrich Kappe

Re: New engine: a0lite

Post by dkappe » Mon Mar 30, 2020 11:41 pm

Added in a branch that combines batching with tree reuse.

https://github.com/dkappe/a0lite/tree/b ... tree-reuse

I will add in smart pruning in a day or two. Then I will need to think about simplifying the code.

dkappe
Posts: 542
Joined: Tue Aug 21, 2018 5:52 pm
Full name: Dietrich Kappe

Re: New engine: a0lite

Post by dkappe » Tue Mar 31, 2020 2:59 am

Tried out a0lite with batching and tree reuse at a tc of 30 m + 5 sec. Donna 4.1 lost on time, but it was a foregone conclusion.


Post Reply