Skip to content

[bug]: Krea2 Inference is slow on MPS (due to hardcoded bfloat16 dtype) #9575

Description

@grunblatt-git

Is there an existing issue for this problem?

  • I have searched the existing issues

Install method

Invoke's Launcher

Operating system

macOS

GPU vendor

Apple Silicon (MPS)

GPU model

No response

GPU VRAM

32GB

Version number

v6.14.1

Browser

Chrome

System Information

No response

What happened

Krea2 inference is significantly slower on Apple Silicon/MPS when using the current BF16-safe dtype selection. In testing, hardcoding float32 instead is approximately 2x faster than the current BF16 path on Mac Silicon.

Krea2 currently calls TorchDevice.choose_bfloat16_safe_dtype() in several places, including the Diffusers model loader:
krea2.py#L291
The helper selects BF16 when the device accepts BF16 tensors. On MPS, this results in Krea2 running with BF16 even though FP32 performs substantially faster in practice.

What you expected to happen

Krea2 should use the fastest suitable dtype on Apple Silicon. For MPS, FP32 should be preferred if it provides better performance than BF16.

Alternatively the precision setting in invokeai.yaml should be honoured for krea2 models.

How to reproduce the problem

No response

Additional context

No response

Discord username

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions