fix: use Cluster instead of WorkerConfig for ref log prob dynamic batching#376
Open
dubin555 wants to merge 1 commit intoalibaba:mainfrom
Open
fix: use Cluster instead of WorkerConfig for ref log prob dynamic batching#376dubin555 wants to merge 1 commit intoalibaba:mainfrom
dubin555 wants to merge 1 commit intoalibaba:mainfrom
Conversation
When `use_ref_model=False`, the `worker` variable was set to `self.pipeline_config.actor_train` (a WorkerConfig) instead of `self.actor_train` (a Cluster). WorkerConfig does not have `dp_size`, so `worker.dp_size` raises AttributeError when dynamic batching is enabled for reference log prob computation without a separate reference model. Change the else-branch to use `self.actor_train` (Cluster) which has the `dp_size` property.
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.
Problem
In
RLVRPipeline._train(rlvr_pipeline.py:544), whenuse_ref_model=False, theworkervariable is set toself.pipeline_config.actor_train(aWorkerConfig) instead ofself.actor_train(aCluster):This causes an
AttributeErrorwhen computing reference log probabilities withenable_reference=True,use_ref_model=False, anduse_dynamic_batching_in_infer=True.Root Cause
Copy-paste error from line 543.
worker_configcorrectly usesself.pipeline_config.actor_train(WorkerConfig), butworkeron line 544 should useself.actor_train(Cluster) which has thedp_sizeproperty.Fix
Files Changed
roll/pipeline/rlvr/rlvr_pipeline.py— Line 544tests/test_ref_worker_type_consistency.py— AST-based regression test