Fix preprocessor reference logprob worker wiring#131
Open
taivu1998 wants to merge 1 commit intoServiceNow:mainfrom
Open
Fix preprocessor reference logprob worker wiring#131taivu1998 wants to merge 1 commit intoServiceNow:mainfrom
taivu1998 wants to merge 1 commit intoServiceNow:mainfrom
Conversation
Author
|
Hi @rizar, could you help review this PR? Thank you so much! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TrainableLLMclients to preprocessor workers at process startupfinal_kl_coefalso requires reference-model capacityCloses #62.
Problem
The preprocessor constructed reference LLM clients from
me.llm_urls, but each worker process was still launched withllm=None. As a result,preprocess_dataset(...)always fell back to copying rolloutlogprobsintoref_logprobs.That meant KL-enabled runs were no longer using the frozen reference policy that
run_ref_llm(...)launches. Instead, the trainer compared the new policy against rollout-time actor logprobs, which changes both the loss semantics and the reported KL metrics.What changed
pipelinerl/preprocess.pyto detect when reference logprobs are required, validate setup, and assign reference clients to workersTrainableLLMinto each preprocessor worker when it is spawned instead of hard-codingNonellm.tokenizer = tokenizerinside the worker so the reference client can reuse the already-loaded tokenizernext_llm_indexcode from the main preprocessing looppipelinerl/launch.pyconfig validation to treat eitherkl_coeforfinal_kl_coefas requiringworld.preprocessor_fraction > 0Validation
python3.11 -m py_compile pipelinerl/preprocess.py pipelinerl/launch.pypython3.11 -m compileall pipelinerlgit diff --checkNotes
pipelinerl/preprocess.pyandpipelinerl/launch.pyare included in this PR