AITemplate icon indicating copy to clipboard operation
AITemplate copied to clipboard

Add fp32 support for stablediffusion

Open benjibc opened this issue 1 year ago • 2 comments

Want to be able to use stablediffusion at different precision, starting with fp32 for the simplest case

python scripts/compile.py --dtype=float32 --use-fp16-acc=False

currently stuck at https://gist.github.com/benjibc/838476ee6b5ff326eb6a94ef87b31cd2

benjibc avatar Apr 12 '23 21:04 benjibc

Hi @benjibc!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

facebook-github-bot avatar Apr 12 '23 21:04 facebook-github-bot

Thanks for your contribution! From the stack trace, it seems that the input tensor type is fp16 instead of fp32. Maybe some previous operators have hard-coded fp16 as the output dtype.

Could you print logs inside fbcode/aitemplate/AITemplate/examples/05_stable_diffusion/src/modeling/clip.py forward() function? You could print out input and output tensors of each operator and check which tensors are fp16 instead of fp32, and debug from there.

ipiszy avatar Apr 12 '23 22:04 ipiszy