LeelaChessZero / lc0

The rewritten engine, originally for tensorflow. Now all other backends have been ported here.
GNU General Public License v3.0
2.38k stars 525 forks source link

auto setting of threads and task workers #1930

Closed borg323 closed 9 months ago

borg323 commented 10 months ago

This is the second part of the auto-configuration changes. It doesn't change the behavior for any explicitly set value, but the new defaults lead to the following:

  1. Threads are set according to the backend specified value, plus 1 for non-cpu backends.
  2. The backends request 1 thread except for cuda with multi-stream, multiplexing and round-robin.
  3. The task workers are set to 0 for cpu backends, otherwise to cpu_cores/(threads-1) up to a max of 4.
  4. The multiplexing and roundrobin backends suggest for minibatch the min of the values of the used backends. For the demux backend this is multiplied by the number of (backend) threads.

This is changing the default for cpu backends to 1 thread and may reduce task-workers (apparently this is generally expected of cpu engines). Multiplexing backends should now get a decent starting configuration.