Skip to content

Commit 460f80c

Browse files
fix(sleep): use smaller worker_wait defaults
- while profiling I noticed that a bunch of time (seconds out of < 1 minute) were spent sleeping because of the worker_wait default.
1 parent b04fbce commit 460f80c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

libraries/mathy_python/mathy/agents/a3c/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class A3CConfig(BaseConfig):
3838
# other threads time to process. This is useful for
3939
# running more threads than you have processors to
4040
# get a better diversity of experience.
41-
worker_wait: float = 0.1
41+
worker_wait: float = 0.01
4242

4343
# The number of worker agents to create.
4444
num_workers: int = 3

libraries/mathy_python/mathy/agents/a3c/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def run_episode(self, episode_memory: EpisodeMemory) -> float:
368368
# The greedy worker sleeps for a shorter period of time
369369
sleep = self.args.worker_wait
370370
if self.worker_idx == 0:
371-
sleep = max(sleep // 100, 0.05)
371+
sleep = max(sleep // 100, 0.005)
372372
# Workers wait between each step so that it's possible
373373
# to run more workers than there are CPUs available.
374374
time.sleep(sleep)

0 commit comments

Comments
 (0)