Skip to content

refactor(rollout): split lifecycle and receiver capabilities - #26

Draft
leviking98z-rgb wants to merge 1 commit into
refactor/trainer-loop-programsfrom
refactor/rollout-capability-interfaces
Draft

refactor(rollout): split lifecycle and receiver capabilities#26
leviking98z-rgb wants to merge 1 commit into
refactor/trainer-loop-programsfrom
refactor/rollout-capability-interfaces

Conversation

@leviking98z-rgb

Copy link
Copy Markdown
Owner

Summary

Refactors rollout engines around explicit, composable capability surfaces instead of a fat base class with unsupported NotImplementedError methods.

  • Move the shared offload/health behavior into DefaultRolloutMemoryLifecycle and require every rollout engine to declare MEMORY_LIFECYCLE.
  • Define dependency-light structural protocols for tensor, NCCL, IPC, LoRA, checkpoint, and memory-lifecycle consumers.
  • Remove optional weight-receiver stubs from BaseRolloutEngine; unsupported transports are now absent and rejected by capability planning.
  • Share tensor/NCCL/LoRA delegation across vLLM-Omni, SGLang AR, and SGLang diffusion while preserving engine-specific IPC, copy, checksum, and target_modules behavior.
  • Validate capability-to-method correspondence both at execution-plan resolution and in the stdlib-only framework guard.

The change removes 429 lines of duplicated base stubs and engine forwards. The protocols, reusable implementations, docs, and persistent guard make this PR net +58 lines; the goal here is an enforceable extension boundary rather than a standalone LOC reduction.

Related Issue

N/A

Test Plan

  • SKIP=no-commit-to-branch pre-commit run --all-files --show-diff-on-failure — passed, including recipe targets, architecture boundaries, and framework contracts.
  • python -m compileall -q unirl lint/check_framework_contracts.py — passed.
  • python lint/check_framework_contracts.py — passed: 7 rollout engines, 6 weight syncs, 19 model pipelines, 2 train backends, 2 wire types, 4 loop programs, and 13 entrypoints conform.
  • One-off stdlib-only harness (not committed, per repository policy) — passed; it exercised tensor/NCCL delegation, AR target_modules suppression, weight-version increments, LoRA dirty-state forwarding, and rejection of incomplete declared method surfaces.
  • GPU rollout/training smoke — not run; this environment has no torch/Ray/Hydra stack or accelerator allocation. No generation, numerical, or transport implementation is changed.

Compatibility / Risk

  • No recipe, checkpoint, or wire-format migration is required for in-repo components.
  • This intentionally removes unsupported receiver methods from BaseRolloutEngine. Out-of-tree code that blindly calls an unsupported transport now gets normal attribute absence instead of a delayed NotImplementedError; it should query declared capabilities.
  • New rollout engines must declare MEMORY_LIFECYCLE and structurally implement every receiver capability they advertise.
  • The highest-risk area is inherited receiver dispatch. The shared mixin preserves the previous signatures, version increments, and per-engine target_modules behavior, and the one-off harness covers those differences.

Reviewer Notes

Checklist

  • I reviewed the changed code and removed unrelated/generated artifacts.
  • I updated tests, docs, and configs where needed, or explained why not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant