ml-stable-diffusion icon indicating copy to clipboard operation
ml-stable-diffusion copied to clipboard

CoreML sdxl-v1-base-palettized fails on deployment to iPhone with error E5RT: MILCompileForANE error: failed to compile ANE model using ANEF. Error=_ANECompiler : ANECCompile() FAILED (11)

Open davidw0311 opened this issue 2 years ago • 2 comments

I am trying to deploy a core ml model to my iPhone 13 Pro Max (iOS 17 beta)

Using the checkpoints from https://huggingface.co/apple/coreml-stable-diffusion-mixed-bit-palettization/tree/main/coreml-stable-diffusion-xl-base_mbp_4_50_palettized.

My swift initialization of the model is as follows: image

The model loading runs for around 9 mins before crashing with the error: Untitled

Doing monitoring with xcode, it appears that memory spikes right before the crash and the text_encoder_2 is not finished loading: image

Appreciate any suggestions on how to deply the sd-xl model successfully on iPhone.

davidw0311 avatar Sep 11 '23 18:09 davidw0311

This is related to #242 as cpuAndNeuralEngine is meant to be used with a SPLIT_EINSUM (or SPLIT_EINSUM_V2) model whereas the model you linked to is an ORIGINAL model which is meant for cpuAndGPU. We will share some instructions on this soon.

atiorh avatar Sep 11 '23 20:09 atiorh