RL icon indicating copy to clipboard operation
RL copied to clipboard

Refactor dataset part to use the new dataset and processor interface

Open RayenTian opened this issue 1 year ago • 2 comments

Refactor the SFT and GRPO entry script to adopt the new dataset processor interface introduced in RawDataset and the PROCESSOR_REGISTRY, removing ad‑hoc preprocessing and aligning with the GRPO data path.

Motivation

We recently introduced a unified processor interface and registration mechanism for datasets in PR !1506. The SFT path still wires processors and preprocessing via partials in run_sft.py, which diverges from the new interface and duplicates logic. Unifying both paths reduces maintenance, enables consistent configuration, and simplifies documentation.

Scope

  1. Replace ad‑hoc processor wiring in run_sft.py with the standard processor interface (TaskDataSpec + PROCESSOR_REGISTRY).
  2. Ensure datasets used by SFT can declare/select their processor consistently via config (e.g., data.processor).
  3. Make STF dataset inherit RawDataset class. Unified dataset interface.
  4. Keep parity with existing SFT features (optional BOS/EOS, add_generation_prompt, optional image preprocessing for CLEVR, etc.) by moving them into the processor layer where appropriate.
  5. Move customized OmegaConf op into a common place. Refer to this comment.
  6. Unify dataset initialize with super.init. Refer to this comment.

RayenTian avatar Nov 20 '25 05:11 RayenTian

For 1/2/4: Done some parts, and will track the remain parts in https://github.com/NVIDIA-NeMo/RL/issues/1658. For 3/6: Done in https://github.com/NVIDIA-NeMo/RL/pull/1649.

So this issue can be closed once 5 is resolved.

yuki-97 avatar Feb 05 '26 05:02 yuki-97

QA RCCA Analysis

RCCA Status: Not Required RCCA Category: not_required Test Action: none

Fix PR: N/A Root Cause: This issue is not an actionable closed product-code defect for RCCA; it is enhancement/feature tracking, docs/cosmetic work, placeholder/test issue, or closed non-bug work. Trigger Config: N/A.

Coverage Assessment:

Area Result
Existing Test N/A
Coverage Status NOT_REQUIRED
Gap N/A
Corrective Action No RCCA regression test required.

Conclusion: RCCA not required because this does not represent a QA coverage escape for a fixed NeMo-RL bug.

qiaochuz-nv avatar May 05 '26 18:05 qiaochuz-nv