Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

GPUGT

GPU parallelizable implementation of counterfactual regret minimization.

Scripts

Convert games from OpenSpiel.

python scripts/open-spiel-game.py kuhn_poker | python scripts/compress.py > games/kuhn-poker.json
python scripts/open-spiel-game.py leduc_poker | python scripts/compress.py > games/leduc-poker.json
python scripts/open-spiel-game.py liars_dice | python scripts/compress.py > games/liars-dice.json
python scripts/open-spiel-game.py 'battleship(board_height=2,board_width=2,ship_sizes=[2],ship_values=[1],num_shots=3)' | python scripts/compress.py > games/battleship-tiny.json
python scripts/open-spiel-game.py 'battleship(board_height=3,board_width=2,ship_sizes=[2],ship_values=[1],num_shots=3)' | python scripts/compress.py > games/battleship-small.json
python scripts/open-spiel-game.py 'battleship(board_height=4,board_width=4,ship_sizes=[1],ship_values=[1],num_shots=2)' | python scripts/compress.py > games/battleship-medium.json
python scripts/open-spiel-game.py 'battleship(board_height=3,board_width=3,ship_sizes=[1;2],ship_values=[1;1],num_shots=2)' | python scripts/compress.py > games/battleship-large.json
python scripts/open-spiel-game.py 'battleship(board_height=3,board_width=2,ship_sizes=[2],ship_values=[1],num_shots=4)' | python scripts/compress.py > games/battleship-huge.json

Solve games using GPUGT.

python scripts/solve.py \
    games/kuhn-poker.json \
    gpugt.games.TwoPlayerZeroSumExtensiveFormGame \
    gpugt.regret_minimizers.CounterfactualRegretMinimization \
    1024 \
    -a \
    -e figures/gpugt/exploitabilities/kuhn-poker.pdf \
    -v figures/gpugt/values/kuhn-poker.pdf \
    -n "Kuhn poker" \
    > data/gpugt/kuhn-poker.json
python scripts/solve.py \
    games/leduc-poker.json \
    gpugt.games.TwoPlayerZeroSumExtensiveFormGame \
    gpugt.regret_minimizers.CounterfactualRegretMinimization \
    1024 \
    -a \
    -e figures/gpugt/exploitabilities/leduc-poker.pdf \
    -v figures/gpugt/values/leduc-poker.pdf \
    -n "Leduc poker" \
    > data/gpugt/leduc-poker.json
python scripts/solve.py \
    games/liars-dice.json \
    gpugt.games.TwoPlayerZeroSumExtensiveFormGame \
    gpugt.regret_minimizers.CounterfactualRegretMinimization \
    1024 \
    -a \
    -e figures/gpugt/exploitabilities/liars-dice.pdf \
    -v figures/gpugt/values/liars-dice.pdf \
    -n "liar's dice" \
    > data/gpugt/liars-dice.json
python scripts/solve.py \
    games/battleship-tiny.json \
    gpugt.games.TwoPlayerZeroSumExtensiveFormGame \
    gpugt.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/gpugt/values/battleship-tiny.pdf \
    -n "battleship (tiny)" \
    > data/gpugt/battleship-tiny.json
python scripts/solve.py \
    games/battleship-small.json \
    gpugt.games.TwoPlayerZeroSumExtensiveFormGame \
    gpugt.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/gpugt/values/battleship-small.pdf \
    -n "battleship (small)" \
    > data/gpugt/battleship-small.json
python scripts/solve.py \
    games/battleship-medium.json \
    gpugt.games.TwoPlayerZeroSumExtensiveFormGame \
    gpugt.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/gpugt/values/battleship-medium.pdf \
    -n "battleship (medium)" \
    > data/gpugt/battleship-medium.json
python scripts/solve.py \
    games/battleship-large.json \
    gpugt.games.TwoPlayerZeroSumExtensiveFormGame \
    gpugt.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/gpugt/values/battleship-large.pdf \
    -n "battleship (large)" \
    > data/gpugt/battleship-large.json
python scripts/solve.py \
    games/battleship-huge.json \
    gpugt.games.TwoPlayerZeroSumExtensiveFormGame \
    gpugt.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/gpugt/values/battleship-huge.pdf \
    -n "battleship (huge)" \
    > data/gpugt/battleship-huge.json

Solve games using NoRegret.

python scripts/solve.py \
    games/kuhn-poker.json \
    noregret.games.TwoPlayerZeroSumExtensiveFormGame \
    noregret.regret_minimizers.CounterfactualRegretMinimization \
    1024 \
    -a \
    -e figures/noregret/exploitabilities/kuhn-poker.pdf \
    -v figures/noregret/values/kuhn-poker.pdf \
    -n "Kuhn poker" \
    > data/noregret/kuhn-poker.json
