Two more pipelines stress-testing the design, plus a BAGEL-placement note in designv4. Both fit with no new runtime primitive (109 tests pass). Pipeline 1 — cross-model T2I→I2V (program/workflow.py, models/image_video/): - Realizes ProgramKind.WORKFLOW as a thin multi-instance orchestrator ABOVE the engine (the hot path stays single-instance). A Program composes one model's loops; a Workflow chains full engine.run calls across distinct cards, threading artifacts. (LTX-2 already covers same-card multi-stage; cross-model — FLUX→Wan — is the new capability the single-instance runner can't express.) - flux-t2i (text→image) and wan-i2v (text+image→video) cards; the I2V program folds the conditioning image into text_embeds so WanDenoiseLoop is unchanged. - Each model keeps its own interleave-parity guarantee (crossing instances is a Workflow boundary, not a loop step). 7 tests incl. video-depends-on-image. Pipeline 2 — N-way joint RL (training/methods/joint_multi_rl.py, models/multi_expert/): - JointMultiExpertRL generalizes UnifiedRLMethod (N=2) to N refiner LMs + a generator: one reward → one group advantage → N token-PG updates + 1 FlowGRPO PPO update, N+1 independent WeightSyncPlans. Proves the substrate was already N-ready (card holds N components/loops; per-component weight-sync; dict grad targets) — only the method body looped over two; now it loops over a list. - credit="per_expert" learns all N cleanly; credit="shared" (faithful to UniRL) works but is noisier — the honest multi-agent credit-assignment result, a reward-shaping choice, not a substrate limit. 6 tests (N=1,3,4; prompt-only). Fix — flow_sde_ml_velocity (loop/sampler.py): the toy FlowGRPO generator update targeted the velocity the model already produced (a no-op once guidance_scale=1 was set for the C2 identity; the unified generator moved only on ~1e-7 noise). The correct PG surrogate targets the max-likelihood velocity of the realized sample — nonzero at ratio==1. Both UniRL and N-way generators now learn for real; the C2 ratio==1 identity still holds (measured before the update). BAGEL: MoT/shared-weight (one transformer on both loops), same row as Cosmos3; real BAGEL's co-resident experts are expressible via the expert-routing policy (partial sharing) — captured in designv4 §2.3.
21 lines
866 B
Python
21 lines
866 B
Python
"""Training methods — all on Wan2.1-1.3B, all over the SHARED loops (design_v3 §10)."""
|
|
from __future__ import annotations
|
|
|
|
from .base import TrainingMethod, new_instance, predict_x0
|
|
from .diffusion_nft import DiffusionNFTMethod, build_diffusion_nft
|
|
from .dmd2 import DMD2Method, build_dmd2
|
|
from .finetune import FineTuneMethod, build_finetune
|
|
from .joint_multi_rl import JointMultiExpertRL, build_joint_multi_rl
|
|
from .self_forcing import SelfForcingMethod, build_self_forcing
|
|
from .unified_rl import UnifiedRLMethod, build_unified_rl
|
|
|
|
__all__ = [
|
|
"TrainingMethod", "new_instance", "predict_x0",
|
|
"FineTuneMethod", "build_finetune",
|
|
"DMD2Method", "build_dmd2",
|
|
"DiffusionNFTMethod", "build_diffusion_nft",
|
|
"SelfForcingMethod", "build_self_forcing",
|
|
"UnifiedRLMethod", "build_unified_rl",
|
|
"JointMultiExpertRL", "build_joint_multi_rl",
|
|
]
|