Skip to content

Commit 344e430

Browse files
authored
[CI] Fix SSIM and transformers CI (#564)
1 parent c5155b2 commit 344e430

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

fastvideo/v1/models/loader/component_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def load_model(self,
252252
fastvideo_args: FastVideoArgs,
253253
dtype: str = "fp16"):
254254
use_cpu_offload = fastvideo_args.text_encoder_offload and len(
255-
model_config._fsdp_shard_conditions) > 0
255+
getattr(model_config, "_fsdp_shard_conditions", [])) > 0
256256

257257
if fastvideo_args.text_encoder_offload:
258258
target_device = torch.device("cpu")

fastvideo/v1/models/loader/fsdp_load.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ def maybe_load_fsdp_model(
106106
fsdp_shard_conditions=model._fsdp_shard_conditions,
107107
pin_cpu_memory=pin_cpu_memory)
108108

109-
weight_iterator = safetensors_weights_iterator(weight_dir_list,
110-
async_broadcast=True)
109+
weight_iterator = safetensors_weights_iterator(
110+
weight_dir_list, to_cpu=cpu_offload, async_broadcast=not cpu_offload)
111111
param_names_mapping_fn = get_param_names_mapping(model._param_names_mapping)
112112
load_model_from_full_model_state_dict(
113113
model,

fastvideo/v1/tests/transformers/test_hunyuanvideo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_hunyuanvideo_distributed():
8080

8181
# Initialize with identical weights
8282
model = initialize_identical_weights(model, seed=42)
83-
shard_model(model, cpu_offload=False,
83+
shard_model(model, cpu_offload=True,
8484
reshard_after_forward=True,
8585
fsdp_shard_conditions=model._fsdp_shard_conditions
8686
)
@@ -95,7 +95,7 @@ def test_hunyuanvideo_distributed():
9595

9696
# Move to GPU based on local rank (0 or 1 for 2 GPUs)
9797
device = torch.device(f"cuda:0")
98-
model = model.to(device)
98+
model = model
9999

100100
batch_size = 1
101101
seq_len = 3

fastvideo/v1/tests/transformers/test_hunyuanvideo_load.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_hunyuanvideo_distributed():
6262

6363
precision_str = "bf16"
6464
args = FastVideoArgs(model_path=TRANSFORMER_PATH,
65-
use_cpu_offload=False,
65+
use_cpu_offload=True,
6666
pipeline_config=PipelineConfig(dit_config=HunyuanVideoConfig(), dit_precision=precision_str))
6767
args.device = torch.device(f"cuda:{LOCAL_RANK}")
6868

fastvideo/v1/tests/transformers/test_wanvideo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ def test_wan_transformer():
3434
precision = torch.bfloat16
3535
precision_str = "bf16"
3636
args = FastVideoArgs(model_path=TRANSFORMER_PATH,
37-
use_cpu_offload=False,
37+
use_cpu_offload=True,
3838
pipeline_config=PipelineConfig(dit_config=WanVideoConfig(), dit_precision=precision_str))
3939
args.device = device
4040

4141
loader = TransformerLoader()
42-
model2 = loader.load(TRANSFORMER_PATH, "", args).to(device, dtype=precision)
42+
model2 = loader.load(TRANSFORMER_PATH, "", args).to(dtype=precision)
4343

4444
model1 = WanTransformer3DModel.from_pretrained(
4545
TRANSFORMER_PATH, device=device,

0 commit comments

Comments
 (0)