-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix video diffusion black output if --bf16 is set. #1685
base: main
Are you sure you want to change the base?
Conversation
add hpu graph support Signed-off-by: Wang, Yi A <[email protected]>
find it's caused by sdpa. so use hpu AttnProcessor2_0 to replace the original one |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Signed-off-by: Wang, Yi A <[email protected]>
Signed-off-by: Wang, Yi A <[email protected]>
Signed-off-by: Wang, Yi A <[email protected]>
The code quality check failed, please run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(Need to run |
@@ -372,7 +383,7 @@ def __call__( | |||
# 4. Encode input image using VAE | |||
image = self.video_processor.preprocess(image, height=height, width=width) | |||
# torch.randn is broken on HPU so running it on CPU | |||
rand_device = "cpu" if device.type == "hpu" else device | |||
rand_device = torch.device("cpu") if device.type == "hpu" else device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sywangyi is it still requiring rand to be on cpu to fix the black output issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, black issue is fixed by using fused sdpa, and sdp_on_bf16.
this "cpu“ is fix the ci failure.
add hpu graph support
follow the readme guide
PT_HPU_MAX_COMPOUND_OP_SIZE=1 python image_to_video_generation.
py --model_name_or_path "stabilityai/stable-video-diffusion-img2vid-xt" --image_path "https://huggingface.co/datasets/huggingface/document
ation-images/resolve/main/diffusers/svd/rocket.png" --num_videos_per_prompt 1 --video_save_dir /tmp/stable_video_diffusion_xt --save_frames_as_images --use_habana --use_hpu_graphs --gaudi_config Habana/stable-diffusion --sdp_on_bf16 --bf16
the output video is black in 1.19