feat(stablediffusion): Enable SYCL#5144
Conversation
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| cd build && \ | ||
| cmake $(CMAKE_ARGS) ../../../../../sources/stablediffusion-ggml.cpp && \ | ||
| cmake --build . --config Release" | ||
| cmake --build . --config Release -j$(nproc)" |
There was a problem hiding this comment.
Ah, it's already in llama ccp's build now from my last pr, but I guess it should be passed down from the main makefile invocation
There was a problem hiding this comment.
OK, it appears that just passing -j to the top level Makefile I get 100% CPU usage, probably meaning the nest make process launched by cmake cooperates with the top level one. Now I feel silly.
|
Hit a bit of wall here, there are linker errors for mkl and dnnl when compiling the CGO executable which of course is not using CMake. Maybe I can use pkg-config instead, I'm not sure? (https://www.intel.com/content/www/us/en/developer/articles/technical/intel-math-kernel-library-intel-mkl-and-pkg-config-tool.html) Other options would be to avoid CGO, which I guess sucks because that means more C++ or try to produce an SO file for SD that has everything linked in already. That doesn't seem like the greatest solution... |
|
I ended up using this: https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html and pkg-config to setup the CGO flags |
This is a pain because we compile with CGO, but SD is compiled with CMake. I don't think we can easily use CMake to set the linker flags necessary. Also I could not find pkg-config calls that would fully set the flags, so some of them are set manually. See https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html for reference. I also resorted to searching the shared object files in MKLROOT/lib for the symbols. Signed-off-by: Richard Palethorpe <io@richiejp.com>
Signed-off-by: Richard Palethorpe <io@richiejp.com>
|
Assuming no CI failures, now waiting on leejet/stable-diffusion.cpp#651 |

Description
Enable SYCL for Stablediffusion. It's supported by SD, we just have issues compiling.
#5132
Notes for Reviewers
WIP
Signed commits