Closed fsmosca closed 3 years ago
A0lite's search uses only 1 thread. The neural network library (badgyal) does that
Can we control the number of threads used by the the neural network library?
Pytorch utilizes those threads. So you can set a limit with this (from documentation): https://pytorch.org/docs/stable/generated/torch.set_num_threads.html So you can set that in the code
Thanks it worked.
I revised the mgnet.py
, meangirl_net.py
, bgnet.py
and badgyal_net.py
.
And couple of modifications in engine.py
to expose the threads, cuda and net name.
A0 Lite
uci
id name A0 Lite
id author Dietrich Kappe
option name Threads type spin default 1 min 1 max 128
option name UseCuda type check default false
option name NetName type combo default meangirl var badgyal var meangirl
uciok
Cool, that is a cool pr idea, make a branch on your fork
Changes are now in the branch
I change Threads to TorchCPUThreads so as not to be confused with the normal engine Threads.
A0 Lite
uci
id name A0 Lite
id author Dietrich Kappe
option name TorchCPUThreads type spin default 1 min 1 max 128
option name UseCuda type check default false
option name NetName type combo default meangirl var badgyal var meangirl
uciok
There are also minor changes in the badgyal package.
My pc has 4 cores/8 threads, when a0lite is run it will use 4 threads. Is there any way to allow the user to control how many threads it should use?