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
8 changes: 6 additions & 2 deletions tasks/deprecated_task/train_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def main():
weights_path=args.model.model_path,
enable_full_shard=args.train.accelerator.fsdp_config.full_shard,
enable_reshard_after_forward=args.train.accelerator.fsdp_config.reshard_after_forward,
enable_mixed_precision=args.train.enable_mixed_precision,
mixed_precision=args.train.accelerator.fsdp_config.mixed_precision,
enable_gradient_checkpointing=args.train.gradient_checkpointing.enable,
init_device=args.train.init_device,
enable_fsdp_offload=args.train.accelerator.fsdp_config.offload,
Expand Down Expand Up @@ -473,7 +473,11 @@ def main():
extra_input = model.prepare_extra_input(latents)
# noise and target
noisy_latents = flow_scheduler.add_noise(
latents, noise, timestep, args.train.micro_batch_size, args.train.enable_mixed_precision
latents,
noise,
timestep,
args.train.micro_batch_size,
args.train.accelerator.fsdp_config.mixed_precision.enable,
)
training_target = flow_scheduler.training_target(latents, noise, timestep)
# predict noise
Expand Down
2 changes: 1 addition & 1 deletion tasks/deprecated_task/train_qwen_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def main():
weights_path=args.model.model_path,
enable_full_shard=args.train.accelerator.fsdp_config.full_shard,
enable_reshard_after_forward=args.train.accelerator.fsdp_config.reshard_after_forward,
enable_mixed_precision=args.train.enable_mixed_precision,
mixed_precision=args.train.accelerator.fsdp_config.mixed_precision,
enable_gradient_checkpointing=args.train.gradient_checkpointing.enable,
enable_fsdp_offload=args.train.accelerator.fsdp_config.offload,
basic_modules=model._no_split_modules + args.model.basic_modules,
Expand Down
4 changes: 2 additions & 2 deletions tasks/deprecated_task/train_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def main():
model = build_foundation_model(
config_path=args.model.config_path,
weights_path=args.model.model_path,
torch_dtype="float32" if args.train.enable_mixed_precision else "bfloat16",
torch_dtype="float32" if args.train.accelerator.fsdp_config.mixed_precision.enable else "bfloat16",
attn_implementation=args.model.ops_implementation.attn_implementation,
moe_implementation=args.model.ops_implementation.moe_implementation,
init_device=args.train.init_device,
Expand All @@ -151,7 +151,7 @@ def main():
weights_path=args.model.model_path,
enable_full_shard=args.train.accelerator.fsdp_config.full_shard,
enable_reshard_after_forward=args.train.accelerator.fsdp_config.reshard_after_forward,
enable_mixed_precision=args.train.enable_mixed_precision,
mixed_precision=args.train.accelerator.fsdp_config.mixed_precision,
enable_gradient_checkpointing=args.train.gradient_checkpointing.enable,
enable_fsdp_offload=args.train.accelerator.fsdp_config.offload,
basic_modules=list(set(getattr(model, "_no_split_modules", None) or []) | set(args.model.basic_modules)),
Expand Down
4 changes: 2 additions & 2 deletions tasks/deprecated_task/train_wan.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def main():
weights_path=args.model.model_path,
enable_full_shard=args.train.accelerator.fsdp_config.full_shard,
enable_reshard_after_forward=args.train.accelerator.fsdp_config.reshard_after_forward,
enable_mixed_precision=args.train.enable_mixed_precision,
mixed_precision=args.train.accelerator.fsdp_config.mixed_precision,
enable_gradient_checkpointing=args.train.gradient_checkpointing.enable,
init_device=args.train.init_device,
enable_fsdp_offload=args.train.accelerator.fsdp_config.offload,
Expand Down Expand Up @@ -366,7 +366,7 @@ def main():
noise,
timestep,
args.train.micro_batch_size,
args.train.enable_mixed_precision,
args.train.accelerator.fsdp_config.mixed_precision.enable,
)
training_target = flow_scheduler.training_target(latents, noise, timestep)
# predict noise
Expand Down
Loading