suragnair / alpha-zero-general

A clean implementation based on AlphaZero for any game in any framework + tutorial + Othello/Gobang/TicTacToe/Connect4 and more
MIT License
3.9k stars 1.04k forks source link

self play is exceptionally slow on GPU #293

Open dberma15 opened 1 year ago

dberma15 commented 1 year ago

I'm using the code as is on Othello in tensoeflow and I'm finding it to be an order of magnitude slower on GPU compared to cpu. Is there a reason for this?

nullne commented 9 months ago

GPU isn't used when self play

zjusbo commented 1 week ago

The time might be wasted when copying the data from CPU memory to GPU and then copy it back.

The NN forward uses GPU, other operations use CPU in the selfplay.