-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(stablediffusion): Enable SYCL #5144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -76,21 +94,35 @@ ifneq (,$(findstring sycl,$(BUILD_TYPE))) | |||
mkdir -p build && \ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could bust our CIs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Signed-off-by: Richard Palethorpe <[email protected]>
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