Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion miles/backends/fsdp_utils/loss_hub/flow_grpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def prepare_flow_grpo_batch(
if use_cfg
else None
)
# Cond dtypes are set at the model boundary by the family input_dtype_policy (see actor).
cfg_batching = use_cfg and bool(args.fsdp_cfg_batching)
joint_cond = pos_cond = neg_cond = None
if cfg_batching:
Expand Down
1 change: 0 additions & 1 deletion miles/backends/fsdp_utils/loss_hub/nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def prepare_nft_batch(

component_name, model = next(iter(ctx.models.items()))
pos_list = [config.prepare_cond_kwargs(batch[i]["denoising_env"].pos_cond_kwargs, device) for i in range(bsz)]
# Cond dtypes are set at the model boundary by the family input_dtype_policy (see actor).
pos_cond = config.collate_cond_for_sample_batch(pos_list, device, pad_to_len=pad_to_len)

num_train_timesteps = ctx.scheduler.config.num_train_timesteps
Expand Down
6 changes: 1 addition & 5 deletions miles/backends/fsdp_utils/loss_hub/sft.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import torch.nn as nn

from miles.backends.fsdp_utils.loss_hub.types import DiffusionLossContext, PreparedBatch
from miles.backends.fsdp_utils.loss_hub.utils import cast_cond_to_dtype
from miles.utils.metric_buffer import MetricBuffer


Expand Down Expand Up @@ -90,10 +89,7 @@ def prepare_sft_batch(
timesteps_for_model = timesteps

cond_list = [{key: value.to(device) for key, value in pair["cond_kwargs"].items()} for pair in batch]
pos_cond = cast_cond_to_dtype(
config.collate_cond_for_sample_batch(cond_list, device, pad_to_len=pad_to_len),
ctx.forward_dtype,
)
pos_cond = config.collate_cond_for_sample_batch(cond_list, device, pad_to_len=pad_to_len)

return PreparedBatch(
latents=latents,
Expand Down
Loading