Skip to content
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

Commit fea46cb7 breaks Metal Stable Diffusion Generation #2385

Open
super-fun-surf opened this issue Aug 1, 2024 · 4 comments
Open

Commit fea46cb7 breaks Metal Stable Diffusion Generation #2385

super-fun-surf opened this issue Aug 1, 2024 · 4 comments

Comments

@super-fun-surf
Copy link

Commit fea46cb breaks the Image generation for the Metal pipeline.

still working commit 8696cf6

git checkout 8696cf64947a7f3b712297426078dcf6ab0d199e
Previous HEAD position was fea46cb7 Metal bgemm min changes (#2364)
HEAD is now at 8696cf64 Enable the affine kernel for u8/u32. (#2376)
➜  candle git:(8696cf64) cargo run --release --features metal  --example stable-diffusion -- --sd-version xl --n-steps 8 --width 1024 --height 1024 --use-f16 --prompt "crazy butterfly in the spring meadows, high quality, illustraion in the style of majoo mackinzee"
    Finished `release` profile [optimized] target(s) in 20.75s
     Running `target/release/examples/stable-diffusion --sd-version xl --n-steps 8 --width 1024 --height 1024 --use-f16 --prompt 'crazy butterfly in the spring meadows, high quality, illustraion in the style of majoo mackinzee'`
Running with prompt "crazy butterfly in the spring meadows, high quality, illustraion in the style of majoo mackinzee".
Building the Clip transformer.
Running with prompt "crazy butterfly in the spring meadows, high quality, illustraion in the style of majoo mackinzee".
Building the Clip transformer.

and it breaks on next commit fea46cb

➜  git checkout fea46cb719d5f59216f5b0a606400f1fd663190e
Previous HEAD position was bd80078a Fix log_sum_exp to handle large positive/negative inputs (#2367)
HEAD is now at fea46cb7 Metal bgemm min changes (#2364)
➜  candle git:(fea46cb7) cargo run --release --features metal  --example stable-diffusion -- --sd-version xl --n-steps 8 --width 1024 --height 1024 --use-f16 --prompt "crazy butterfly in the spring meadows, high quality, illustraion in the style of majoo mackinzee"
   Compiling candle-core v0.6.0 (/Users/pro/code/rust/candle/candle-core)
   Compiling candle-nn v0.6.0 (/Users/pro/code/rust/candle/candle-nn)
   Compiling candle-transformers v0.6.0 (/Users/pro/code/rust/candle/candle-transformers)
   Compiling candle-examples v0.6.0 (/Users/pro/code/rust/candle/candle-examples)
    Finished `release` profile [optimized] target(s) in 21.32s
     Running `target/release/examples/stable-diffusion --sd-version xl --n-steps 8 --width 1024 --height 1024 --use-f16 --prompt 'crazy butterfly in the spring meadows, high quality, illustraion in the style of majoo mackinzee'`
Running with prompt "crazy butterfly in the spring meadows, high quality, illustraion in the style of majoo mackinzee".
Building the Clip transformer.
Error: Metal error Error while loading function: "Compiler encountered an internal error"
@LaurentMazare
Copy link
Collaborator

Thanks for reporting this, tagging @ivarflakstad explicitly. If there is no easy fix I'll rollback the commit.

@ivarflakstad
Copy link
Member

Interesting. What machine are you running this on?

@super-fun-surf
Copy link
Author

Mac M1 16GB

@LaurentMazare
Copy link
Collaborator

We've reverted the problematic change in #2386 as @ivarflakstad has to conduct further investigations.

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

No branches or pull requests

3 participants