DeepSpeed
bd69fc79 - fix(rollout): repair refresh_weights and wire it into sync_weights

Commit
2 days ago
fix(rollout): repair refresh_weights and wire it into sync_weights Review findings from @runguo-li and @tohtana (all three verified): 1. refresh_weights() read self._rollout_module/self.module, which do not exist -- the rollout holds the model at engine.module. The arena e2e bypassed the method by calling segki_refresh() directly, so the entry point was never exercised. Resolve through the engine (mock-safe for the SimpleNamespace test engines), and state the retained-graph caveat honestly in the docstring (finding 2, design pending). 2. sync_weights() was a no-op: colocated weights are read live so there is nothing to push, but the injected forwards' derived caches go stale after an in-place write. The training-step hook now refreshes, so every sync source invalidates uniformly (tohtana's wiring point). 3. Rollout-path test: inject -> generate -> in-place weight write -> sync_weights -> generate must match a fresh injection bit-for-bit (the arena e2e logic through the public entry point). Replaces test_sync_weights_is_noop, which pinned the old no-op behavior. Validated on L20 (card 4, torch 2.15/tf 5.22): both new tests pass; full test_hybrid_engine_rollout.py 151 passed / 4 skipped. Signed-off-by: Ma, Guokai <guokai.ma@gmail.com>
Author
Committer
Parents
Loading