Skip to content

Add multi-control transfer inference#69

Merged
lfengad merged 2 commits into
mainfrom
pick-multi-control-transfer
Jun 30, 2026
Merged

Add multi-control transfer inference#69
lfengad merged 2 commits into
mainfrom
pick-multi-control-transfer

Conversation

@lfengad

@lfengad lfengad commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Port multi-control transfer inference from imaginaire4 (commit 0aafd95958) into cosmos_framework, remapping projects/cosmos3/vfm/* -> cosmos_framework/{model,data}/vfm/* and packages/cosmos3/cosmos3/* -> cosmos_framework/inference/*.

N independent maskless SDPA passes (one per control), with the noisy output as the weighted sum across controls; N=1, weight=1.0 reproduces two_way_attention exactly. Adds a per-control weight arg/override, threads control_weights through the batch -> GenerationDataClean -> PackedSequence -> SplitInfo, and routes to the new multi_control_two_way_attention in dispatch_attention.

lfengad and others added 2 commits June 30, 2026 06:01
Port multi-control transfer inference from imaginaire4
(commit 0aafd95958) into cosmos_framework, remapping
projects/cosmos3/vfm/* -> cosmos_framework/{model,data}/vfm/* and
packages/cosmos3/cosmos3/* -> cosmos_framework/inference/*.

N independent maskless SDPA passes (one per control), with the noisy
output as the weighted sum across controls; N=1, weight=1.0 reproduces
two_way_attention exactly. Adds a per-control `weight` arg/override,
threads control_weights through the batch -> GenerationDataClean ->
PackedSequence -> SplitInfo, and routes to the new
multi_control_two_way_attention in dispatch_attention.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OverridesBase._build resolves overrides via model_validate(model_dump())
without exclude_none, so an unset `weight` arrives as None at the resolved
TransferArgs.weight (typed float), failing pydantic validation
(edge.weight: float_type, input_value=None). This broke the
generator-inference-smoke transfer_edge run, whose JSON sets control_path
and preset_edge_threshold but not weight.

Add a before-validator on TransferArgs.weight that maps None -> 1.0
(neutral / single-control parity), keeping the I4 field signatures intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lfengad lfengad enabled auto-merge (squash) June 30, 2026 14:28
@lfengad lfengad merged commit 24300b4 into main Jun 30, 2026
8 checks passed
@lfengad lfengad deleted the pick-multi-control-transfer branch June 30, 2026 14:30
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.

4 participants