Skip to content

fix: is_offload_optimizer_states_in_train_step not passed to batch.meta_info in RLVR and agentic pipelines - #478

Open
sanmuf wants to merge 1 commit into
alibaba:mainfrom
sanmuf:fix/offload-optimizer-states-passing
Open

fix: is_offload_optimizer_states_in_train_step not passed to batch.meta_info in RLVR and agentic pipelines#478
sanmuf wants to merge 1 commit into
alibaba:mainfrom
sanmuf:fix/offload-optimizer-states-passing

Conversation

@sanmuf

@sanmuf sanmuf commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

is_offload_optimizer_states_in_train_step controls whether optimizer states are offloaded to CPU after each train step (saving GPU memory at the cost of CPU-GPU transfer overhead). This field is defined in base_config.py with default False, and should be passed from each pipeline's config to batch.meta_info so that MegatronTrainStrategy.train_step can read it.

However, in the RLVR and agentic pipelines, this field was missing from batch.meta_info during training. As a result, MegatronTrainStrategy.train_step falls back to its hardcoded default True, rendering the user's yaml configuration ineffective.

Changes

  • rlvr_pipeline.py: Added is_offload_optimizer_states_in_train_step to training batch's meta_info, reading from self.pipeline_config
  • agentic_pipeline.py: Same fix

Impact

Users can now control is_offload_optimizer_states_in_train_step via yaml configuration in RLVR and agentic training workflows. Previously, the setting was silently ignored.

@CLAassistant

CLAassistant commented Aug 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sanmuf
sanmuf force-pushed the fix/offload-optimizer-states-passing branch from d971866 to 607b491 Compare August 4, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants