forked from Zeta36/chess-alpha-zero
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Chess-Zero/src/chess_zero/worker/self_play.py
Lines 33 to 41 in 90a5aad
| self.cur_pipes = self.m.list([self.current_model.get_pipes(self.config.play.search_threads) for _ in range(self.config.play.max_processes)]) | |
| def start(self): | |
| self.buffer = [] | |
| futures = deque() | |
| with ProcessPoolExecutor(max_workers=self.config.play.max_processes) as executor: | |
| for game_idx in range(self.config.play.max_processes): | |
| futures.append(executor.submit(self_play_buffer, self.config, cur=self.cur_pipes)) |
I see you create max_processes pipe list of search_threads pipes and max_processes execute self play processes with the pipe list.
A self player use own pipe list by pop from it.
Chess-Zero/src/chess_zero/worker/self_play.py
Lines 86 to 87 in 90a5aad
| def self_play_buffer(config, cur) -> (ChessEnv, list): | |
| pipes = cur.pop() # borrow |
More ever you keep it going continuously the same pipe list.
| futures.append(executor.submit(self_play_buffer, self.config, cur=self.cur_pipes)) # Keep it going |
Is it ok multiple pop from the same list?
Why create the shared list by calling Manager.list and send the list to player, instead of sending pipe list itself?
like this:
futures.append(executor.submit(self_play_buffer, self.config, cur=self.current_model.get_pipes(self.config.play.search_threads)))
# and
def self_play_buffer(config, cur) -> (ChessEnv, list):
pipes = cur # without popReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels