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

About Multiple Engine Support & Heights Switching #356

Closed
zsalch opened this issue Sep 2, 2018 · 26 comments
Closed

About Multiple Engine Support & Heights Switching #356

zsalch opened this issue Sep 2, 2018 · 26 comments

Comments

@zsalch
Copy link
Contributor

zsalch commented Sep 2, 2018

Hi

I am looking forward to supporting more engines in the next release of the lizzie, such as AQ, Phoenix, Elf, etc. I am prefer to AQ because it uses Japanese rules, and most of AI only support Chinese rules. AQ can make up for this deficiency.

But I also know that supporting a new engine requires more work, so I temporarily made a simple solution that allows Lizzie to switch between multiple weights, which also helps me see the analysis status between different weights.

Because I have not do full tests, so only submitting the changes in my branch. Those who are interested can refer to them(https://github.com/zsalch/lizzie/tree/next_dev).

Change logs:

  1. In the config.txt file, add a configuration (engine-command-list) to add a new command lines:

    "engine-command": "./leelaz --gtp --lagbuffer 0 --weights %network-file --threads 2",
    "engine-command-list": [
      "./leelaz --gtp --lagbuffer 0 --weights leelaz_172_b1c --threads 2",
      "./leelaz --gtp --lagbuffer 0 --weights human_best --threads 2",
      "./leelaz --gtp --lagbuffer 0 --weights elf_1_62b --threads 2",
      "./leelaz --gtp --lagbuffer 0 --weights leelaz_157_d35 --threads 2"
    ],

  1. Use the shortcut key Ctrl+number to switch the weight and display the weight name in the left down:
        Ctrl+0: Default switch to "engine-command"
        Ctrl+(1-9): Switch to "engine-command-list"

  2. If the current node is in Branch, it also supports keeping the current node when switching weights.

The effect is as following:

elf 2 d13:
image
leela zero 172 b1c:
image

Pre-release files:
https://github.com/zsalch/lizzie/releases/tag/v0.5%2B

@wonsiks
Copy link

wonsiks commented Sep 3, 2018

Wow~ this is great~~~
Good job~

@wonsiks
Copy link

wonsiks commented Sep 3, 2018

I saw that there're more configs in the config file.
Are they working at the moment?
What about show-dynamic-komi option? How can I use it?

@apetresc
Copy link
Contributor

apetresc commented Sep 5, 2018

I haven't run this to try it out yet, but in principle it seems amazing. Quick question - are all of the engines in the command list being run in the background at once, or does it shut off the previous engine and spin up the new one only when it's activated with the Ctrl+# shortcut? If so, does that mean you have to wait for weights to be loaded every time? Or are you doing something clever with suspending the process in the background? (In which case VRAM might still be an issue on some cards, right?)

@zsalch
Copy link
Contributor Author

zsalch commented Sep 6, 2018

@apetresc
Currently the simplest solution is to stop the previous process and open a new process. Of course, need to wait for new weight to be loaded every time, but can avoid the problem of many multi-process coexistence.
Suspending and maintaining the current process requires do more work, solve more problems, and take up more resources. In the future, new configuration options may be can be added to allow users to choose by self.

@zsalch
Copy link
Contributor Author

zsalch commented Sep 6, 2018

@wonsiks
The option 'show-dynamic-komi' is used to display dynamic komi (when press key 'D'), provided that leela zero version supports dynamic komi and reported.

@atoutw
Copy link

atoutw commented Sep 7, 2018

@zsalch
I am using Lizzie everyday and helping my professional friends to install Lizzie.
Just want to say "Thanks for all about this, it is really helpful"(I created an account today.)

I tried "Multiple Engine" and it worked on my PC (win10/i7-8700k/1080ti),
but Lizzie became slow!
(ex. elf1 took 5s, but elf1 of multiple-engine took about 35s in the same playouts)
Why did it become slow? Could you teach me how to fix the problem?

@atoutw
Copy link

atoutw commented Sep 7, 2018

@zsalch
Another question:
How do Lizzie show comments like your example pictures?

@alreadydone
Copy link
Contributor

... and the latest version (Windows) supporting dynamic komi is available at https://github.com/alreadydone/lz/releases/tag/komi%2Bv0.42 or you can compile it from https://github.com/alreadydone/lz/tree/komi+next

@zsalch
Copy link
Contributor Author

zsalch commented Sep 8, 2018

@atoutw
I have not encountered this problem. I don't know what your jdk version is? Recommended 1.8 or more.
If you set elf1 as the default engine instead of switching, is it also so slow?

For the display of the comment, please open the display variation graph, as long as there is a C tag in sgf, it can be displayed. This change has been submitted pull request, has not yet been agreed, please temporarily use my attachment.

@zsalch
Copy link
Contributor Author

zsalch commented Sep 8, 2018

@alreadydone
This is really a amazing job, I always wanted this version.
Is it possible feel free to set the dynamic komi (7.5 or 6.5 or 5.5?) and make them effective under the current weight (such as elf or Leela Zero official)?
Can I use it on the Mac or Linux?
Thanks a lot.

@atoutw
Copy link

atoutw commented Sep 9, 2018

@zsalch
I found that why did Lizzie become slow because I made a really stupid mistake. (I installed "CPU" version. I'm sorry ==;)

Thanks for teaching the way to display of the comment, but how could I be able to change the words' size of the comment?

180909_test1

@zsalch
Copy link
Contributor Author

zsalch commented Sep 9, 2018

@atoutw
Please refer the pre-release and download the jar file again:
https://github.com/zsalch/lizzie/releases/tag/v0.5%2B

@atoutw
Copy link

atoutw commented Sep 10, 2018

@zsalch
Thanks for the pre-release. I can't wait to see the next version!

There are some bugs(I think) I found in pre-release. Please check them.

  1. The variation position will be strange when reading you writed the Sgf with variation by v0.5+. (It is displace about 3 moves from test.)
  2. The variation position will be very weird when reading you downloaded from web page or internet go soft(like 野狐).
  3. Storaged "WinRate" is the win-rate of the next move, not the correct move. By the way, I think it's better "(Engine's name / playouts) (win-rate)" instead of "WinRate: (win-rate)"
  4. The commend is a little covered.

180910_tempsnip

@zsalch
Copy link
Contributor Author

zsalch commented Sep 10, 2018

@atoutw
Thanks for your testing.

About 1&2, would you like to upload the sgf file? and provide more detailed explanation?
About 3, this a good suggestion, in fact, before writing this win rate is just an attempt, to test can be written, and now it seems that it must be implemented seriously.
About 4, may be you need to download again, because I updated in the morning. :)

@atoutw
Copy link

atoutw commented Sep 10, 2018

@zsalch
About 1&2, after uploading the sgf file and 1 was solved, but 2 still exists.

I will try to provide explanation more easily...
When open the file that writed by MultiGo in Lizzie, The variation position will be changed as below example.

180910_tempsnip03

About 4, There is still some little problem about comment as below.

180910_tempsnip01

May I write another suggestions of the next version here?

@wonsiks
Copy link

wonsiks commented Sep 11, 2018

I suggest showing weight file name on the window title bar instead of bottom left side of the screen.
Could you apply this on next version?
That would be so nice then... :)

@zsalch
Copy link
Contributor Author

zsalch commented Sep 11, 2018

@wonsiks
Good suggestion, and the title is wider...

@zsalch
Copy link
Contributor Author

zsalch commented Sep 11, 2018

@atoutw
About 1&2, The format of the Sgf save variation will be different. Now lizzie supports the standard sgf variation format, and MultiGo may be different.
It is possible to upload the sgf to here for testing?

About 4, I will add a little padding.

About other suggestions, I recommend creating a new issue, so that more person will see it and it may be resolved faster.
Of course, while creating a new issue, you can also synchronize Issue in my fork (there is no problem in Chinese):
https://github.com/zsalch/lizzie/issues

@atoutw
Copy link

atoutw commented Sep 11, 2018

@zsalch
About 1&2, I tried to decrease moves of main variation to 15 moves and increase moves of variation for understand the bug (I think) easier.

step 1. Input the game's moves and variations in MultiGo, and save it by MultiGo.
image
(;CA[shift_jis]AP[MultiGo:4.4.4]EV[第20回中国囲棋甲級リーグ第15節・]DT[2018-09-10]
PC[天津麗思?爾頓]PB[柯潔]BR[九段]PW[辜梓豪]WR[九段]KM[7.5]RE[W+R]MULTIGOGM[1]
;B[pd];W[dp];B[pp];W[dd];B[fq]
(;W[cn];B[cc];W[cd];B[dc];W[ed];B[fc];W[fd]
(;B[gb]
(;W[hc];B[nq])
(;W[gc];B[ec];W[hc];B[hb];W[ic]))
(;B[gc];W[ec];B[eb];W[fb];B[db];W[hc];B[gb];W[gd];B[hb]))
(;W[nq];B[cn];W[fp];B[gp];W[fo];B[dq];W[cq];B[eq];W[cp];B[dm];W[fm]))

step 2. Open it by Lizzie v0.5+ and show the first variation, then save it by Lizzie v0.5+.
image
(;KM[7.5]PW[]PB[]DT[2018-09-12]AP[Lizzie: 0.5];B[pd]C[(0)(200.00%)];W[dp]C[(0)(200.00%)];B[pp]C[(0)(200.00%)];W[dd]C[(0)(200.00%)];B[fq]C[(0)(200.00%)];W[cn]C[(0)(200.00%)];B[cc]C[(0)(200.00%)];W[cd]C(0)(200.00%)(;B[gc]C[(0)(200.00%)];W[ec]C[(0)(200.00%)];B[eb]C[(0)(200.00%)];W[fb]C[(0)(200.00%)];B[db]C[(0)(200.00%)];W[hc]C[(0)(200.00%)];B[gb]C[(0)(200.00%)];W[gd]C[(0)(200.00%)];B[hb]C[(0)(200.00%)]))

I will stop here because there is a seriouser problem I just found and I will post them in next comment.

@atoutw
Copy link

atoutw commented Sep 11, 2018

@zsalch
I found another problem about read and write the Sgf with variation on Lizzie v0.5+.

・step 1. Input the game's moves and variations in Lizzie v0.5+.
image
(the last move of the first variations)

image
(the last move of the second variations)

・step 2. Copy (step 1) and paste it in another Lizzie v0.5+.
image
(the last move of the first variations)

image
(the last move of the second variations)

It is strange that the two go board is not the same.

ps. I used this night's update of Lizzie v0.5+.

@zsalch
Copy link
Contributor Author

zsalch commented Sep 12, 2018

@atoutw
I got it and will be testing.

@zsalch
Copy link
Contributor Author

zsalch commented Sep 12, 2018

@atoutw
I have updated the pre-release. Please try again.

@atoutw
Copy link

atoutw commented Sep 12, 2018

@zsalch
image
Great job! That problem was solved!

@atoutw
Copy link

atoutw commented Sep 12, 2018

@zsalch
image
I copied from above and pasted on below, that was no problem now!

@alreadydone
Copy link
Contributor

@zsalch
Sorry for the late response.

Is it possible feel free to set the dynamic komi (7.5 or 6.5 or 5.5?) and make them effective under the current weight (such as elf or Leela Zero official)?

See some suggestions about using it under 6.5 komi (as well as other instructions) in leela-zero/leela-zero#1772 (also see leela-zero/leela-zero#1599 for discussions).
ELF can't be used, but most LZ official networks work; the GX series networks seem to work particularly well with --min-wr 0.15 --max-wr 0.24.

Can I use it on the Mac or Linux?

You may compile the latest komi+next branch. Issue alreadydone/lz#57 may need merging latest gcp/next to be solved.

@zsalch
Copy link
Contributor Author

zsalch commented Sep 14, 2018

@alreadydone
Wow, Great Job!
I can't wait to try it.

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

5 participants