-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Fix for OpenCL / clbast builds on macOS. #1329
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
On macOS we have to load OpenCL as a framework rather than just a library.
Just wondering; I did get this to compile by adding the CFLAGS and LDFLAGS pointing to the
I looked it up and -30 stands for |
I was putting together an issue for this. Have you tried removing that
flag, or is it necessary for the code to function as expected?
…On Fri, May 5, 2023, 12:28 PM swittk ***@***.***> wrote:
Just wondering; I did get this to compile by adding the CFLAGS and LDFLAGS
pointing to the homebrew installation of CLBlast (e.g.
-I/opt/homebrew/Cellar/clblast/1.5.3_1/include) and doing a similar
change in the Makefile, but the main executable has always crashed with
the following error:
Initializing CLBlast (First Run)...
Attempting to use: Platform=0, Device=0 (If invalid, program will crash)
Using Platform: Apple Device: Apple M1 Max
OpenCL clCreateCommandQueue error -30 at ggml-opencl.c:229
I looked it up and -30 stands for CL_INVALID_VALUE
<https://streamhpc.com/blog/2013-04-28/opencl-error-codes/>, and I've
seen reports of CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE not being
supported on Mac OS.
So I'm not sure if you encounter this too (or if not, what Mac are you
using).
—
Reply to this email directly, view it on GitHub
<#1329 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYUBFDI4KKNQXMVZ5NAH3DXEUTCXANCNFSM6AAAAAAXWNFPVA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I've tried setting the option in CLBlast (
Accelerate (standard
Generally it feels like the eval part is still using the CPU like before, but the prompt eval is running on the GPU and is slightly faster than Accelerate. |
|
Ah. I see, thanks. Prompt processing speedup is still great I guess. |
Hi @swittk just wondering, have you tested above with longer prompts etc? - it seems to me that others using GPU enabled BLAS libraries with llama.cpp (cuBLAS, rocBLAS) are getting significant performance improvements with more than just prompt eval offloading work onto GPU so I’m wondering if/why a CL-BLAS framework compiled natively wouldn’t be utilising Apple Silicon GPUs for significant performance improvement with bigger batch sizes/prompts? Is there some missing CL-BLAS framework related switch which needs to be enabled for GPU/MPS use? eg. Number of GPU threads to use etc? Does the homebrew version of CL-BLAS properly engage Apple Silicon MPS? I’ve a feeling that there is performance being left on the table with underutilisation of Apple Silicon and had hoped BLAS might pick up a bit more of that performance? Any light you could shed on this would be appreciated. Thanks in advance. |
You might need to select the device to run on with an env Var (don't recall
the name off hand), but on my MacBook I have to set it to use device 2, to
see the speedup from running on my Radeon Pro Vega 20
…On Wed, May 17, 2023, 2:54 AM deep-pipeline ***@***.***> wrote:
Hi @swittk <https://github.com/swittk> just wondering, have you tested
above with longer prompts etc? - it seems to me that others using GPU
enabled BLAS libraries with llama.cpp (cuBLAS, rocBLAS) are getting
significant performance improvements with more than just prompt eval
offloading work onto GPU so I’m wondering if/why a CL-BLAS framework
compiled natively wouldn’t be utilising Apple Silicon GPUs for significant
performance improvement with bigger batch sizes/prompts?
Is there some missing CL-BLAS framework related switch which needs to be
enabled for GPU/MPS use? eg. Number of GPU threads to use etc? Does the
homebrew version of CL-BLAS properly engage Apple Silicon MPS? I’ve a
feeling that there is performance being left on the table with
underutilisation of Apple Silicon and had hoped BLAS might pick up a bit
more of that performance?
Any light you could shed on this would be appreciated. Thanks in advance.
—
Reply to this email directly, view it on GitHub
<#1329 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYUBFA5YXMVYHZ7G5JVDRLXGRY3HANCNFSM6AAAAAAXWNFPVA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Interesting - thanks @IonoclastBrigham - I guess you must be using a thunderbolt eGPU housing for your AMD Radeon, so maybe you are using an Intel MacBook on an older MacOS? I seem to recall reading there were serious headaches about OS updates, hardware updates and connectivity - what the situation like now? Is it viable to use a thunderbolt eGPU to house a GPU (Nvidia/AMD) plugged in to an Apple Silicon machine running latest 13.3.x OS or is it still a nightmare to link stuff up..? As re: device ENV setting, I take it that’s a CL-BLAS related ENV variable? In your case with an AMD device does CL-BLAS then link to rocBLAS? Just trying to get my head around the order of the stack and linked libraries.. and where any device setting might enable MPS.. Cheers!
|
On macOS we have to load OpenCL as a framework rather than just a library.