Skip to content

Commit

Permalink
should fix the loss of data
Browse files Browse the repository at this point in the history
  • Loading branch information
rizar committed Jan 7, 2025
1 parent b3e54fe commit 5899f44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/rl_gsm8k/orchestrate_rl.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,15 +430,15 @@ def main(cfg: DictConfig):
]

start_basemodel_logprobs = time.time()
all_traces = all_results["train"]["training_samples"]
training_samples = all_results["train"]["training_samples"]
with ThreadPoolExecutor(
max_workers=cfg.get_logprobs_workers_per_gpu * torch.cuda.device_count()
) as executor:
chunk_size = 64
futures = []
for chunk_id, chunk_offset in enumerate(range(0, len(all_traces), chunk_size)):
for chunk_id, chunk_offset in enumerate(range(0, len(training_samples), chunk_size)):
ref_llm = ref_llms[chunk_id % len(ref_llms)]
chunk = all_traces[chunk_offset: chunk_offset + chunk_size]
chunk = training_samples[chunk_offset: chunk_offset + chunk_size]
futures.append(
executor.submit(batch_annotate_traces_with_ref_logprobs, ref_llm, chunk)
)
Expand Down

0 comments on commit 5899f44

Please sign in to comment.