arXiv:2609.11923cs.DCSep 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2609.11923

GPU-CFR: 80x Faster Counterfactual Regret Minimization by Compiling the Game to Static Dataflow and CUDA Graph Replay

Boning Li, Longbo Huang

Boning Li 1^{1} and Longbo Huang 1^{1}

1^{1}Institute for Interdisciplinary Information Sciences, Tsinghua University

Correspondence: longbohuang@tsinghua.edu.cn

Abstract. Counterfactual regret minimization (CFR) is the standard solver for imperfect-information extensive-form games. It is also one of the few large numerical workloads that still runs faster on CPUs than on GPUs. Each iteration sweeps a game tree with up to billions of states in millions of small, interdependent gather and scatter steps issued through a generic tree interface. On a GPU every kernel finishes in microseconds, so kernel launches and framework dispatch dominate the run time, and prior GPU implementations have lost to optimized CPU code. We observe that for a fixed game, everything about a CFR iteration except the numerical values is known before the first iteration runs. We propose GPU-CFR, a compiler and runtime built on this observation. It compiles any two-player zero-sum perfect-recall game once into static dataflow: flat edge and information-set arrays, precomputed indices, and depth-level batched passes fix the entire operation sequence, and only solver state changes between iterations. Static chance folding, depth-level execution blocks, and a dual-lane reach buffer cut the number of framework operations by up to 18.1×. Because shapes, indices, and buffer addresses never change, CUDA Graph Replay records the iteration once and replays it with a single graph launch. On one A100, across an eight-game suite that spans card games, dice games, and board games, GPU-CFR runs 29.8–80.4× faster than the fastest prior GPU CFR on the same accelerator (median 44.1×), and 14–258× faster than LiteEFG, one of the fastest open-source CPU implementations, on the four largest games. The compiled representation carries most of that margin: on eight CPU threads with no accelerator it is already 2.2–51.1× faster than the GPU baseline. On the CPU the optimized path reproduces the reference iterates bitwise, and tree construction and graph capture pay for themselves within the first solve. GPU-CFR beats every CPU and GPU baseline on the mid-to-large games of the suite without changing the update rule. Code is available at https://github.com/lbn187/GPU-CFR.

1. Introduction

Counterfactual regret minimization (CFR) (Zinkevich et al., 2007) is the algorithm of choice for computing equilibria in large games of hidden information, a class that includes poker, bargaining, and adversarial security settings. Interestingly, tabular CFR has resisted the move to accelerators, and its fastest implementations still run on CPUs. Its execution model explains why. One iteration touches every node of a game tree in millions of tiny dependent steps. Each step chases a pointer, branches on the node type, and updates a handful of floats. Every read and write is therefore a data-dependent gather or scatter (Kim & Sandholm, 2026), and a wide processor finds nothing to batch in such a walk. Deployed implementations therefore still execute CFR as a node-wise tree traversal through a generic game interface (Lanctot et al., 2020; Liu et al., 2024; Steinberger, 2019b; Li & Huang, 2026e).

This cost matters because the solves are time-bound. Modern game-playing agents must solve a game tree with tens of millions of states within a few seconds during play (Burch et al., 2014; Ganzfried & Sandholm, 2015; Moravcik et al., 2016; Brown & Sandholm, 2017; Moravčík et al., 2017; Brown & Sandholm, 2018, 2019b; Šustr et al., 2019; Brown et al., 2018; Steinberger, 2019b), so the cost of one solver iteration bounds what any such agent can do. Tabular CFR and its CFR +^{+} refinement (Tammelin, 2014) produced the essential solution of heads-up limit hold'em (Bowling et al., 2015; Tammelin et al., 2015) and drive superhuman poker AIs (Brown & Sandholm, 2018; Moravčík et al., 2017; Brown & Sandholm, 2019b). The tabular form remains the field's workhorse: the reference against which every approximation is checked (Lanctot et al., 2009; Brown et al., 2019; Schmid et al., 2019), the source of the exact best-response evaluations that certify solution quality (Johanson et al., 2011; Li et al., 2026a; Li & Huang, 2026b), and the inner loop of online re-solving (Burch et al., 2014; Brown & Sandholm, 2017; Šustr et al., 2021; Li & Huang, 2025, 2026e).

That demand has driven many attempts to move the workload onto accelerators, and none has produced a GPU solver whose iteration time is below that of an efficient CPU implementation (Kim & Sandholm, 2026; Baghal, 2025). The milestone poker systems sidestepped the GPU entirely and used supercomputer-scale CPU parallelism instead (Bowling et al., 2015; Tammelin et al., 2015; Brown & Sandholm, 2018). Porting the traversal to a GPU shows why. Every kernel runs for microseconds, so the time goes into launching kernels and dispatching framework operations (NVIDIA Corporation, 2020; Paszke et al., 2019), and arithmetic is a small fraction of it. The fastest prior GPU CFR is the sequence-form (Koller & Pfeffer, 1997) implementation of Kim (2026) (Kim & Sandholm, 2026). It expresses each tree level as a sparse matrix product, yet its iteration still takes longer than an optimized CPU solver. Its iteration also cannot be recorded as a CUDA graph, because the sparse products and per-level index traffic it relies on are not capturable (Section 14). The obstacle lies in the representation the algorithm runs on, and the workload itself is unusually regular. When the same game is solved for many iterations, the tree topology, information sets, chance behavior, tensor shapes, and data dependencies stay constant. Only solver state changes: strategies, reaches, regrets, values, and the iteration weight. This raises a systems question. How much of tabular CFR's cost is an artifact of its execution plan, and how much of it can a compiler remove without touching the algorithm?

Figure

Figure 1 | Steady-state time per CFR iteration versus game size (both axes logarithmic; lower is better); backends and variants as in Table 3.

To remove these obstacles, we propose GPU-CFR, which treats a fixed game as a program to be compiled. GPU-CFR walks a game once (two players, zero-sum, perfect recall) and emits flat edge, information-set slot, and depth arrays. An iteration then becomes a fixed sequence of depth-level batched gather and scatter operations over those arrays. Three techniques shape the compiled iteration. Static chance folding moves all strategy-independent chance work to build time. Depth-level execution blocks collapse each traversal stage into one batched operation per tree level. A dual-lane reach buffer advances both players' reach probabilities in a single operation, and a sentinel slot removes the last per-edge branch. The resulting sequence has fixed shapes, indices, and buffer addresses, so CUDA Graph Replay (NVIDIA Corporation, 2020) records it once and replays it with one graph launch per iteration. The design separates the two sources of run-time cost. The compiled representation reduces the work issued to the tensor framework, and graph replay reduces the cost of issuing it.

The compiled iteration pays off most where the trees are largest. Figure 1 plots steady-state time per iteration against game size for every backend we test. The CPU libraries and the prior GPU implementation slow down as the tree grows. The graph-replayed GPU-CFR curve stays nearly flat, so the margin widens with scale. On one A100, a heads-up no-limit Texas hold'em (HUNL) turn subgame with 83,040 information sets (Infosets) runs at 0.397 ms per steady-state CFR +^{+} iteration. Against the matched A100 implementation of Kim (2026) (Kim & Sandholm, 2026), graph replay is 29.8–80.4× faster across the eight-game suite. Against LiteEFG (Liu et al., 2024), one of the fastest open-source CPU implementations, it is 14–258× faster on the four largest games. Most of this margin comes from the compiled representation itself: the same compiled solver on eight CPU threads already beats the A100 baseline by 2.2–51.1×. GPU-CFR in turn outperforms every CPU path we test, including that eight-thread arm and its one-socket scaling in Section 14.

We answer three systems questions. (Q1) How can a full CFR iteration be compiled into fixed tensor dataflow while preserving its update semantics? (Q2) Which gains come from the compiled representation and which come from CUDA Graph Replay? (Q3) When does the lower iteration cost translate into lower wall-clock time for solution quality and for repeated solves? Our contributions are:

  1. A game-to-dataflow compiler for tabular CFR. GPU-CFR maps a fixed game to flat arrays and a depth-level execution schedule, including static chance folding and a dual-lane reach representation (Figs. 2 and 3).

  2. CUDA Graph Replay with a causal performance decomposition. We separate representation cost from framework dispatch and graph-launch cost through operation counts, eager/graph ablations, scaling, and repeated-solve measurements.

  3. State-of-the-art GPU performance for tabular CFR. GPU-CFR runs 29.8–80.4× faster than the matched A100 baseline across the eight-game suite and outperforms every tested CPU path (Section 7).

References (45)