Counterfactual regret minimization (CFR) is a core algorithm for solving imperfect-information games, most notably poker. Oddly, it has remained one of the few heavy numerical workloads where standard CPUs outperformed GPUs: each iteration sweeps a game tree with up to billions of states through many small, interdependent gather and scatter operations, which on a GPU means kernel launch overhead dominates rather than actual computation.
A team of researchers introduces GPU-CFR, a compiler and runtime built around a straightforward insight: for a fixed game, the entire sequence of operations in a CFR iteration is known ahead of time, and only the numerical values change between iterations. The system compiles the game once into a static dataflow representation — flat edge and information-set arrays, precomputed indices, and depth-level batched passes — cutting the number of framework operations by up to 18-fold.
Because this structure never changes shape, the system can rely on CUDA Graph Replay: the iteration is recorded once and then replayed through a single graph launch, bypassing the usual dispatch overhead. Tested on an A100 GPU across an eight-game suite spanning card games, dice games, and board games, GPU-CFR runs 29.8 to 80.4 times faster than the best prior GPU implementations, and 14 to 258 times faster than LiteEFG, a leading open-source CPU baseline, on the four largest games.
Notably, much of the speedup comes from the compilation strategy itself rather than the hardware: running on eight CPU threads with no accelerator, the optimized path is already 2.2 to 51.1 times faster than the original GPU baseline, while reproducing reference results bit-for-bit. The work suggests that rethinking how an algorithm is compiled, rather than simply porting it to a GPU, can unlock substantial performance gains for workloads previously considered poorly suited to that hardware.