python scripts/solve.py \
    games/leduc-poker.json \
    noregret.games.TwoPlayerZeroSumExtensiveFormGame \
    noregret.regret_minimizers.CounterfactualRegretMinimization \
    1024 \
    -a \
    -e figures/noregret/exploitabilities/leduc-poker.pdf \
    -v figures/noregret/values/leduc-poker.pdf \
    -n "Leduc poker" \
    > data/noregret/leduc-poker.json
python scripts/solve.py \
    games/liars-dice.json \
    noregret.games.TwoPlayerZeroSumExtensiveFormGame \
    noregret.regret_minimizers.CounterfactualRegretMinimization \
    1024 \
    -a \
    -e figures/noregret/exploitabilities/liars-dice.pdf \
    -v figures/noregret/values/liars-dice.pdf \
    -n "liar's dice" \
    > data/noregret/liars-dice.json
python scripts/solve.py \
    games/battleship-tiny.json \
    noregret.games.TwoPlayerZeroSumExtensiveFormGame \
    noregret.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/noregret/values/battleship-tiny.pdf \
    -n "battleship (tiny)" \
    > data/noregret/battleship-tiny.json
python scripts/solve.py \
    games/battleship-small.json \
    noregret.games.TwoPlayerZeroSumExtensiveFormGame \
    noregret.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/noregret/values/battleship-small.pdf \
    -n "battleship (small)" \
    > data/noregret/battleship-small.json
python scripts/solve.py \
    games/battleship-medium.json \
    noregret.games.TwoPlayerZeroSumExtensiveFormGame \
    noregret.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/noregret/values/battleship-medium.pdf \
    -n "battleship (medium)" \
    > data/noregret/battleship-medium.json
python scripts/solve.py \
    games/battleship-large.json \
    noregret.games.TwoPlayerZeroSumExtensiveFormGame \
    noregret.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/noregret/values/battleship-large.pdf \
    -n "battleship (large)" \
    > data/noregret/battleship-large.json
python scripts/solve.py \
    games/battleship-huge.json \
    noregret.games.TwoPlayerZeroSumExtensiveFormGame \
    noregret.regret_minimizers.CounterfactualRegretMinimization \
    8 \
    -a \
    -v figures/noregret/values/battleship-huge.pdf \
    -n "battleship (huge)" \
    > data/noregret/battleship-huge.json

Solve games using OpenSpiel (C++).

python scripts/open-spiel-solve.py \
    kuhn_poker \
    pyspiel.CFRSolver \
    1024 \
    -e figures/pyspiel/exploitabilities/kuhn-poker.pdf \
    > data/pyspiel/kuhn-poker.json
python scripts/open-spiel-solve.py \
    leduc_poker \
    pyspiel.CFRSolver \
    1024 \
    -e figures/pyspiel/exploitabilities/leduc-poker.pdf \
    > data/pyspiel/leduc-poker.json
python scripts/open-spiel-solve.py \
    liars_dice \
    pyspiel.CFRSolver \
    1024 \
    -e figures/pyspiel/exploitabilities/liars-dice.pdf \
    > data/pyspiel/liars-dice.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=2,board_width=2,ship_sizes=[2],ship_values=[1],num_shots=3)' \
    pyspiel.CFRSolver \
    8 \
    > data/pyspiel/battleship-tiny.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=3,board_width=2,ship_sizes=[2],ship_values=[1],num_shots=3)' \
    pyspiel.CFRSolver \
    8 \
    > data/pyspiel/battleship-small.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=4,board_width=4,ship_sizes=[1],ship_values=[1],num_shots=2)' \
    pyspiel.CFRSolver \
    8 \
    > data/pyspiel/battleship-medium.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=3,board_width=3,ship_sizes=[1;2],ship_values=[1;1],num_shots=2)' \
    pyspiel.CFRSolver \
    8 \
    > data/pyspiel/battleship-large.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=3,board_width=2,ship_sizes=[2],ship_values=[1],num_shots=4)' \
    pyspiel.CFRSolver \
    8 \
    > data/pyspiel/battleship-huge.json

Solve games using OpenSpiel (Python).

python scripts/open-spiel-solve.py \
    kuhn_poker \
    open_spiel.python.algorithms.cfr.CFRSolver \
    8 \
    > data/open-spiel/kuhn-poker.json
python scripts/open-spiel-solve.py \
    leduc_poker \
    open_spiel.python.algorithms.cfr.CFRSolver \
    8 \
    > data/open-spiel/leduc-poker.json
python scripts/open-spiel-solve.py \
    liars_dice \
    open_spiel.python.algorithms.cfr.CFRSolver \
    8 \
    > data/open-spiel/liars-dice.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=2,board_width=2,ship_sizes=[2],ship_values=[1],num_shots=3)' \
    open_spiel.python.algorithms.cfr.CFRSolver \
    8 \
    > data/open-spiel/battleship-tiny.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=3,board_width=2,ship_sizes=[2],ship_values=[1],num_shots=3)' \
    open_spiel.python.algorithms.cfr.CFRSolver \
    8 \
    > data/open-spiel/battleship-small.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=4,board_width=4,ship_sizes=[1],ship_values=[1],num_shots=2)' \
    open_spiel.python.algorithms.cfr.CFRSolver \
    8 \
    > data/open-spiel/battleship-medium.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=3,board_width=3,ship_sizes=[1;2],ship_values=[1;1],num_shots=2)' \
    open_spiel.python.algorithms.cfr.CFRSolver \
    8 \
    > data/open-spiel/battleship-large.json
python scripts/open-spiel-solve.py \
    'battleship(board_height=3,board_width=2,ship_sizes=[2],ship_values=[1],num_shots=4)' \
    open_spiel.python.algorithms.cfr.CFRSolver \
    8 \
    > data/open-spiel/battleship-huge.json

Summarize results.

python scripts/summary.py \
    8 \
    data/gpugt/kuhn-poker.json \
    data/gpugt/leduc-poker.json \
    data/gpugt/liars-dice.json \
    data/gpugt/battleship-tiny.json \
    data/gpugt/battleship-small.json \
    data/gpugt/battleship-medium.json \
    data/gpugt/battleship-large.json \
    data/gpugt/battleship-huge.json \
    data/noregret/kuhn-poker.json \
    data/noregret/leduc-poker.json \
    data/noregret/liars-dice.json \
    data/noregret/battleship-tiny.json \
    data/noregret/battleship-small.json \
    data/noregret/battleship-medium.json \
    data/noregret/battleship-large.json \
    data/noregret/battleship-huge.json \
    data/pyspiel/kuhn-poker.json \
    data/pyspiel/leduc-poker.json \
    data/pyspiel/liars-dice.json \
    data/pyspiel/battleship-tiny.json \
    data/pyspiel/battleship-small.json \
    data/pyspiel/battleship-medium.json \
    data/pyspiel/battleship-large.json \
    data/pyspiel/battleship-huge.json \
    data/open-spiel/kuhn-poker.json \
    data/open-spiel/leduc-poker.json \
    data/open-spiel/liars-dice.json \
    data/open-spiel/battleship-tiny.json \
    data/open-spiel/battleship-small.json \
    data/open-spiel/battleship-medium.json \
    data/open-spiel/battleship-large.json \
    data/open-spiel/battleship-huge.json \
    > data/summary.csv
python scripts/plot.py figures/plot.pdf < data/summary.csv
python scripts/latex.py < data/summary.csv > data/latex.tex

Citing

If you use GPUGT in your research, please cite our preprint:

@misc{kim2024gpuacceleratedcounterfactualregretminimization,
      title={GPU-Accelerated Counterfactual Regret Minimization},
      author={Juho Kim},
      year={2024},
      eprint={2408.14778},
      archivePrefix={arXiv},
      primaryClass={cs.GT},
      url={https://arxiv.org/abs/2408.14778},
}

Metadata

Release files for gpugt 0.0.0.dev2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpugt 0.0.0.dev2
File Size Uploaded Provenance Actions
gpugt-0.0.0.dev2.tar.gz 8.8 kB Without provenance Details for gpugt-0.0.0.dev2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gpugt 0.0.0.dev2
File Interpreter ABI Platform Actions
gpugt-0.0.0.dev2-py3-none-any.whl Python 3 none any Details for gpugt-0.0.0.dev2-py3-none-any.whl

Total release size: 16.3 kB

Release files / gpugt-0.0.0.dev2.tar.gz

Download URL gpugt-0.0.0.dev2.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e864e277c9e6f3990e3c28d113c43d5073a01c5c653499a59c8867fdd53912d5
BLAKE2b-256 checksum
How to use checksums
970a2723591cb3e29ba4a4a1870503abd7f2dc973ab529af7d2b4a1b212aac7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / gpugt-0.0.0.dev2-py3-none-any.whl

Download URL gpugt-0.0.0.dev2-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7603b16390ac6a5005e95068fba89c18bc9e56a7e06bf99a850179358be093be
BLAKE2b-256 checksum
How to use checksums
be1d9beb14b4c1e378220e6c0620089aa75ee65fa3d5661958cea6195719e159
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for gpugt 0.0.0.dev2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page