Skip to content

Commit

Permalink
polish(pu): polish atari ddp configs
Browse files Browse the repository at this point in the history
  • Loading branch information
puyuan1996 committed Dec 19, 2024
1 parent be54aac commit 9c880ad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dizoo/atari/config/serial/pong/pong_dqn_ddp_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
Overview:
This script should be executed with <nproc_per_node> GPUs.
Run the following command to launch the script:
python -m torch.distributed.launch --nproc_per_node=2 --master_port=29501 ./dizoo/atari/config/serial/pong/pong_dqn_ddp_config.py
python -m torch.distributed.launch --nproc_per_node=2 ./dizoo/atari/config/serial/pong/pong_dqn_ddp_config.py
"""
from ding.utils import DDPContext
from ding.entry import serial_pipeline
Expand Down
14 changes: 7 additions & 7 deletions dizoo/atari/config/serial/pong/pong_ppo_ddp_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from easydict import EasyDict

pong_onppo_config = dict(
exp_name='data_pong/pong_onppo_ddp_seed0',
pong_ppo_config = dict(
exp_name='data_pong/pong_ppo_ddp_seed0',
env=dict(
collector_env_num=8,
evaluator_env_num=8,
Expand Down Expand Up @@ -34,7 +34,7 @@
clip_ratio=0.2,
adv_norm=True,
value_norm=True,
# for onppo, when we recompute adv, we need the key done in data to split traj, so we must
# for ppo, when we recompute adv, we need the key done in data to split traj, so we must
# use ignore_done=False here,
# but when we add key traj_flag in data as the backup for key done, we could choose to use ignore_done=True
# for halfcheetah, the length=1000
Expand All @@ -51,24 +51,24 @@
eval=dict(evaluator=dict(eval_freq=1000, )),
),
)
main_config = EasyDict(pong_onppo_config)
main_config = EasyDict(pong_ppo_config)

pong_onppo_create_config = dict(
pong_ppo_create_config = dict(
env=dict(
type='atari',
import_names=['dizoo.atari.envs.atari_env'],
),
env_manager=dict(type='subprocess'),
policy=dict(type='ppo'),
)
create_config = EasyDict(pong_onppo_create_config)
create_config = EasyDict(pong_ppo_create_config)

if __name__ == "__main__":
"""
Overview:
This script should be executed with <nproc_per_node> GPUs.
Run the following command to launch the script:
python -m torch.distributed.launch --nproc_per_node=2 --master_port=29501 ./dizoo/atari/config/serial/pong/pong_ppo_ddp_config.py
python -m torch.distributed.launch --nproc_per_node=2 ./dizoo/atari/config/serial/pong/pong_ppo_ddp_config.py
"""
from ding.utils import DDPContext
from ding.entry import serial_pipeline_onpolicy
Expand Down
2 changes: 1 addition & 1 deletion dizoo/atari/example/atari_dqn_ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ def main():
Overview:
This script should be executed with <nproc_per_node> GPUs.
Run the following command to launch the script:
python -m torch.distributed.launch --nproc_per_node=2 --master_port=29501 ./dizoo/atari/example/atari_dqn_ddp.py
python -m torch.distributed.launch --nproc_per_node=2 ./dizoo/atari/example/atari_dqn_ddp.py
"""
main()
2 changes: 1 addition & 1 deletion dizoo/atari/example/atari_ppo_ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ def main():
Overview:
This script should be executed with <nproc_per_node> GPUs.
Run the following command to launch the script:
python -m torch.distributed.launch --nproc_per_node=2 --master_port=29501 ./dizoo/atari/example/atari_ppo_ddp.py
python -m torch.distributed.launch --nproc_per_node=2 ./dizoo/atari/example/atari_ppo_ddp.py
"""
main()

0 comments on commit 9c880ad

Please sign in to comment.