official-pikafish / Pikafish

UCI xiangqi engine
http://pikafish.org
GNU General Public License v3.0
867 stars 162 forks source link

32 threads were set, but only 16 threads are working #51

Closed 751620780 closed 11 months ago

751620780 commented 11 months ago

Describe the issue

When using 13900K CPU and set the number of threads to 32, it was found that only the E core was running at full capacity while the P-core was on the sidelines when using the the chess engine to play chinese chess.

Expected behavior

all cores on 13900K will be run fully by the engine

Steps to reproduce

uci
Pikafish 2023-04-08 by the Pikafish developers (see AUTHORS file)
id name Pikafish 2023-04-08
id author the Pikafish developers (see AUTHORS file)
option name Debug Log File type string default 
option name Threads type spin default 1 min 1 max 1024
option name Hash type spin default 16 min 1 max 33554432
option name Clear Hash type button
option name Ponder type check default false
option name MultiPV type spin default 1 min 1 max 500
option name Skill Level type spin default 20 min 0 max 20
option name Move Overhead type spin default 10 min 0 max 5000
option name Slow Mover type spin default 100 min 10 max 1000
option name nodestime type spin default 0 min 0 max 10000
option name Sixty Move Rule type check default true
option name Mate Threat Depth type spin default 1 min 0 max 10
option name Repetition Fold type combo default TwoFold var TwoFold var RootThreeFold var ThreeFold
option name Repetition Rule type combo default AsianRule var AsianRule var ChineseRule var SkyRule
option name UCI_LimitStrength type check default false
option name UCI_Elo type spin default 1350 min 1350 max 2850
option name UCI_WDLCentipawn type check default true
option name UCI_ShowWDL type check default false
option name EvalFile type string default pikafish.nnue
uciok
isready
readyok

// Match Rule
setoption name OwnBook value false
setoption name Threads value 32
setoption name Hash value 256
No such option: OwnBook

...

------------ply = 4, 卒7进1, movetime = 24000ms------------

Continuous 0,0,2,0,2,0,48,32,27001,0,0

OBK: 0,0,2,0,2,0,48,32,0,0,0,0,0,0

0,0,2,0,2,0,48,0,0,0

fen rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w - - 0 1 moves b2e2 b9c7 c3c4 g6g5
go btime 555609 wtime 557609 binc 5000 winc 5000 limittime 600000 steptime 30000 byotime 5000
info depth 12 seldepth 18 multipv 1 score 60 nodes 51778 nps 12944500 tbhits 0 time 4 pv b0c2 a9b9 a0b0 h9g7 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 h6g6 c5e7 c2d4 h7h5 i0h0
info depth 13 seldepth 24 multipv 1 score 55 nodes 114161 nps 16308714 tbhits 0 time 7 pv b0c2 a9b9 a0b0 g9e7 h0i2 h9g7 h2h6 c6c5 c4c5 e7c5 h6g6 c5e7 c2d4 h7h5 g3g4 g5g4 d4f5
info depth 14 seldepth 28 multipv 1 score 70 nodes 161487 nps 16148700 tbhits 0 time 10 pv b0c2 a9b9 a0b0 h9g7 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 h6g6 i9h9 c2d4 h7i7 d4f5 h9h6 f5d6 h6g6
info depth 15 seldepth 26 multipv 1 score 72 nodes 396564 nps 16523500 tbhits 0 time 24 pv b0c2 a9b9 a0b0 g9e7 h0i2 h9g7 h2h6 c6c5 c4c5 e7c5 c2d4 c5e7 h6g6 h7h5 g3g4 g5g4 d4f5 b7a7 b0b9 c7b9 f5h6 i9h9 h6g8 e9e8
info depth 16 seldepth 21 multipv 1 score 72 nodes 417116 nps 16684640 tbhits 0 time 25 pv b0c2 a9b9 a0b0 g9e7 h0i2 h9g7 h2h6 c6c5 c4c5 e7c5 c2d4 c5e7 h6g6 h7h5 g3g4 g5g4 d4f5 b7a7 b0b9 c7b9 f5h6
info depth 17 seldepth 28 multipv 1 score 74 nodes 483753 nps 16681137 tbhits 0 time 29 pv b0c2 a9b9 a0b0 g9e7 h0i2 h9g7 h2h6 c6c5 c4c5 e7c5 c2d4 c5e7 h6g6 h7h5 g3g4 g5g4 d4f5 b7a7 b0b9 c7b9 f5h6 i9h9 h6g8 e9e8 i0i1 h5h1 e2e6 g7e6
info depth 18 seldepth 36 multipv 1 score 72 nodes 791824 nps 16496333 tbhits 0 time 48 pv b0c2 h9g7 a0b0 a9b9 h0i2 i9i8 h2g2 g7h5 g3g4 g5g4 g2g9 f9e8 b0b6 b7a7 b6c6 b9b7 g9h9 c9e7 c6a6 h7h6 a6a4 h5f4 i0h0
info depth 19 seldepth 29 multipv 1 score 64 nodes 1320164 nps 15174298 tbhits 0 time 87 pv b0c2 a9b9 a0b0 h9g7 h0i2 c9e7 h2g2 g7h5 c2d4 i6i5 i0i1 i5i4 i3i4 i9i4 i1d1 i4f4 d4e6 c7e6 e2e6 d9e8 e6e4 h5i3
info depth 20 seldepth 32 multipv 1 score 49 nodes 2230947 nps 13943418 tbhits 0 time 160 pv b0c2 a9b9 a0b0 h9g7 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 c2d4 c5e7 h6g6 h7h5 g3g4 g5g4 d4f5 b7a7 b0b9 c7b9 f5h6 i9h9 h6g8 e9e8 i0i1 h5h1 e2e6 e8f8 e6e4 g4f4 e4e5
info depth 21 seldepth 32 multipv 1 score 82 nodes 2656869 nps 13695201 tbhits 0 time 194 pv b0c2 h9g7 a0b0 a9b9 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 h6g6 c5e7 c2d4 h7h5 b0b6 c7d5 b6b3 d5c7 i0h0 i9h9 d4c6 b7a7 b3b9
info depth 22 seldepth 33 multipv 1 score 47 nodes 4448248 nps 12425273 tbhits 0 time 358 pv b0c2 h9g7 a0b0 a9b9 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 c2d4 c5e7 h6g6 h7h5 b0b6 c7d5 b6b3 d5c7 d4c6 i9h9 b3b6 f9e8 i0h0 b7a7 b6b9 c7b9 h0h4 h9h6 c6a7 b9a7 g6a6
info depth 23 seldepth 31 multipv 1 score 37 nodes 5086307 nps 12168198 tbhits 0 time 418 pv b0c2 h9g7 a0b0 a9b9 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 h6g6 c5e7 c2d4 h7h5 g3g4 g5g4 d4f5 b7a7 b0b9 c7b9 f5h6 i9h9 e2e6 f9e8 e6c6 g7e6 h6g8 e9f9 i0i1 e6f4 i1f1
info depth 24 seldepth 34 multipv 1 score 40 nodes 6587647 nps 11742686 tbhits 0 time 561 pv b0c2 h9g7 a0b0 a9b9 h0i2 g9e7 i0i1 f9e8 i1g1 g7f5 h2h6 c6c5 c4c5 e7c5 h6h5 i9f9 g1f1 b7b5 h5f5 f9f5 f1f5 b5f5 b0b9 c7b9 e2e6 c5e7 c2d4 f5e5 g0e2 b9c7
info depth 25 seldepth 37 multipv 1 score 48 nodes 7860816 nps 11425604 tbhits 0 time 688 pv b0c2 h9g7 a0b0 a9b9 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 h6g6 c5e7 i0h0 i9h9 c2d4 h7h5 b0b6 c7d5 b6d6 d5f4 d4e6 f4e6 e2e6 g7e6 d6e6 b7b0 g6h6 h5i5 h6a6 h9h0 i2h0
info depth 26 seldepth 38 multipv 1 score 31 nodes 10198742 nps 11121856 tbhits 0 time 917 pv b0c2 h9g7 h0i2 a9b9 a0b0 g9e7 i0i1 f9e8 i1g1 g7f5 h2h6 c6c5 c4c5 e7c5 h6h5 i9f9 g1f1 b7b5 h5f5 f9f5 e2e6 h7e7 f1f5 b5f5 b0b9 c7b9 c0e2 b9c7 e6e5
info depth 27 seldepth 41 multipv 1 score 33 nodes 14395025 nps 10782790 hashfull 272 tbhits 0 time 1335 pv b0c2 a9b9 a0b0 h9g7 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 c2d4 c5e7 h6g6 h7h5 i0h0 i9h9 h0h4 c7b5 e2b2 b7b2 b0b2 b5c7 b2b9 c7b9 g6a6 b9c7 a6c6 c7a6 i3i4 f9e8 g0e2 a6c5 c6c7 c5d7 g3g4 g5g4 h4g4
info depth 28 seldepth 40 multipv 1 score 40 nodes 16288767 nps 10667168 hashfull 312 tbhits 0 time 1527 pv b0c2 a9b9 a0b0 h9g7 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 c2d4 c5e7 i0i1 f9e8 i1c1 b7a7 b0b9 c7b9 d4e6 g7e6 e2e6 i9f9 e6i6 a7a3 c1c3 a3a4 c3c6 a6a5 c6g6 b9c7 h6h5 h7i7 e3e4 f9h9 h5a5 c7b5 e4e5
info depth 29 seldepth 39 multipv 1 score 38 nodes 18684013 nps 10603866 hashfull 346 tbhits 0 time 1762 pv b0c2 a9b9 a0b0 h9g7 h0i2 g9e7 h2h6 c6c5 c4c5 e7c5 c2d4 c5e7 h6g6 h7h5 i0h0 i9h9 g3g4 g5g4 d4f5 c7b5 e2b2 h5g5 h0h9 g7h9 g6g4 b7b2 b0b2 b9b6 g4g1 b6c6 g0e2 c6c5 f5d6
info depth 30 seldepth 43 multipv 1 score 26 nodes 30905292 nps 10336218 hashfull 523 tbhits 0 time 2990 pv b0c2 h9g7 h0i2 g9e7 i0i1 a9b9 a0b0 f9e8 i1g1 g7f5 h2h6 c6c5 c4c5 e7c5 h6h5 i9f9 g1f1 b7b5 b0b4 h7f7 f1h1 f9h9 h1h0 h9h6 h5f5 h6h0 i2h0 b5f5 b4b9 c7b9 e2e6 c5e7 c2d4 b9c7 e6c6 f5f4 d4f5 f7i7 h0g2 i6i5
info depth 31 seldepth 40 multipv 1 score 43 lowerbound nodes 36083162 nps 10221858 hashfull 581 tbhits 0 time 3530 pv b0c2
info depth 31 seldepth 44 multipv 1 score 29 nodes 42963301 nps 10075821 hashfull 656 tbhits 0 time 4264 pv b0c2 h9g7 h0i2 a9b9 a0b0 i9i8 h2g2 g7h5 g3g4 g5g4 g2g9 f9e8 b0b6 h5f4 i0h0 i8i9 g9g8 h7e7 g8g7 e7e3 c2e3 b7g7 b6c6 f4d3 c6d6 b9b3 e3g4 i9g9 c4c5 g7f7 h0h4 b3c3 f0e1 d3c5 d6c6
info depth 32 seldepth 47 multipv 1 score 46 lowerbound nodes 44334622 nps 10057763 hashfull 670 tbhits 0 time 4408 pv b0c2
info depth 32 seldepth 47 multipv 1 score 48 nodes 45566255 nps 10052118 hashfull 680 tbhits 0 time 4533 pv b0c2 a9b9 a0b0 h9g7 h0i2 i9i8 h2g2 g7h5 g3g4 g5g4 g2g9 f9e8 b0b6 h5f4 i0h0 i8i9 g9g8 h7e7 g8g7 e7e3 c2e3 b7g7 b6b9 c7b9 e3g4 i9g9 g4h6 g7e7 d0e1 e7e2 g0e2 e6e5 i3i4 b9c7 i2h4 c7e6 h4i6 e5e4
info depth 33 seldepth 43 multipv 1 score 31 upperbound nodes 48952510 nps 9992347 hashfull 705 tbhits 0 time 4899 pv b0c2 h9g7
info depth 33 seldepth 44 multipv 1 score 39 nodes 69258830 nps 9690615 hashfull 839 tbhits 0 time 7147 pv b0c2 h9g7 a0b0 a9b9 h0i2 g9e7 i0i1 f9e8 i1g1 g7f5 h2h6 c6c5 c4c5 e7c5 h6h5 i9f9 g1f1 b7b5 f1f4 c9e7 b0b4 f5g7 f4f9 e8f9 h5h6 b5b8 g3g4 b8g8 b4b9 c7b9 e2g2 g7h5 g4g5 g8g2 g5h5 h7h5 i2g3 h5e5 d0e1
bestmove b0c2 ponder h9g7

23/09/18 23:39:44,0,0,2,0,2,0,48,50341,0,fen rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w - - 0 1 moves b2e2 b9c7 c3c4 g6g5

GetBM: 0,0,2,0,2,0,50341,0,0,0

Anything else?

20230918235739

Operating system

Windows

Pikafish version

Pikafish 2023-04-08

xiangqishare commented 11 months ago

用的是哪个GUI?

751620780 commented 11 months ago

冰河五四 v3.6

751620780 commented 11 months ago

使用命令行,手动输入命令方式运行引擎时,可以做到32个线程,24个物理核心都满载 20230919123951

xiangqishare commented 11 months ago

冰河五四 v3.6

看看兵河的设置有没有什么线程优先级或者节能之类的,应该是界面问题

751620780 commented 11 months ago

使用鲨鱼象棋也一样,只能跑16线程

xiangqishare commented 11 months ago

使用鲨鱼象棋也一样,只能跑16线程

不是引擎问题,就不清楚了。我见过其他人的13900k都可以正常运行

sum2012 commented 11 months ago

I suggest write your own program which act as a proxy of Pikafish , force input "setoption name Threads value 32" 我建议你编写自己的程式作为 Pikafish 的代理,强制输入“setoption name Threads value 32”

751620780 commented 11 months ago

找到问题的原因了,我使用的硬件是13代CPU,操作系统是windows 10 22 h2 ,这个版本的操作系统存在大小核调度问题。当程序处于前台时(例如cmd窗口在前台运行),CPU能充分利用全部核心,但是当程序置于后台运行时无法利用全部核心。我使用了如下链接给出的修复建议已经顺利解决此问题。目前13900K已经能够满载运行后台的pikafish象棋引擎了。 https://www.bilibili.com/video/BV1LK411B7ZS 20231005123342