Replies: 12 comments 3 replies
-
Your environment is pretty slow. It takes about 1-2 minutes for an episode of chess using 100 MCTS sims if mid-level gpu (like 2070) is used. You could reread your code to find potentially redundant instructions like https://github.com/goshawk22/alpha-zero-chess/blob/0ebedbd18dd7552a45cf27dc783eeb97713db936/localchess/ChessGame.py#L46 Furthermore, you could profile your program with python profilers like cprofile. Besides the optimization, I see that you haven't implemented all chess rules. If your action space is 64x64 your game doesn't know about promotion to other pieces except queen. |
Beta Was this translation helpful? Give feedback.
-
I'll have a look to see if I can find any more bottlenecks. |
Beta Was this translation helpful? Give feedback.
-
I thought I would see if I could get it to work before I implemented any more complicated moves, and often a promotion will be a queen anyway. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, it doesn't work even at 100-200 MCTS x 1000 episodes. I suppose, the game of chess requires much more computations per iteration to get noticeable increment of performance. |
Beta Was this translation helpful? Give feedback.
-
You might also be interested in Issue #205 which points out a grave defect in the MCTS code. |
Beta Was this translation helpful? Give feedback.
-
I was thinking of getting a free trial on oracle cloud and getting a good GPU for 3 days or so to train it. This might get some results. |
Beta Was this translation helpful? Give feedback.
-
Maybe I should implement it based off your repo alpha-nagibator |
Beta Was this translation helpful? Give feedback.
-
It definitely has multithreading support and I was able to get good enough performance in checkers comparing to one of the best classical checkers program available in the internet. I think it'll take more than 3 days of gpu time to get to the same level of performance. |
Beta Was this translation helpful? Give feedback.
-
Does your repo play multiple games at once or run multiple MCTS simulations at once? I wonder which would have the best performance gains. |
Beta Was this translation helpful? Give feedback.
-
Multiple games at once each holding its own MCTS tree and all MCTS instances communicate with single NN model. Running multiple MCTS simulations at once is more efficient but more tricky because we should resolve collisions, I didn't implement this. |
Beta Was this translation helpful? Give feedback.
-
I have a working chess implementation here. Everything works, however, because of the complex nature of chess, it takes about ~10 minutes to play a game in self play and about 20 minutes when it evaluates the agent. This really makes training a good model unviable with the limited computing power available. I don't know how this will change if the MCTS is asynchronous but at the moment it seems that it won't work.
I am currently training a model 10 eps self play and 25 MCTS sims. I also implemented a ResNet architecture in Keras based on the official paper.
I don't know if it will speed up after the Neural Network has been trained?
Any ideas how I might speed this up?
Beta Was this translation helpful? Give feedback.
All reactions