[feat] add PPU platform for PPU-ZW810E#1149
Conversation
There was a problem hiding this comment.
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.
| lightx2v_path= | ||
| model_path= | ||
|
|
||
| export CUDA_VISIBLE_DEVICES=0 | ||
|
|
||
| # set environment variables | ||
| source ${lightx2v_path}/scripts/base/base.sh |
There was a problem hiding this comment.
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.
| 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" |
| 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 |
There was a problem hiding this comment.
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.
| 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" |
| # 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 |
There was a problem hiding this comment.
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
No description provided.