Skip to content

[data] refactor: share input collation and offline supervision checks - #403

Merged
Jayce-Ping merged 1 commit into
feat/p23-dpo-inputsfrom
feat/p23-simplify
Nov 24, 2026
Merged

Jayce-Ping merged 1 commit into
feat/p23-dpo-inputsfrom
feat/p23-simplify

Conversation

@Jayce-Ping

Copy link
Copy Markdown
Collaborator

Dataset responsibilities

This is the final simplification pass on P23, based on #402. The review covered the model policies, acquisition and encoding paths, SFT and preference trainers, evidence routing and user guides. The public dataset entry points have distinct responsibilities. GeneralDataset builds and reads model-input rows. OfflineDataset pairs those rows with stable record identities and freshly decoded demonstration or preference targets. The offline cache builders already use the general Arrow preprocessing implementation.

  • Both datasets now call one collate_model_inputs function for equal-shaped tensors, ragged inputs and Python media. The public GeneralDataset.collate_fn entry point and the offline check for identical row keys are preserved.
  • Loader preflight and direct offline dataset construction now use the same decoder registry and supervision-arm checks. Validation streams assets per record and identifies the source, arm, media index and path of a missing decoder. Invalid custom decoders fail before any encoder work.
  • The user guide explains when a text encoder is needed, which inputs share an empty caption, and how cache hits, forced rebuilds, joint reference encoders and on-demand execution behave.

The three production files remove 83 net lines. The remaining changes cover regression tests, validation routing and the guide.

Validation

  • 144 focused CPU checks passed, including spawn workers, real ordered audio/video decoding, cache identity/reuse, preference arms, ragged fields, Python images and raw/cached packed-model SFT.
  • The new tests check that a non-picklable custom decoder fails before preprocessing and that collation preserves ragged values and reports mismatched fields. The planner regression checks that unrelated dataset changes still require review.
  • The selected plan pairs independent cache/raw Klein SFT and offline DPO updates on two FSDP2 ranks with a Wan DP2 × CP2 continuation on four ranks. The source-bound results are recorded through the validation workflow.

@Jayce-Ping
Jayce-Ping added this pull request to stack #401 November 24, 2026 09:11
@Jayce-Ping

Copy link
Copy Markdown
Collaborator Author

Validation evidence for commit 488d061b includes the two catalog CPU suites (328 and 138 passing test invocations) and all three native distributed cases.

Native case Observed ranks Comparison
Klein editing SFT 2 × FSDP2 Cached versus on-demand inputs through one update
Klein editing offline DPO 2 × FSDP2 Cached versus on-demand chosen/rejected policy and reference paths through two updates
Wan SFT 4, DP2 × CP2 Rank-consistent dropout and resumed versus uninterrupted training

The focused data/decoder suite additionally passed all 144 checks using the host's FFmpeg 7 libraries for real media decoding.

@Jayce-Ping
Jayce-Ping merged commit 6a41281 into main Nov 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant