huggingface / huggingface/candle

Metal error with Flux image diffusion cast_bf16_f32 does not exist

Open
#2,406 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
21k
Forks
1.8k
Avg merge
16h 42m
Merged PRs (30d)
25

Description

Running the new Flux model on Mac M1 Metal

running the example
```
cargo run --features metal --example flux -r -- \
--height 1024 --width 1024 \
--prompt "a rusty robot walking on a beach holding a small torch, the robot has the word "rust" written on it, high quality, 4k" --model schnell
```

and after downloading the models and trying to run
```
Tensor[[1, 768], f32, metal:4294969333]
Error: Metal error Error while loading function: "Function 'cast_bf16_f32' does not exist"

Caused by:
Error while loading function: "Function 'cast_bf16_f32' does not exist"

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `flux` example and the provided `cargo run --features metal --example flux` command on a Mac M1. Trace the Metal execution path that requests `cast_bf16_f32`; the work is done when the example runs without the missing-function error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.