Skip to content

Context compaction: support trainer and rollout checkpoint/resume #4558

Closed

Description

@terrykong

Follow-up to #4124 (context compaction, CC).

Problem

With CC on, the config rejects both kinds of checkpointing (config.py#L1440-L1443):

if master_config.checkpointing["enabled"]:
    raise ValueError("CC checkpoint/resume is not supported initially")
if master_config.rollout_checkpointing.snapshot_attempt_interval_s is not None:
    raise ValueError("CC rollout checkpoint/resume is not supported initially")

So a CC run can neither save and resume trainer checkpoints nor snapshot in-flight rollouts. The context_compaction field comment says the same (config.py#L653-L656).

Why it matters

CC is meant for long, multi-turn agent runs, and those are the runs that most need to resume. Without checkpoints, any crash, preemption or job time limit loses the whole run. Under #4124 as it stands, one dropped prompt group also stops the run (see #4557 for retry), so a long CC run today has no way to recover from either.

The same root cause blocks retry in #4557: RL keeps the record of which responses the agent accepted only inside the request that ran it (rollout_manager.py#L2210-L2214). Persisting that state would likely unblock both.

Ask

  1. Persist the per-rollout CC selection state, so it survives a checkpoint and a restart.
  2. Allow checkpointing.enabled with CC: save, then resume and check that training continues from the same step with the same data order.
  3. Allow rollout snapshots (rollout_checkpointing.snapshot_attempt_interval_s) with CC, with a test that resumes in-flight groups.
  4. Remove the two guards above once each part works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions