To train DouZero, run the train.py script. By default, it trains on a single GPU.
GPU Training Configuration
To utilize multiple GPUs, use the following arguments:
--gpu_devices: Comma-separated list of visible GPU device indices.--num_actor_devices: Number of GPU devices used for simulation (self-play).--num_actors: Number of actor processes per simulation device.--training_device: The index of the GPU used for training.
Example (4 GPUs: 3 for simulation with 15 actors each, 1 for training):
python3 train.py --gpu_devices 0,1,2,3 --num_actor_devices 3 --num_actors 15 --training_device 3
CPU Training and Simulation
To run training or simulation on the CPU (required for Windows actors):
--training_device cpu: Use CPU for training.--actor_device_cpu: Use CPU for actors.
Example (Everything on CPU):
python3 train.py --actor_device_cpu --training_device cpu
Example (Only actors on CPU):
python3 train.py --actor_device_cpu
python3 train.py --gpu_devices 0,1,2,3 --num_actor_devices 3 --num_actors 15 --training_device 3