Repository navigation
[diffusion, trainer, tests] feat: strip responses from worker batches - #430
Conversation
Avoid transporting driver-only response pixels to diffusion actor, reference, teacher, and old-log-prob RPCs while retaining the original DataProto for reward and logging paths. Add CPU contracts for the v0 and v1 trainer entry points and shallow tensor projection. AI assistance was used for this change. Signed-off-by: Wenzhe Wang <w_wenzhe@163.com>
|
cc: @wtomin Do you think we need the run L3 nightly CI for this ? |
|
if possible, pls add a sd3 reward curve for this pr |
|
Thanks @zhtmike. I ran a paired 20-step SD3/PickScore reward-curve check on the exact PR head Setup: 1× NVIDIA A800 80GB, fixed tiny random SD3 checkpoint, real cached PickScore v1 reward, seed 42, 3 prompts, 2 responses per prompt, 12 images/step, 256×256, and 20 optimizer steps.
Comparison against main:
The predeclared gate required three finite 20-point curves and PR max/mean deltas no greater than the same-code control plus Scope: this is a paired mechanism-level SD3/PickScore conformance check. Because it uses a tiny random SD3 checkpoint, it does not claim pretrained SD3.5 quality/convergence, production throughput, or multi-GPU performance. |
|
Thanks~ |
…verl-project#430) Avoid transporting driver-only response pixels to diffusion actor, reference, teacher, and old-log-prob RPCs while retaining the original DataProto for reward and logging paths. Add CPU contracts for the v0 and v1 trainer entry points and shallow tensor projection. AI assistance was used for this change. Signed-off-by: Wenzhe Wang <w_wenzhe@163.com>
What does this PR do?
Implements Phase 1 of #386 by excluding driver-only
responsespixels from diffusion actor, reference, teacher, and old-log-prob worker payloads while retaining the originalDataProtofor reward scoring, evaluation, and logging.DataProto→TensorDictprojection that removes onlyresponseswithout copying tensor storage.This complements #373, which implemented the separate uint8 response representation phase. AI assistance was used for this change, and the final diff received human review before publication.
Checklist Before Starting
WenZheWang:wenzhe/strip-unused-responses; no duplicate found.[{modules}] {type}: {description}and validated it withtests/special_sanity/check_pr_title.py.Test
The CPU suite ran on macOS with an import-only stub for the optional vLLM rollout package because vLLM is unavailable on macOS; the production trainer modules and methods were exercised.
Hardware validation on exact head
ba3918cfb4e2a2bca9120ded699b2e52ddf9ba50:torch 2.6.0+cu124, Ray 2.53.0): batch 8, 192 frames, 512×512 RGB uint8 responses, 2 warmups and 8 measured repetitions per arm. Tensor payload fell from 1,224,737,280 to 16,777,728 bytes (98.63% reduction); median end-to-end transfer time fell from 1.64636 s to 0.03249 s (98.03% reduction). The driver retainedresponses, the projected worker payload excluded it, and all predeclared gates passed.NVIDIA A800 80GB PCIe, CUDA 12.4,torch 2.6.0+cu124, Ray 2.53.0): seed 42, six optimizer steps per arm. Tensor payload fell from 402,784,288 to 131,104 bytes (99.967% reduction); baseline and projected loss sequences were identical, maximum absolute loss and parameter differences were both 0.0, and final parameter SHA256 values matched. All eight predeclared correctness gates passed.The hardware evidence is intentionally scoped to response-payload transport and deterministic optimizer equivalence. It does not claim end-to-end diffusion quality, full-model production throughput, or multi-GPU semantics.
API and Usage Example
No public API, configuration, or user workflow changes. Diffusion trainer call sites automatically omit
responsesonly when preparing actor/ref worker payloads.Design & Code Changes
DataProto.to_tensordict()creates the worker-side container while preserving references to existing tensor storage.responsesfrom that container only; the driver-sideDataProtoremains unchanged.Checklist Before Submitting
test_worker_batch_projection_on_cpu.py; existing CPU workflow discovery coverstests/trainer/diffusion/*_on_cpu.py, so no workflow edit is required.