diff --git a/rdagent/scenarios/data_science/proposal/exp_gen/parallel.py b/rdagent/scenarios/data_science/proposal/exp_gen/parallel.py index 73a1b0f3..4361a8d3 100644 --- a/rdagent/scenarios/data_science/proposal/exp_gen/parallel.py +++ b/rdagent/scenarios/data_science/proposal/exp_gen/parallel.py @@ -83,7 +83,7 @@ class ParallelMultiTraceExpGen(ExpGen): else: # enter the merging stage # make sure the all loops are finished - if loop.get_unfinished_loop_cnt(loop.loop_idx) < 1: + if loop.get_unfinished_loop_cnt(loop.loop_idx) < RD_AGENT_SETTINGS.get_max_parallel(): # disable reset in merging stage DS_RD_SETTING.coding_fail_reanalyze_threshold = 100000 DS_RD_SETTING.consecutive_errors = 100000 @@ -93,13 +93,15 @@ class ParallelMultiTraceExpGen(ExpGen): trace.set_current_selection(selection=(-1,)) return self.exp_gen.gen(trace) else: - selection = (leaves[0],) + local_selection = (leaves[0],) if trace.sota_exp_to_submit is not None: for i in range(1, len(leaves)): if trace.is_parent(trace.exp2idx(trace.sota_exp_to_submit), leaves[i]): - selection = (leaves[i],) + local_selection = (leaves[i],) break - trace.set_current_selection(selection) - return self.merge_exp_gen.gen(trace) + trace.set_current_selection(local_selection) + exp = self.merge_exp_gen.gen(trace) + exp.set_local_selection(local_selection) + return exp await asyncio.sleep(1)