Page 4 of 4 FirstFirst ... 234
Results 31 to 40 of 40

Thread: Chess Players! - A New Chess Engine!

  1. #31
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,836
    Blog Entries
    2

    Default Re: Chess Players! - A New Chess Engine!

    Quote Originally Posted by malcolmlewis View Post
    Hi
    But the backend can be selected via the (in my case) Engines -> Engine
    1 -> Configure, in the dropdown I select which backend opencl, blas,
    random etc. So in the 'actual' Engine -> Manage options don't need the
    -b option in 'Command Line Parameters'?

    In the engine debug log I see it change from opencl to blas as well as
    the lc0 engine calculating it's move after I make a move, so AFAIK it's
    all working as expected.....





    --
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.25-default
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!
    That does seem to work.
    Will update documentation tonight...

    Good Find.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  2. #32
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,836
    Blog Entries
    2

    Default Re: Chess Players! - A New Chess Engine!

    Quote Originally Posted by tsu2 View Post
    That does seem to work.
    Will update documentation tonight...

    Good Find.

    TSU
    Instructions have been updated, primarily with instructions for setting up RPM installs with Arena.
    Open for comment and criticism...

    https://github.com/putztzu/lc0/blob/...USE_install.md

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #33
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,836
    Blog Entries
    2

    Default Re: Chess Players! - A New Chess Engine!

    Side comment on the current World Chess Computer Rapid Chess Championship (The "Rapid" refers to the time control)

    The last round (round robin 4 players, 48 matches each pair) is about 2/3 through as of today, and as I described is running continuously day and night, 24/7, and is about 2/3 over as of today.

    lc0 is the only open sourced machine learning program in this final round of possibly the 4 strongest in the world. This means that instead of hand-crafted rules, Leela learns how to play the game entirely on its own, and the way it "thinks" is entirely dependent on a neural net data file which is generated separately beforehand, and sometimes on special machines that can crunch numbers especially fast. So, I suppose in theory if someone wanted to clone themselves as a chess playing machine, you could create a neural net data file based on your own games and feed that to Leela...

    Stockfish has built up an imposing lead on the rest of the field, but interestingly has been by mercilessly crushing Komodo and Houdini. The match record between Stockfish and Leela is much closer, which suggests that Leela brings something different that Stockfish has some trouble with (but Stockfish still has an advantage). Leela is just unable to beat up on the other competitors as well as Stockfish, and when games are analyzed you do see many lost opportunities as Leela is able to create but is not always able to follow through.

    Leela has also been the subject of some amusing comment... Probably the most striking is the first time it achieved a K+Q vs K ending, I think that even casual chess players understand what that kind of advantage means (It's as dominating and simple as a checkmating advantage can get, simple to win and impossible to lose). Everyone anticipated a quick decapitation. But, Leela instead ran her K into a far off corner and started moving the Q aimlessly. The chat rooms exploded, asking if a chess engine could actually not know how to perform such a simple mating attack? And as the moves continued, the chat rooms commented on the "Draw declared after 50 move after last pawn move or capture" rule, would the game be called a draw? Everyone watched unbelievably as the moves counted... 30... 35... 40.. and then, Leela's king came out of its corner, and eventually executed the mate on something like move 49.

    Afterwards, the Leela developers explained Leela wan't just playing with its food, that their algorithm evaluated the K+Q vs K ending that all positions as totally won (equally), so its primary motive was K safety... Until the 50 move rule changed the evaluation parameters, so only at the last possible move was Leela going to checkmate.

    So, these creatures we humans create do strange things at times and won't necessarily behave like humans.

    You can watch the match being played at any time at two sites, Chess TV (where most of the commenters go) or at chess.com

    https://www.chess.com/computer-chess-championship

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #34
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,491
    Blog Entries
    37

    Default Re: Chess Players! - A New Chess Engine!

    Quote Originally Posted by tsu2 View Post
    Hi,
    To determine what the problem might be when hooked up to Arena,

    .... specifying the blas backend works fine.
    Thanks.

    Turns out that was the problem. I needed to specify the 'blas' backend for an Intel machine (instead of openCL). That need was in fact mentioned earlier in this thread, but I had missed it.

    I find the packman packaged stockfish20 significantly stronger than lc0 on a 5-minute per game test of the two machines vs each other. But maybe I missed some configuration action in lc0 which made it much weaker.

  5. #35
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,836
    Blog Entries
    2

    Default Re: Chess Players! - A New Chess Engine!

    Quote Originally Posted by oldcpu View Post
    Thanks.

    Turns out that was the problem. I needed to specify the 'blas' backend for an Intel machine (instead of openCL). That need was in fact mentioned earlier in this thread, but I had missed it.

    I find the packman packaged stockfish20 significantly stronger than lc0 on a 5-minute per game test of the two machines vs each other. But maybe I missed some configuration action in lc0 which made it much weaker.
    I'll have to look into what is available in Packman, I'm going to guess "20" actually means 2.0 since the very latest available is Stockfish 10 which is in our games repo. When I first installed from the repo, it was Stockfish 9, but when Stockfish 10 became avaialable, automatically updated. Since I was pointing my Arena directly at the default location of the binary, at first Arena seemed to sense that the file had changed so the Engine didn't work but after re-installing Stockfish (without changing any parameters), everything was back to working normally.

    So, my compliments to whoever is minding the Stockfish package, the update didn't actually run into several weeks after the update was available, but it did update. And, it also gave me an excuse to compile Stockfish from source.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  6. #36
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,335
    Blog Entries
    15

    Default Re: Chess Players! - A New Chess Engine!

    Hi All
    So have a new computer setup, Intel DQ77MK with an i5-3470S CPU @ 2.90GHz and 12GB of RAM (a Crucial M500 SSD, boot time 5.6 seconds boot time).

    So ran a lc0 benchmark with the following results;

    Code:
    lc0 benchmark -b blas --weights=.weights/weights
           _
    |   _ | |
    |_ |_ |_| v0.21.0-dev built Jan 11 2019
    Loading weights file from: .weights/weights
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Benchmark time 1014ms, 2 nodes, 1 nps, move e2e4
    ....
    Benchmark time 356291ms, 19624 nodes, 55 nps, move e2e4
    bestmove e2e4
    Benchmark final time 365.424s calculating 54.7829 nodes per second.
    
    lc0 benchmark --weights=.weights/weights -b demux --backend-opts=backend=blas,a,b,c,d
           _
    |   _ | |
    |_ |_ |_| v0.21.0-dev built Jan 11 2019
    Loading weights file from: .weights/weights
    Creating backend [demux]...
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Benchmark time 413ms, 2 nodes, 4 nps, move e2e4
    ....
    Benchmark time 209383ms, 19678 nodes, 93 nps, move e2e4
    bestmove e2e4
    Benchmark final time 214.289s calculating 93.654 nodes per second.
    IMHO, the demux backend and blas options of a batch per core is a winner by far.... I've also got an Nvidia GT710 arriving for this system, so hopefully will setup an nvidia build to test
    Last edited by malcolmlewis; 20-Jan-2019 at 12:11. Reason: Clean up code
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #37
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,836
    Blog Entries
    2

    Default Re: Chess Players! - A New Chess Engine!

    Hi Malcolm,
    Interesting posts.
    You might try the following switch on some runs which increases the number of cores used (You'll notice default is one). It won't likely help in initial moves of an opening, but when there are more valid "forcing" choices, additional cores are supposed to increase consideration of lesser options at the cost of deeper analysis of primary considerations(which might not really need more convincing analysis than already done)

    Code:
    --backend-opts=blas_cores=4
    Additionally, it's recommended in the documentation to set number of threads to a 2:1 ratio to number of cores, while one of the experts online has been consistently recommending a 1:1 ratio. The "--parallelism" command argument is likely deprecated and on my machine as is often the case the application considers cores and CPUs the same. I suspect the documentation might push the practical limit while the expert's recommendation is safer and probably better since I'd guess any potential contention caused by congested threads would be immensely costly and might not provide much practical upside (all guessing).

    Code:
    -t 4
    @oldcpu
    As Malcom has posted, the blas backend which generically will run on any x64 machine is much slower than a GPU backend, but interestingly Leela doesn't necessarily need to be that fast, it's very early but in the tournament consistently looks at only about 2/3 the depth and maybe 1/5 the total number of positions compared to the other engines before arriving at decisions.

    Probably the biggest factor determining strength is the NN (weights) file you select, every file should be posted with a "self-play ELO rating" which IMO is a highly subjective and not necessarily real world estimation of strength. Try another file with a higher ELO rating to see if that affects your computer-computer match play.

    Also, note the following... someone thought it would be competitive to set up Leela on a souped up i5 running blas against a human Grandmaster (an official international title that is earned only by achieving superior results against other similarly titled players)... So running with a blas backend is not necessarily making lc0 play weakly...

    http://blog.lczero.org/2019/01/lc0-v...n-lichess.html

    Also, the Stockfish from Packman is indeed 2.0 so we should prefer Stockfish 10 from our openSUSE games repo...

    Closing comment...
    The last stage of the Rapid tournament just ended this morning with Leela in clear second place but far behind Stockfish. Both (and Komodo) were running special "development" versions with experimental tweaks. Houdini in last (fourth) was the only machine running a standard commercial version(or very close), the same as what you'd get if you bought it off the Houdini website.

    Just starting now at the same link,
    A separate head to head between Stockfish and lc0 has just begun. Leela is running a new, highly specialized version that has been tweaked specifically to play against Stockfish, and now dubbed "Antifish." As I'm writing this, the first game has drawn and they're playing game 2.

    https://www.chess.com/computer-chess-championship

    From the description of Antifish

    Antifish is Lc0, trained specifically to exploit weaknesses in Stockfish. AntiFish is trained from 96308 games (As of AntiFish Mark 125) of Stockfish 11 Dev (77k Nodes) vs AntiFish Mark 25 and Leela ID 11258 (800 Nodes), with temperature. These games are then used to train off of ID 32425 with a heavy focus on policy, and a learning rate of 0.00002. (Up to Mark 125 Only)
    I don't know the cost of the hardware these engines are running on, but they cost a bit...
    Based on an Internet search,
    The CPUs, and RAM used by Stockfish cost about $21,000
    The GPUs alone for Leela supposedly cost about $20,000(although I also saw them listed for about $40,000) plus a couple CPUs about a thousand or so each.

    In other words, dollar amounts for the hardware is not that different, but the software applications couldn't be hardly more different, the traditional Stockfish is the product of many, many years of human tweaking while lc0 has burst on the scene with maybe only a year(as of today) of machine learning. In fact, if you look at the lc0 team, there are only two PhD AI students...

    Enjoy!
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  8. #38
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,335
    Blog Entries
    15

    Default Re: Chess Players! - A New Chess Engine!

    On Sun 20 Jan 2019 06:36:03 PM CST, malcolmlewis wrote:

    Hi All
    So have a new computer setup, Intel DQ77MK with an i5-3470S CPU @
    2.90GHz and 12GB of RAM (a Crucial M500 SSD, boot time 5.6 seconds boot
    time).

    So ran a lc0 benchmark with the following results;


    Code:
    --------------------

    lc0 benchmark -b blas --weights=.weights/weights
    _
    | _ | |
    |_ |_ |_| v0.21.0-dev built Jan 11 2019
    Loading weights file from: .weights/weights
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Benchmark time 1014ms, 2 nodes, 1 nps, move e2e4
    ....
    Benchmark time 356291ms, 19624 nodes, 55 nps, move e2e4
    bestmove e2e4
    Benchmark final time 365.424s calculating 54.7829 nodes per second.

    lc0 benchmark -b demux --backend-opts=backend=blas,a,b,c,d
    _
    | _ | |
    |_ |_ |_| v0.21.0-dev built Jan 11 2019
    Network weights file not found.
    malcolml@oscar:~> lc0 benchmark --weights=.weights/weights -b demux
    --backend-opts=backend=blas,a,b,c,d _
    | _ | |
    |_ |_ |_| v0.21.0-dev built Jan 11 2019
    Loading weights file from: .weights/weights
    Creating backend [demux]...
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Creating backend [blas]...
    BLAS, maximum batch size set to 256
    BLAS vendor: OpenBlas.
    OpenBlas [DYNAMIC_ARCH Sandybridge].
    OpenBlas found 4 Sandybridge core(s).
    OpenBLAS using 1 core(s) for this backend.
    BLAS max batch size is 256.
    Benchmark time 413ms, 2 nodes, 4 nps, move e2e4
    ....
    Benchmark time 209383ms, 19678 nodes, 93 nps, move e2e4
    bestmove e2e4
    Benchmark final time 214.289s calculating 93.654 nodes per second.

    --------------------


    IMHO, the demux backend and blas options of a batch per core is a winner
    by far.... I've also got an Nvidia GT710 arriving for this system, so
    hopefully will setup an nvidia build to test


    Hi
    So rebuilt my rpm locally to add CUDA support... It complained about
    libcublas, but this is in the cuda part so ignored to install...

    Code:
    lc0 benchmark --weights=.weights/weights
    _
    |   _ | |
    |_ |_ |_| v0.21.0-dev built Jan 23 2019
    Loading weights file from: .weights/weights
    Creating backend [cudnn]...
    Benchmark time 586ms, 2 nodes, 3 nps, move e2e4
    ......
    Benchmark time 172235ms, 19667 nodes, 114 nps, move e2e4
    bestmove e2e4
    Benchmark final time 176.046s calculating 113.794 nodes per second.
    A little bit quicker than OpenCL, I'm sure there are tweaks that can be
    done, Nvidia card is a GT710.

    --
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.25-default
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!


  9. #39
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,836
    Blog Entries
    2

    Default Re: Chess Players! - A New Chess Engine!

    An update, lc0 makes history as the first machine learning program to win a Computer Chess World Championship!
    There is no unified title, it's one of a few but this is a significant milestone in AI and machine learning and considering that the approach used involves the application learning the game all on its own without any human intervention, guidance or instruction, this is a remarkable achievement on nearly its first birthday in competitions.

    https://www.chess.com/news/view/lc0-...-makes-history

    And, thanks to efforts by Malcolm and myself, there is no easier distro to install lc0 on your own machine if you want your very own world championship caliber machine learning chess program than openSUSE.

    This is the link to installation again, you have a choice installing RPMs provided by Malcolm which are compiled with OpenCL and CUDA support (Yes, GPU computing!) or building from source using the unattended script I created with only BLAS support (any openSUSE, LEAP or TW running either on physical or virtual machines).

    https://github.com/putztzu/lc0/blob/...USE_install.md

    Even if you're not an avid chess player,
    This can be an easy intro to how a machine learning app works since machine learing will likely touch practically everything over the next decade. You'd find that the app contains a binary similar regular apps but it also uses a data file which contains neural nets which is the training data which are the primary factor that determines playing strength. Download a new NN file if you want to improve (or lessen?) playing strength.

    Additionally, if you "watch" the computer chess competitions at chess.com or at tcec (both display an ongoing game 24/7/365), you'll notice that because lc0 is open source, there are a number (current count at least 5) clones where people are trying to use lc0 as the core engine but tinker around the edges to improve its play... but to date no one has been able to produce a human modified engine that plays better than the original.

    Personally,
    I from a chess playing perspective I find lc0 remarkable in at least one special way... compared to human play, for quite awhile now compouters have been accepted as dominating and humans can rarely measure up. The champion for many years running now, Stockfish (also FOSS and available in our openSUSE repos) has been designed/guided by a Grandmaster so plays like a human in many ways. Yet, this new upstart lc0 which is entirely based on self-learning unspoiled by human input plays extremely naively in many ways yet has attained world class results due to honing its own set of "skills." By playing so inhumanly, lc0 is opening up new perspectives on what it takes to be world class successful. And, I expect that the same will likely happen when this "zero" approach to machine learning is applied to everything else in our human experience causing long held human beliefs the "right" way to do things will come under questioning and re-evaluation.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #40
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    1,906

    Default Re: Chess Players! - A New Chess Engine!

    Quote Originally Posted by tsu2 View Post
    Personally,
    I from a chess playing perspective I find lc0 remarkable in at least one special way... compared to human play, for quite awhile now compouters have been accepted as dominating and humans can rarely measure up. The champion for many years running now, Stockfish (also FOSS and available in our openSUSE repos) has been designed/guided by a Grandmaster so plays like a human in many ways. Yet, this new upstart lc0 which is entirely based on self-learning unspoiled by human input plays extremely naively in many ways yet has attained world class results due to honing its own set of "skills." By playing so inhumanly, lc0 is opening up new perspectives on what it takes to be world class successful. And, I expect that the same will likely happen when this "zero" approach to machine learning is applied to everything else in our human experience causing long held human beliefs the "right" way to do things will come under questioning and re-evaluation.

    TSU
    Thank you for the efforts to make this easy on openSUSE. The same thing is happening in Starcraft 2 at the moment if you are interested. The AI already beat some of the pro players (not the best players yet though). It's also happening in DOTA 2 (the AI team was completely crushed by an average human team on the last International (2018) but it won with a human in a 1v1 lane fight).
    Best regards,
    Greg

Page 4 of 4 FirstFirst ... 234

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •