It is currently Sun Jul 12, 2020 11:37 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 132 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #61 Posted: Mon Jul 29, 2019 4:58 pm 
Lives in gote

Posts: 531
Liked others: 87
Was liked: 567
Rank: maybe 2d
afar wrote:
And wrote:
thank! waiting for new releases! We are also waiting the CPUonly version!


You can already run on the CPU if it supports OpenCL. It's quite slow though, since the cpu slowness compounds with the unoptimised opencl code.


Unoptimised? Ouch. :blackeye:

Compared to a naive implementation - i.e just writing the code literally taking advantage of the OpenCL kernel parallelism but nothing else special, which is what I started with to just make sure it all compiled, it's perhaps a factor of 5 to 20 better, depending on your hardware. I did spend many hours learning about GPU optimization and improving things over that baseline, although there's still more to do. It calls out to CLBlast for fast matrix multiplication, uses Winograd 4x4 tiles, and a few other tricks. (by the way, the Winograd convolution algorithm and the math behind it is pretty sweet).

It's just that there's maybe another factor of 1.5 to 3 left to gain depending on your hardware. There's always a little more that can be done. :)

And yes, if you have a CPU OpenCL implementation (possibly you can download one that works for your CPU architecture), you can run it on the CPU already, but the OpenCL implementation is optimized for GPU and not CPU, and is likely already doing things that make no sense for performance if the underlying engine is a CPU, so it will probably never compete with a sufficiently well-written CPU-specific version. I have a colleague/friend working on getting a CPU-specific version working. Although of course, getting it working and optimizing it fully are again two very different tasks.

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #62 Posted: Tue Jul 30, 2019 4:35 am 
Lives in gote
User avatar

Posts: 371
Liked others: 60
Was liked: 29
several games of KataGo - Elf v2 (opencl), gt 610, 30s/move with numSearchThreads = 16 Elf won everything, with numSearchThreads = 1 everything won KataGo. this is normal? with increasing numSearchThreads can power drop so much? or few parties? (I want to make ~50)

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #63 Posted: Tue Jul 30, 2019 5:21 am 
Lives in gote

Posts: 531
Liked others: 87
Was liked: 567
Rank: maybe 2d
More threads makes a bot much weaker per visit. This is true of LZ too. So increasing threads is only a good idea if it produces a significant increase in visits per second, enough to compensate the loss in strength.


This post by lightvector was liked by: And
Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #64 Posted: Tue Jul 30, 2019 2:36 pm 
Oza
User avatar

Posts: 2266
Location: Tokyo, Japan
Liked others: 2140
Was liked: 1278
Rank: Jp 6 dan
KGS: ez4u
lightvector wrote:
More threads makes a bot much weaker per visit. This is true of LZ too. So increasing threads is only a good idea if it produces a significant increase in visits per second, enough to compensate the loss in strength.

@lightvector - could you give us the "AI Go for Dummies" explanation behind the weakness caused by increasing threads?

_________________
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21


This post by ez4u was liked by: Bill Spight
Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #65 Posted: Tue Jul 30, 2019 2:59 pm 
Dies in gote

Posts: 53
Liked others: 3
Was liked: 33
Rank: KGS 2k
Lets say that you have given the bot a budget of 10.000 visits or playouts for a move. Be this either by setting a time limit, and your hardware being able to do that amount in the set time limit, or by manually setting an amount of playouts.

With 1 thread, the bot will look through options with the set algorithm, and then choose a move based on either visit count, confidence, or whatever criteria that has been chosen.
The thing here is that, that 1 thread, will use all those 10.000 playouts, and most likely it uses them in a way that makes sense for Go.

In Go, you have many things that become apparant only very deep in the search tree. A capturing race for example, might only work with 1 very specific move sequence, and the bot will have to search through it all to find it, and then if you use playouts for a certain move to decide what move to play, you adittionally need enough playouts to make it the most visited answer.

Same thing with a ladder, you might need to spend 3000-4000 playouts to make sure that a ladder works, or does not work, since at every turn, you need to consider all the alternatives.

This all works relatively well with 1 thread, but if you use 10 threads, you are splitting your 10.000 playout budget into 10 threads.

And you might not want the different threads to double another threads work.

So thread number 1, now only has 1000 playouts to figure out that C2 will win the capturing race. The answer that C2 is correct, is however so deep, that 1000 playouts is not enough.
All other 9 threads will be looking at other moves most likely. Not a single thread will look deep enough, and the answers in Go, are usually, hidden very deep.

Funnily, the ELF network running on Leela sometimes actually does play stronger. But this is only because the ELF network is so over sharpened, that it only thinks of 1 or 2 moves. When faced with a stronger opponent, which has trained on a wider variety of gameplay, ELF will then loose, because it doesnt understand that some other move might actually be good.
By increasing the amount of threads, you then force the over sharpened ELF network to actually look at moves that it normally wouldnt do.
But this really is something i have only seen ELF ever do, everything else falls in strength with more threads and batching.

You trade speed (moves per second) for strength.

Anyways, this is how ive understood it, im not a huge expert, so feel free to correct me if im wrong.


This post by Aram was liked by 3 people: Bill Spight, ez4u, lightvector
Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #66 Posted: Wed Jul 31, 2019 4:34 am 
Beginner

Posts: 3
Liked others: 0
Was liked: 2
Rank: EGF 1 kyu
Just want to say a big thanks lightvector for getting opencl support in katago.

I was previously using leelazero run on a laptop (igpu) and it was OK to play with, using early 6 block networks (around 1dan strength).


Katago (6block) seems to play the endgame a bit better which is great.

leelazero (6block) would sometimes play the endgame a bit slack if the game was close, and then self implode.

like leelazero couldn't judge the score good enough in a close (+/-5 point) endgame.


I like the style of play too, it really likes to fight and complicate the game, often leaving groups unsettled.

leelazero 6 block likes to fight too, but katago 6 block even more so.


The adjustable komi is great too, so I can play 0.5 (or -6.5) komi games with the 6 block networks.


Something I liked about leelazero was that pangafu trained a 10 block leelazero master version using 80-90% human (pro?) games.

I wonder if something like that would be possible with katago 6 or 10 blocks?

I guess one of the holy grails of go AI is to be able to select different playing styles, such as takemiya sensei, cho chikun, go seigen, etc.

having parameters for how much to favour: influence, fighting, honte, etc...


good luck with the future research!


This post by birdinhand was liked by: lightvector
Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #67 Posted: Wed Jul 31, 2019 12:16 pm 
Lives in gote
User avatar

Posts: 371
Liked others: 60
Was liked: 29
who played on other boards? How does KataGo play 13x13? or other sizes?
on 19x19 plays amazingly!

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #68 Posted: Wed Jul 31, 2019 4:08 pm 
Lives in gote

Posts: 531
Liked others: 87
Was liked: 567
Rank: maybe 2d
@ez4u - Yep, Aram pretty much has all the right ideas. The search usually benefits greatly from knowing the results of earlier visits when spending later visits and being able to explore deeply, and threading gets in the way of that.

@birdinhand - Thanks! More opening variety is definitely something I want to look into in the future. Done right, it may help learning in self-play as well.

@And - Yes, KataGo plays on other sizes. All square sizes from 9x9 through 19x19 were part of training. So, try a 12x12 game if you like. On 9x9 it does not match up to specially trained 9x9 bots (which can reach near-optimal) but overall should be extremely strong on all sizes in that range.

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #69 Posted: Thu Aug 01, 2019 7:14 am 
Lives in gote
User avatar

Posts: 371
Liked others: 60
Was liked: 29
@lightvector, thank! it’s very good that can play KataGo on different boards, from 2x2 to 19x19! and even on rectangular ones! (only sabaki does not support rectangular). perhaps this is the only program with such features! in the latest release, the size limit is 19x19 for objective reasons? sometimes it's interesting to play on larger boards. Can you make support up to 37x37 or 52x52?

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #70 Posted: Thu Aug 01, 2019 11:30 pm 
Dies in gote

Posts: 61
Liked others: 4
Was liked: 19
Rank: 1d
Universal go server handle: iopq
lightvector wrote:
On 9x9 it does not match up to specially trained 9x9 bots (which can reach near-optimal) but overall should be extremely strong on all sizes in that range.


This isn't true, it has 40%+ winrate vs. specially trained 9x9 bots that have bigger networks (so likely equal strength at time parity) and I've spent many days trying to train one that beats it. Even the strongest networks are nowhere near optimal without several million playouts, and even then, sometimes can't read out the result if it depends on a ko fight at the end. Which most 9x9 games end up in anyway, since the engines can avoid a clear loss quite easily.

In other words, at time parity there's no clear better bot on 9x9


This post by iopq was liked by 2 people: And, Bill Spight
Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #71 Posted: Fri Aug 02, 2019 3:49 am 
Lives in gote
User avatar

Posts: 371
Liked others: 60
Was liked: 29
iopq, Is it possible that there is a bot that you have not tried, and it plays better?
or other results may be with other settings (visits or others)?
I wonder if you used opencl or cuda, and what settings, what videocard?

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #72 Posted: Fri Aug 02, 2019 5:08 am 
Dies in gote

Posts: 61
Liked others: 4
Was liked: 19
Rank: 1d
Universal go server handle: iopq
And wrote:
iopq, Is it possible that there is a bot that you have not tried, and it plays better?
or other results may be with other settings (visits or others)?
I wonder if you used opencl or cuda, and what settings, what videocard?

The creator of the bot said he gave up on it, and is currently making a 9x9 KataGo run himself. His current bot is 15b and can beat KataGo on equal visits ~40% of the time, so I assume it's stronger on time parity.

His bot is the 171st network of his run, 30 blocks. I only tested the 168th or something like that. Similar strength to KataGo (stronger, but slower) but I didn't do a long test.

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #73 Posted: Sat Aug 03, 2019 7:24 am 
Lives in gote
User avatar

Posts: 371
Liked others: 60
Was liked: 29
who knows how to connect KataGo to Lizzie?

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #74 Posted: Sat Aug 03, 2019 10:20 am 
Dies in gote

Posts: 65
Liked others: 10
Was liked: 16
Rank: 1k KGS
update your config and change the engine to something like this:

"engine-command": "./KataGo/main.exe gtp -model ./KataGo/model.txt -config ./KataGo/configs/gtp_example.cfg -override-version 0.17",

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #75 Posted: Sat Aug 03, 2019 10:50 am 
Lives in gote
User avatar

Posts: 371
Liked others: 60
Was liked: 29
cyndane, thanks for the answer! It works for me: "engine-command": "./katago gtp -model model.txt -config gtp_example.cfg",.
and need to change "network-file": "model.txt",.
what gives "-override-version 0.17"?

Rectangular board support has been merged into Lizzie https://github.com/leela-zero/leela-zer ... -513329967
this can be done?

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #76 Posted: Sat Aug 03, 2019 11:06 am 
Lives in gote

Posts: 471
Liked others: 1
Was liked: 137
Rank: KGS 2k
GD Posts: 100
KGS: Tryss
You need to "compile" yourself the latest version of lizzie to get the latest features.

Lizzie is constantly improving, but they don't make a new public release of compiled version for each new addition (actually, the latest release was the 0.6 november last year, and since then there was 190 commits (= change) to the code).

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #77 Posted: Sat Aug 03, 2019 11:14 am 
Lives in gote
User avatar

Posts: 371
Liked others: 60
Was liked: 29
Tryss, thanks, and the compiled version can be found somewhere?

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #78 Posted: Mon Aug 05, 2019 5:36 am 
Lives in gote

Posts: 531
Liked others: 87
Was liked: 567
Rank: maybe 2d
And, your question seems already directly answered by Tryss's previous post:
Tryss wrote:
You need to "compile" yourself the latest version of Lizzie to get the latest features.

If you don't want to do that, I guess you're probably limited to either asking nicely in the Lizzie Github for someone else to do it for you, or to wait for whenever they do make a new official release.

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #79 Posted: Mon Aug 05, 2019 11:32 am 
Lives in gote
User avatar

Posts: 371
Liked others: 60
Was liked: 29
lightvector, thanks, I was counting on the fact that someone had already compiled it and posted it on a file hosting service.

how to run analysis mode in KataGo?

Top
 Profile  
 
Offline
 Post subject: Re: A new run of KataGo released - strength comparable to EL
Post #80 Posted: Tue Aug 06, 2019 3:56 am 
Dies in gote

Posts: 61
Liked others: 4
Was liked: 19
Rank: 1d
Universal go server handle: iopq
Put the new lizzie.jar into your Lizzie folder

this version has better KataGo support

https://mega.nz/#!5d4THYBY!f0ReTYpjtswi ... KF62SuOTb8


This post by iopq was liked by 3 people: And, Bill Spight, Marcel Grünauer
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 132 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group