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
2 changes: 1 addition & 1 deletion configs/wan22_vace/a800/bf16/wan22_moe_vace.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sample_shift": 8,
"enable_cfg": true,
"cpu_offload": true,
"offload_granularity": "block",
"offload_granularity": "model",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The offload_granularity is set to model, but the implementation for CPU offloading appears to only support block and phase. With cpu_offload enabled in this configuration, this change will likely cause a NotImplementedError at runtime. Please either implement support for model granularity or revert this to a supported value like block.

Suggested change
"offload_granularity": "model",
"offload_granularity": "block",

"t5_cpu_offload": false,
"vae_cpu_offload": false,
"boundary": 0.900,
Expand Down
2 changes: 1 addition & 1 deletion configs/wan22_vace/a800/bf16/wan22_moe_vace_cfg_parallel.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sample_shift": 8,
"enable_cfg": true,
"cpu_offload": true,
"offload_granularity": "block",
"offload_granularity": "model",
"t5_cpu_offload": false,
"vae_cpu_offload": false,
"boundary": 0.900,
Expand Down
2 changes: 1 addition & 1 deletion configs/wan22_vace/a800/bf16/wan22_moe_vace_cfg_sp_parallel.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sample_shift": 8,
"enable_cfg": true,
"cpu_offload": true,
"offload_granularity": "block",
"offload_granularity": "model",
"t5_cpu_offload": false,
"vae_cpu_offload": false,
"boundary": 0.900,
Expand Down
2 changes: 1 addition & 1 deletion configs/wan22_vace/a800/int8/wan22_moe_vace.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sample_shift": 8,
"enable_cfg": true,
"cpu_offload": true,
"offload_granularity": "block",
"offload_granularity": "model",
"t5_cpu_offload": false,
"vae_cpu_offload": false,
"boundary": 0.900,
Expand Down
2 changes: 1 addition & 1 deletion configs/wan22_vace/a800/int8/wan22_moe_vace_cfg_parallel.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sample_shift": 8,
"enable_cfg": true,
"cpu_offload": true,
"offload_granularity": "block",
"offload_granularity": "model",
"t5_cpu_offload": false,
"vae_cpu_offload": false,
"boundary": 0.900,
Expand Down
2 changes: 1 addition & 1 deletion configs/wan22_vace/a800/int8/wan22_moe_vace_cfg_sp_parallel.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sample_shift": 8,
"enable_cfg": true,
"cpu_offload": true,
"offload_granularity": "block",
"offload_granularity": "model",
"t5_cpu_offload": false,
"vae_cpu_offload": false,
"boundary": 0.900,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, base_block_idx, block_index, task, mm_type, config, create_cu
if base_block_idx == 0:
self.compute_phases[0].add_module(
"before_proj",
MM_WEIGHT_REGISTER[self.mm_type](
MM_WEIGHT_REGISTER["Default"](
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Hardcoding the MM_WEIGHT_REGISTER key to "Default" overrides the configured mm_type. This will prevent quantization schemes like int8-sgl (defined by dit_quant_scheme in config files) from being applied to the before_proj module. This seems unintentional and could lead to incorrect behavior or performance degradation when quantization is enabled. It's recommended to use self.mm_type to respect the configuration.

Suggested change
MM_WEIGHT_REGISTER["Default"](
MM_WEIGHT_REGISTER[self.mm_type](

f"{block_prefix}.{self.block_index}.before_proj.weight",
f"{block_prefix}.{self.block_index}.before_proj.bias",
create_cuda_buffer,
Expand All @@ -65,7 +65,7 @@ def __init__(self, base_block_idx, block_index, task, mm_type, config, create_cu

self.compute_phases[-1].add_module(
"after_proj",
MM_WEIGHT_REGISTER[self.mm_type](
MM_WEIGHT_REGISTER["Default"](
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Similar to the before_proj module, hardcoding the MM_WEIGHT_REGISTER key to "Default" for after_proj will prevent quantization from being applied. This should likely use self.mm_type to adhere to the model's configuration.

Suggested change
MM_WEIGHT_REGISTER["Default"](
MM_WEIGHT_REGISTER[self.mm_type](

f"{block_prefix}.{self.block_index}.after_proj.weight",
f"{block_prefix}.{self.block_index}.after_proj.bias",
create_cuda_buffer,
Expand Down
3 changes: 1 addition & 2 deletions scripts/wan22_moe_vace/run_wan22_moe_vace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ python -m lightx2v.infer \
--task vace \
--model_path $model_path \
--config_json ${lightx2v_path}/configs/wan22_vace/a800/bf16/wan22_moe_vace.json \
# --config_json ${lightx2v_path}/configs/wan22_vace/a800/int8/wan22_moe_vace.json \
--prompt "模仿视频的动作,翩翩起舞." \
--prompt "图片的女人,穿着白色连衣裙,模仿视频的动作,翩翩起舞." \
--negative_prompt "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" \
--src_video /path/to/post+depth.mp4 \
--src_ref_images /path/to/image.png \
Expand Down
3 changes: 1 addition & 2 deletions scripts/wan22_moe_vace/run_wan22_moe_vace_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ torchrun --nproc_per_node=2 -m lightx2v.infer \
--task vace \
--model_path $model_path \
--config_json ${lightx2v_path}/configs/wan22_vace/a800/bf16/wan22_moe_vace_cfg_parallel.json \
# --config_json ${lightx2v_path}/configs/wan22_vace/a800/int8/wan22_moe_vace_cfg_parallel.json \
--prompt "模仿视频的动作,翩翩起舞." \
--prompt "图片的女人,穿着白色连衣裙,模仿视频的动作,翩翩起舞." \
--negative_prompt "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" \
--src_video /path/to/post+depth.mp4 \
--src_ref_images /path/to/image.png \
Expand Down