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

Function 'cast_bf16_f16' does not exist #2660

Open
super-fun-surf opened this issue Dec 6, 2024 · 3 comments
Open

Function 'cast_bf16_f16' does not exist #2660

super-fun-surf opened this issue Dec 6, 2024 · 3 comments

Comments

@super-fun-surf
Copy link

Using the stable-diffusion-3 example on a Mac with metal feature. When I run these lines

    let vb_vae = vb.clone().rename_f(sd3_vae_vb_rename).pp("first_stage_model");
    println!("vb_vae dtype {:?}", vb_vae.dtype());
    let autoencoder = build_sd3_vae_autoencoder(vb_vae)?;
    println!("autoencoder {:?}", autoencoder);

I get the error when it is trying to build the autoencoder

vb_vae dtype F16
creating autoencoder
Error: Metal error Error while loading function: "Function 'cast_bf16_f16' does not exist"
@LaurentMazare
Copy link
Collaborator

Probably the same as #2406

@super-fun-surf
Copy link
Author

so does that mean its a clang problem and not a candle/metal problem? this one is for f16
not sure how to troubleshoot?

@LaurentMazare
Copy link
Collaborator

I doubt that it's related to the f16 part, the most like is the bf16 as this part is detected automatically and fails for older versions of clang (and maybe in other cases?)
The detection is conditioned in the .metal file by the __HAVE_BFLOAT__ variable, googling around you find this issue that got mentioned in the other thread tinygrad/tinygrad#3453 .

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

2 participants