I’m always on the lookout for interesting and novel uses of technology – especially when it involves technology that Critical Link works with. So naturally, I was drawn to an article I saw a few weeks back on Hackaday that talked about some Cornell students who built a pokerbot on an FPGA.
The bot uses the principle of Monte Carlo simulation to calculate the probabilities of an individual winning a hand of Limit Texas Hold’em. Calculating the entire set of possible hands is impractical, so in a Monte Carlo simulation a sample is calculated instead. By accelerating these calculations on an FPGA, the pokerbot is able to calculate 300,000 possible hands in just 150 ms, and present a probability of winning to the human player. This same calculation method is then used to make decisions for the computer players in the game, too.
The students – Drew Dunne, Jacob Glueck, and Michael Solomentsev produced an excellent paper on their project. Here are a few of the high points.
- Two of the students involved are poker players; the third isn’t. In fact, they claim that, even after they completed their work, he still doesn’t know how to play. (For whatever reason, I found this pretty funny. Then again, as an engineer, I’ve often worked on systems where I didn’t have a ton of domain knowledge of the application!)
- Because there are so many possible game states in poker, it lends itself to Monte Carolo simulations. (Guess that gambling’s where the name Monte Carlo simulation comes from…) Rather than evaluate all the possible hands, which the students decided would be overkill, they chose to evaluate “a randomly distributed subset” of all the possible states, to “produce an indication of how strong a player’s hand is.”
- The hardware deployed “is made up of multiple modules stitched together on the FPGA.”
There’s lots of great detail in the paper the students wrote. But the best news was the results:
- The FPGA-based poker bot had it all over alternatives when it comes to hardware acceleration. “It runs about 4000 times faster than a (unoptimized) C++ version on the ARM Hard Processor System (HPS), and about 10 times faster than the C++ version on an Intel i7-6700HQ laptop processor.”
Of course, having a poker bot by your side to clue you in on the probability of your holding a winning hand does kind of sound like cheating. Sort of like card counting. But I’m not much of a gambler to begin with, so I’ll just end with the immortal words of Kenny Rogers, “you gotta know when to hold em, know when to fold ‘em, know when to walk away, know when to run.” Sounds like the FPGA poker bot would help you do just that.