Skip to content

Commit

Permalink
train two jit
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfi1 committed Oct 25, 2024
1 parent 7bae0d5 commit 64186f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions slippi_ai/rl/train_two_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class RuntimeConfig:
max_runtime: tp.Optional[int] = None # maximum runtime in seconds
log_interval: int = 10 # seconds between logging
save_interval: int = 300 # seconds between saving to disk
use_fake_data: bool = False

# Periodically reset the environments to deal with memory leaks in dolphin.
reset_every_n_steps: tp.Optional[int] = None
Expand All @@ -57,6 +56,7 @@ class AgentConfig:
name: str = nametags.DEFAULT_NAME

compile: bool = True
jit_compile: bool = True
batch_steps: int = 0
async_inference: bool = False

Expand Down Expand Up @@ -225,6 +225,7 @@ def agent_kwargs(self) -> dict:
state=self.get_state(),
name=self.agent_config.name,
compile=self.agent_config.compile,
jit_compile=self.agent_config.jit_compile,
batch_steps=self.agent_config.batch_steps,
async_inference=self.agent_config.async_inference,
)
Expand Down Expand Up @@ -365,7 +366,7 @@ def run(config: Config):
num_envs=config.actor.num_envs,
async_envs=config.actor.async_envs,
use_gpu=config.actor.gpu_inference,
use_fake_envs=config.runtime.use_fake_data,
use_fake_envs=config.actor.use_fake_envs,
# Rewards are overridden in the learner.
)

Expand Down
2 changes: 1 addition & 1 deletion tests/train_two.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ python slippi_ai/rl/train_two.py \
--config.runtime.max_step=10 \
--config.runtime.log_interval=0 \
--config.learner.learning_rate=0 \
--config.runtime.use_fake_data=True \
--config.p1.teacher=slippi_ai/data/checkpoints/demo \
--config.p2.teacher=slippi_ai/data/checkpoints/demo \
--config.actor.use_fake_envs=True \
--config.actor.num_envs=1 \
--config.actor.rollout_length=64 \
--config.runtime.burnin_steps_after_reset=1 \
Expand Down

0 comments on commit 64186f5

Please sign in to comment.