Skip to content

[trainer,data] feat: apply model-specific condition dropout to offline SFT - #400

Merged
Jayce-Ping merged 2 commits into
feat/p23-packed-dropoutfrom
feat/p23-sft-training
Nov 24, 2026
Merged

Jayce-Ping merged 2 commits into
feat/p23-packed-dropoutfrom
feat/p23-sft-training

Conversation

@Jayce-Ping

Copy link
Copy Markdown
Collaborator

SFT behavior

This completes P23 on top of #397, #398 and #399. All 19 built-in adapters declare their SFT conditioning policy. train.condition_dropout defaults to 0.1. Use 0 to preserve legacy conditioning and checkpoint identity. native selects a qualified BAGEL or SenseNova training recipe.

A training record makes one decision per data epoch, keyed by seed, record identity and event, independent of rank, microbatch order and model noise. Each time term uses the same condition. Targets, guidance overrides and evaluation retain their existing owners. Per-task window counters count observations across logical data replicas.

Input and cache ownership

  • Cached SFT keeps its positive input cache. Separable encoders share a deterministic absent-caption encoding across retained references. Joint encoders such as Qwen Edit construct the absent instruction with the original ordered images. Packed models assemble the selected native prefix at training time.
  • With data.enable_preprocess: false, workers decode media and the training rank encodes only the selected condition. The row formatter preserves the tensor dtypes, shapes, ragged fields and Python image columns expected by the cached path. Offline DPO retains its cached-input contract.
  • Kontext auto-resolution now preserves the aspect of each edit reference when an offline cache batch contains different image sizes. Qwen Image 2.1 accepts a single record containing exactly three reference shapes. The user guide, roadmap and model onboarding checklist document these boundaries.

Validation

The distributed witnesses use local native miniature models and fixed stochastic inputs. On two FSDP2 ranks, independent public Klein Base editing runs compare raw/cached reference tensors, target, time, velocity, loss, LoRA gradients and optimizer updates. Wan DP2 × CP2 verifies different masks across data replicas, agreement between CP peers and exact masks, losses, gradients and weights after a mid-run checkpoint restore.

The packed families have separate raw/cached public trainer integration on top of the native FSDP2 probes in #399. CPU coverage also includes configuration rejection, p=0 migration, deterministic sampling, cache reuse, multisource tails, Arrow types and all 19 registry entries. The validation catalog routes the specific feature delta to these contracts and preserves broad fallback for unrecognized source changes.

The reviewed source is 7a792c21. Local formatting and repository consistency passed. The exact-head evidence workflow stores the case receipts for the hosted gate. Model-level control receipts are linked from the three parent PRs. The targeted regressions include 292 passing CPU checks and two additional passing public configuration admission cases.

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

Copy link
Copy Markdown
Collaborator Author

Validation evidence for 7a792c211ffe51aa3caa93e721a2a9a57bf57510 is now recorded on GitHub Actions. The artifact includes seven externally executed catalog cases.

  • Two GPU ranks ran the public Klein Base editing SFT entry point with raw and cached inputs and compared the selected conditions, target, velocity, loss, LoRA gradients and first update.
  • Four GPU ranks ran Wan SFT with DP2 × CP2 and compared dropout decisions, losses, gradients and weights for resumed and uninterrupted training.
  • The other five CPU/Gloo cases passed 342 test invocations in total, including 134 condition-source contract checks and four-rank checkpoint-layout checks.

The model-specific controls are linked from #397, #398 and #399.

@Jayce-Ping
Jayce-Ping merged commit e9e57de 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