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

Did the newest code can implement stmkomi? #109

Open
pangafu opened this issue Oct 11, 2019 · 5 comments
Open

Did the newest code can implement stmkomi? #109

pangafu opened this issue Oct 11, 2019 · 5 comments

Comments

@pangafu
Copy link

pangafu commented Oct 11, 2019

I notice in patch-39
std::vector Network::gather_features
change to
std::vector<uint8_t> Network::gather_features

So if there is a way to implement stmkomi code? thanks~

@pangafu
Copy link
Author

pangafu commented Oct 11, 2019

I think gpu worker and batchsize seperate maybe greater for stm komi, can you implement the stm komi to the newest code?

@alreadydone
Copy link
Owner

In order to change the stm (color) planes in patch-39, you need to modify the fourth and fifth parameters of forward0 (btm and wtm):

const float btm, const float wtm,

lz/src/Network.cpp

Lines 815 to 816 in 70a8aff

auto tomove = state->get_to_move();
m_forward->forward0(gnum, i, gather_features(state, symmetry), !tomove, tomove, tomove, symmetry, result);

m_network.get_output0(gnum, i, bd, Network::Ensemble::RANDOM_SYMMETRY);

play_simulation(std::move(rootstate), root, pending_counter, gnum, i);

When I get a chance I'll try to implement dynamic komi over patch-39, and you are certainly welcome to implement it in the meantime.

Regarding workers and batchsizes: the official branch uses search threads that can send positions to any of the GPUs, while my branch (patch-39 etc.) assigns dedicated worker threads for each GPU and allows the number of worker threads and the batch size configured for each GPU separately. My approach reduces contention between threads and allows a higher n/s to be achieved with many GPUs, but I am not seeing why it might be greater for stm komi.

@pangafu
Copy link
Author

pangafu commented Oct 12, 2019

The offical branch search too wide when batchsize is large, and stm komi is not well training, many low pn search position will cause bad value, so maybe limit worker number will make search more reasonable.

Wait for your stm komi code~ thanks a lot!

@pangafu
Copy link
Author

pangafu commented Oct 12, 2019

And in my test, in patch-39, when use offical weight, if increase worker number upper than 2 (such as 3), the gpu usage will increase, pos also increase, but can't beat woker number = 2.

So I think think the weight now seem has many fault value in low pn position, because pn is low mean the weight not well training in that way, search too wide maybe mean more fault.

@pangafu
Copy link
Author

pangafu commented Oct 12, 2019

Also in stm komi test, when I use 4 or 8 gpu, batchsize > 8 in offical branch stm komi code, the handicap capability is lower than 1 gpu, batchsize = 2/3 run in long time.

So maybe stm komi not suitable search that wide.

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