Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leela 0.11.0 on Lizzie 0.7.4 #815

Closed
kaorahi opened this issue Nov 16, 2020 · 20 comments
Closed

Leela 0.11.0 on Lizzie 0.7.4 #815

kaorahi opened this issue Nov 16, 2020 · 20 comments

Comments

@kaorahi
Copy link
Contributor

kaorahi commented Nov 16, 2020

Leela 0.11.0 (not Leela Zero) was once supported in #182. But it was deleted in #247 silently before Lizzie 0.5. So I made a quick hack to support Leela 0.11.0 on Lizzie 0.7.4 again. You can set leela_gtp -g as the engine command. Does anybody want to use this seriously? (It is not tested at all.)

https://github.com/kaorahi/lizzie/tree/leela_nonzero_on074

@hope366
Copy link

hope366 commented Nov 16, 2020

I tried "leela_nonzero_on074".
I placed "Leela0110GTP.exe" in the lizzie folder and set the engine command to "Leela0110GTP.exe -g".
It seems that it started normally, but the candidate move is not displayed on the board.
Previously, there was a person who wanted to use Leela 0.11.0 with lizzie. However, it was a story that assumed that candidates would be displayed like Leela Zero and Kata Go.
Is it possible to program to display candidate moves?

@kaorahi
Copy link
Contributor Author

kaorahi commented Nov 17, 2020

It works for me...

leela0110

  1. If you merge f8c4371 with my other patches, you may need some edits of the code to resolve conflicts. Would you try the above URL itself first?
  2. What is shown on the GTP console?

@hope366
Copy link

hope366 commented Nov 17, 2020

I tried f8c4371 (Alone)
But no candidate moves are displayed on the board.
Turning on pondering puts a load on the computer, so it seems to be working internally.
The GTP console looks like this:
無題

@kaorahi
Copy link
Contributor Author

kaorahi commented Nov 17, 2020

Hmm... Would you try 1 and/or 2?

  1. Download Leela 0.11.0 engine only from https://sjeng.org/leela.html and use Leela0110GTP.exe (not Leela0110GTP_OpenCL.exe) in it.
  2. Increase LEELA0110_PONDERING_INTERVAL_MILLIS in Leelaz.java (line 106) to 2000 or more. It is the interval of screen updating (milliseconds).

@hope366
Copy link

hope366 commented Nov 17, 2020

I tried the screen update interval at 2000 or 3000, but it didn't work.
I tried swapping Leela0110GTP.exe and Leela0110GTP_OpenCL.exe, but it didn't work either.
Apparently the problem is in config.txt. It seems to work if you use config.txt which is working well.
I'd like to check where in config.txt you can find a hint to solve the problem.

@kaorahi
Copy link
Contributor Author

kaorahi commented Nov 17, 2020

I noticed the candidate moves disappear if I click "showPolicy" in the tool bar.

BTW, I pushed a323076.

@hope366
Copy link

hope366 commented Nov 17, 2020

I finally figured out where the problem was in cofig.txt.

"show-bestmoves-by-hold": true,

If this setting is "false", Leela0110 will not display candidates. The default is "true", but I like "false" so I usually do that, but it seems to be incompatible with Leela0110.
Is it possible to rewrite the code so that it works well even if this setting is false?

@hope366
Copy link

hope366 commented Nov 17, 2020

I tried a323076, but when I click "show Policy" on the toolbar, the candidates disappear ...

@kaorahi
Copy link
Contributor Author

kaorahi commented Nov 18, 2020

thx for testing. a323076 is not for "showPolicy". Please read the commit log. :)

...and I pushed further commits to https://github.com/kaorahi/lizzie/tree/leela_nonzero_on074 .

@hope366
Copy link

hope366 commented Nov 18, 2020

Oh, it seems that I made a mistake because I didn't check the contents of the log properly.
By making Leela 0.11.0 available, it means that the use of Leela Zero has been adversely affected.
It was confirmed that the problem was improved by applying a323076.

@hope366
Copy link

hope366 commented Nov 18, 2020

It is a state of the GTP console when the engine is Leela 0.11.0, but it seems that the displayed contents alternate every time the display ⇔ non-display is switched.
This is not a problem specific to Leela 0.11.0, the same thing happens if the engine is KataGo.

@hope366
Copy link

hope366 commented Nov 19, 2020

I was having trouble with the policy network not being displayed on the Leela0110, but when I carefully rewrote the code from the beginning, it worked. I think there was a rewriting mistake somewhere.I'm sorry for making a noise.
Next, let me tell you what I noticed about Leela0110.

  • When pondering is turned off, the displayed policy network disappears. When pondering is turned on, it will be displayed again soon.
  • Another point, I tried LEELA0110_PONDERING_INTERVAL_MILLIS = 100, but if I keep the pondering on in the same situation, the analysis speed will drop significantly at a fairly early stage.
    The default "1000" seems to be okay.
  • If you press the "N" key to play against Leela 0.11.0, Leela thinks even when it's your opponent's turn.
    It is solved by adding "--noponder". However, this causes the analysis mode to stop working.
  • When playing a game with Leela with the "N" key, it is stable at about 10000 visits / s, but in analysis mode it is only about 200 ~ 300 visits / s. Moreover, the blur is large.

@kaorahi
Copy link
Contributor Author

kaorahi commented Nov 20, 2020

4914074 should fix the first one. I can't or won't fix the others. This is just a quick hack. Please don't expect much.

Anyway, the previous post gives us a nice list of the limitations of this implementation. Thanks for your reports!

@hope366
Copy link

hope366 commented Nov 20, 2020

Thank you for writing 4914074.
I dared to find a small problem, but I think it's still convenient enough.
Thank you for making Leela 0.11.0 available!

@kaorahi
Copy link
Contributor Author

kaorahi commented Dec 26, 2020

Leela 0.11.0 is opensource now. We can modify it as follows so that it works on normal Lizzie without performance loss.

https://github.com/kaorahi/Leela/tree/lz-analyze

@kaorahi kaorahi closed this as completed Dec 26, 2020
@hope366
Copy link

hope366 commented Jan 4, 2021

It seems that automatic analysis is not possible, but is it possible by applying https://github.com/kaorahi/Leela/tree/lz-analyze?
I wanted to use it, but I can't do it so far because I don't know how to compile Leela.
Is there a good way to set the engine to Leela in lizzie and enable automatic analysis?

@kaorahi
Copy link
Contributor Author

kaorahi commented Jan 5, 2021

Auto-analysis itself has problems that are not related to this patch.

  1. Lizzie ignores auto-analysis silently when we are at the end of the game. So I added a message in Show message when autoanalysis is denied #842.
  2. In my environment, auto-analysis is stalled even in Lizzie 0.7.4 with KataGo. It doesn't happen in patched_0.7.4 (Patched 0.7.4 #798). cf. Deadlock and Lizzie hangs #825 (comment)

@hope366
Copy link

hope366 commented Jan 5, 2021

I haven't done a lot of experimentation, but in my environment the automatic analysis seems to work well when using KataGo with Lizzie-v 0.7.4 (official version).
Of course, patched_0.7.4 (# 798) also works fine.
The problem is when I set Leela on the engine, and when I run the automatic analysis, it keeps analyzing the current situation forever, just like when I turned on pondering.

@kaorahi
Copy link
Contributor Author

kaorahi commented Jan 5, 2021

Hmm... I cannot reproduce your issue. Anyway, this patch is needless for me now and I have little motivation to improve it.

@hope366
Copy link

hope366 commented Jan 5, 2021

OK. I will think for myself that I can somehow take it for the better. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants