Skip to content

[feat] add PPU platform for PPU-ZW810E#1149

Merged
helloyongyang merged 2 commits into
mainfrom
dev/ppu
Jun 15, 2026
Merged

[feat] add PPU platform for PPU-ZW810E#1149
helloyongyang merged 2 commits into
mainfrom
dev/ppu

Conversation

@XHPlus

@XHPlus XHPlus commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request adds support for the PPU-ZW810E platform by introducing a Dockerfile, a configuration file for the wan_moe_i2v_distill_with_lora model, and an inference shell script. The review feedback highlights several critical improvements: validating and allowing environment inheritance for path variables in the shell script to prevent execution failures, double-quoting variable expansions to avoid word splitting, and pinning package versions in the Dockerfile to ensure reproducible builds.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +4 to +10
lightx2v_path=
model_path=

export CUDA_VISIBLE_DEVICES=0

# set environment variables
source ${lightx2v_path}/scripts/base/base.sh

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

The script unconditionally resets lightx2v_path and model_path to empty strings, which overrides any environment variables previously exported by the user. Additionally, if lightx2v_path is empty, sourcing base.sh on line 10 will fail with a 'No such file or directory' error. Since set -e is not enabled, the script will continue to execute the python command in an unconfigured environment, leading to a ModuleNotFoundError.

To fix this, we should allow inheriting these variables from the environment and validate lightx2v_path before attempting to source base.sh.

Suggested change
lightx2v_path=
model_path=
export CUDA_VISIBLE_DEVICES=0
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
lightx2v_path=${lightx2v_path:-""}
model_path=${model_path:-""}
if [ -z "$lightx2v_path" ]; then
echo "Error: lightx2v_path is not set. Please set or export this variable first."
exit 1
fi
export CUDA_VISIBLE_DEVICES=0
# set environment variables
source "${lightx2v_path}/scripts/base/base.sh"

Comment on lines +12 to +20
python -m lightx2v.infer \
--model_cls wan2.2_moe_distill \
--task i2v \
--model_path $model_path \
--config_json ${lightx2v_path}/configs/platforms/ppu/wan_moe_i2v_distill_with_lora.json \
--prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside." \
--negative_prompt "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" \
--image_path ${lightx2v_path}/assets/inputs/imgs/img_0.jpg \
--save_result_path ${lightx2v_path}/save_results/output_lightx2v_wan22_moe_i2v_distill_lora.mp4

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.

medium

It is a best practice in Bash to double-quote variable expansions (such as $model_path and ${lightx2v_path}) to prevent word splitting and globbing if the paths contain spaces or special characters.

Suggested change
python -m lightx2v.infer \
--model_cls wan2.2_moe_distill \
--task i2v \
--model_path $model_path \
--config_json ${lightx2v_path}/configs/platforms/ppu/wan_moe_i2v_distill_with_lora.json \
--prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside." \
--negative_prompt "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" \
--image_path ${lightx2v_path}/assets/inputs/imgs/img_0.jpg \
--save_result_path ${lightx2v_path}/save_results/output_lightx2v_wan22_moe_i2v_distill_lora.mp4
python -m lightx2v.infer \
--model_cls wan2.2_moe_distill \
--task i2v \
--model_path "$model_path" \
--config_json "${lightx2v_path}/configs/platforms/ppu/wan_moe_i2v_distill_with_lora.json" \
--prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside." \
--negative_prompt "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" \
--image_path "${lightx2v_path}/assets/inputs/imgs/img_0.jpg" \
--save_result_path "${lightx2v_path}/save_results/output_lightx2v_wan22_moe_i2v_distill_lora.mp4"

Comment on lines +31 to +37
# Install av
RUN pip install --no-cache-dir av

# Fix dependencies
RUN pip install -U peft
# sage-attn slower than flash-attn3
RUN pip install sageattention

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.

medium

Installing packages like av, peft, and sageattention without pinning their versions can lead to non-reproducible builds. If a newer version of any of these packages is released with breaking changes, the Docker build might fail or behave unexpectedly. It is highly recommended to pin these packages to specific, tested versions.

# Install av
RUN pip install --no-cache-dir av==12.3.0

# Fix dependencies
RUN pip install peft==0.12.0
# sage-attn slower than flash-attn3
RUN pip install sageattention==1.0.6

@helloyongyang helloyongyang merged commit 4a30fca into main Jun 15, 2026
2 checks passed
@helloyongyang helloyongyang deleted the dev/ppu branch June 15, 2026 07:29
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.

2 participants