You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The merge requests linked on this issue appears to be merged upstream. Does that mean LocalAI already supports Vulkan or there are any additional tasks to do before that?
The merge requests linked on this issue appears to be merged upstream. Does that mean LocalAI already supports Vulkan or there are any additional tasks to do before that?
The merge requests linked on this issue appears to be merged upstream. Does that mean LocalAI already supports Vulkan or there are any additional tasks to do before that?
It seems that we need to set BUILD_TYPE=vulkan to let llama.cpp use vulkan. But does this mean we have to rebuild the program if we want to use CPU backend? I do not see any option to let me switch between them at runtime.
I have a pretty old GTX 1050Ti Mobile GPU, which means that I can only run some mini models on it, but it is still much faster than run those small models on CPU. With the ability to switch dynamically, I can run mini models on my GPU while can also try some larger models with my CPU. The reason why I do not use cuda is that vulkan is much smaller than cuda runtime. Although using vulkan is slower than using cublas, I think it is acceptable on my old buddy.
My idea is that we can also let vulkan backend optional like cuda backend, so LocalAI will prefer vulkan backend while can also fallback to CPU backend. At this moment, I find that LocalAI cannot turn to use CPU if it meets large models failed to load into GPU when building with BUILD_TYPE=vulkan.
It seems that we need to set BUILD_TYPE=vulkan to let llama.cpp use vulkan. But does this mean we have to rebuild the program if we want to use CPU backend? I do not see any option to let me switch between them at runtime.
I have a pretty old GTX 1050Ti Mobile GPU, which means that I can only run some mini models on it, but it is still much faster than run those small models on CPU. With the ability to switch dynamically, I can run mini models on my GPU while can also try some larger models with my CPU. The reason why I do not use cuda is that vulkan is much smaller than cuda runtime. Although using vulkan is slower than using cublas, I think it is acceptable on my old buddy.
My idea is that we can also let vulkan backend optional like cuda backend, so LocalAI will prefer vulkan backend while can also fallback to CPU backend. At this moment, I find that LocalAI cannot turn to use CPU if it meets large models failed to load into GPU when building with BUILD_TYPE=vulkan.
You can technically don't pass ngl or set it to 0 to not use GPU for offload
It seems that we need to set BUILD_TYPE=vulkan to let llama.cpp use vulkan. But does this mean we have to rebuild the program if we want to use CPU backend? I do not see any option to let me switch between them at runtime.
I have a pretty old GTX 1050Ti Mobile GPU, which means that I can only run some mini models on it, but it is still much faster than run those small models on CPU. With the ability to switch dynamically, I can run mini models on my GPU while can also try some larger models with my CPU. The reason why I do not use cuda is that vulkan is much smaller than cuda runtime. Although using vulkan is slower than using cublas, I think it is acceptable on my old buddy.
My idea is that we can also let vulkan backend optional like cuda backend, so LocalAI will prefer vulkan backend while can also fallback to CPU backend. At this moment, I find that LocalAI cannot turn to use CPU if it meets large models failed to load into GPU when building with BUILD_TYPE=vulkan.
You can technically don't pass ngl or set it to 0 to not use GPU for offload
I found a very hacky way to achieve that: Build llama-cpp-fallback with BUILD_TYPE=openblas, while build other parts with BUILD_TYPE=vulkan. Then LocalAI will try vulkan first, and fallback to openblas. But this means that I have to enable other optimizations on llama-cpp-fallback. I am not sure if this usage is valid because there do not have any documentation about the mixture of types of backends.
Interesting, thanks for that @arenekosreal !
Technically llama.cpp is able to be compiled with multiple backends backed in, so this distinction in LocalAI is interesting to see
Activity
feat(sycl): Add sycl support (#1647)
feat(sycl): Add sycl support (#1647)
[-]llama.cpp Vulkan, Kompute, SYCL[/-][+]feat(llama.cpp): Vulkan, Kompute, SYCL[/+]feat(sycl): Add sycl support (#1647)
feat(sycl): Add support for Intel GPUs with sycl (#1647) (#1660)
RiQuY commentedon Apr 8, 2024
The merge requests linked on this issue appears to be merged upstream. Does that mean LocalAI already supports Vulkan or there are any additional tasks to do before that?
mudler commentedon Jun 24, 2024
Only kompute is missing as for now
jim3692 commentedon Sep 9, 2024
It looks like kompute is also merged
KhazAkar commentedon Nov 19, 2024
So.. what's missing in LocalAI to support vulkan? Or compilation of in-tree llama.cpp to support vulkan would be enough to use it?
arenekosreal commentedon Feb 16, 2025
It seems that we need to set
BUILD_TYPE=vulkanto let llama.cpp use vulkan. But does this mean we have to rebuild the program if we want to use CPU backend? I do not see any option to let me switch between them at runtime.I have a pretty old GTX 1050Ti Mobile GPU, which means that I can only run some mini models on it, but it is still much faster than run those small models on CPU. With the ability to switch dynamically, I can run mini models on my GPU while can also try some larger models with my CPU. The reason why I do not use cuda is that vulkan is much smaller than cuda runtime. Although using vulkan is slower than using cublas, I think it is acceptable on my old buddy.
My idea is that we can also let vulkan backend optional like cuda backend, so LocalAI will prefer vulkan backend while can also fallback to CPU backend. At this moment, I find that LocalAI cannot turn to use CPU if it meets large models failed to load into GPU when building with
BUILD_TYPE=vulkan.KhazAkar commentedon Feb 16, 2025
You can technically don't pass ngl or set it to 0 to not use GPU for offload
arenekosreal commentedon Feb 17, 2025
I found a very hacky way to achieve that: Build
llama-cpp-fallbackwithBUILD_TYPE=openblas, while build other parts withBUILD_TYPE=vulkan. Then LocalAI will try vulkan first, and fallback to openblas. But this means that I have to enable other optimizations onllama-cpp-fallback. I am not sure if this usage is valid because there do not have any documentation about the mixture of types of backends.KhazAkar commentedon Feb 17, 2025
Interesting, thanks for that @arenekosreal !
Technically llama.cpp is able to be compiled with multiple backends backed in, so this distinction in LocalAI is interesting to see