Skip to content

Conversation

@fabianlim
Copy link

@fabianlim fabianlim commented Jan 13, 2026

What does this PR do?

In fully-async recipe, the rollouters are instantiated as standalone AsyncActorRolloutRefWorker. Since this class inherits from ActorRolloutRefWorker, it will always create an self.actor_module_fsdp in _init_model as long as self._is_rollout = True. However in fully-async, we already have a parameter synchronizer and that calls sync_rollout_weights to sync the rollout weights with the trainer, so there is no need for to call load_checkpoint at all at the Rollouter. Furthermore, the DeepSpeed implementation does not even support load_checkpoint in the standalone rollout mode, hence we might as well make the FSDP behavior consistent with DeepSpeed

Thus this PR to remove the load_checkpoint logic for FSDP workers in standalone rollout mode

  • The alternative we considered was to introduce a flag in FSDPConfig to disable this logic, but this may be confusing for users

The benefits of this PR would be to show GPU VRAM memory savings for standalone rollout mode.

Results
With this fix, we can run 70b training with a single node for rollout (i.e 8 GPUs).

    actor_rollout_ref.actor.fsdp_config.param_offload=False 
    actor_rollout_ref.actor.fsdp_config.optimizer_offload=False
    actor_rollout_ref.rollout.gpu_memory_utilization=0.80
    actor_rollout_ref.rollout.tensor_model_parallel_size=8
    actor_rollout_ref.rollout.free_cache_engine=False 

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
@CLAassistant
Copy link

CLAassistant commented Jan 13, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to disable checkpoint loading for standalone FSDP rollout workers to save GPU memory, which is a good optimization. The changes correctly prevent the FSDP model from being initialized in this scenario. However, this introduces a critical issue where methods like rollout_mode and trainer_mode will fail due to self.actor_module_fsdp being None. I've added a comment with details on how to fix this. Once that's addressed, the PR should be in good shape.

Comment on lines +835 to +836
else:
self.actor_module_fsdp = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While setting self.actor_module_fsdp to None for standalone rollout workers is correct, it introduces a critical issue in other methods that use this attribute without checking if it's None.

Specifically, rollout_mode and trainer_mode will fail with an AttributeError when self.actor_module_fsdp is None. These methods are called for standalone rollout workers in an async setup (e.g., via wake_up and sleep in AsyncActorRolloutRefWorker).

For example:

  • rollout_mode calls self.actor_module_fsdp.state_dict()
  • trainer_mode calls self.actor_module_fsdp.train()

To fix this, you should add a guard at the beginning of both rollout_mode and trainer_mode to handle the case where self.actor_module_fsdp is None. Since these methods are for syncing the hybrid engine, they should be a no-op if there's no actor model in the worker.

Suggested fix for rollout_mode:

async def rollout_mode(self):
    """Context switch hybridengine to rollout mode."""
    if not self._is_actor:
        return
    ...

Suggested fix for trainer_mode:

async def trainer_mode(self):
    """Context switch hybridengine to trainer mode."""
    if not self._is_actor:
        return
    ...

This is a critical issue as it will cause standalone rollout workers to crash.

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