mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
chore: detect and enable avx512 builds (#4675)
chore(avx512): add support Fixes https://github.com/mudler/LocalAI/issues/4662 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
f9e368b7c4
commit
5177837ab0
3 changed files with 17 additions and 1 deletions
|
@ -48,6 +48,7 @@ const (
|
|||
LLamaCPP = "llama-cpp"
|
||||
|
||||
LLamaCPPAVX2 = "llama-cpp-avx2"
|
||||
LLamaCPPAVX512 = "llama-cpp-avx512"
|
||||
LLamaCPPAVX = "llama-cpp-avx"
|
||||
LLamaCPPFallback = "llama-cpp-fallback"
|
||||
LLamaCPPCUDA = "llama-cpp-cuda"
|
||||
|
@ -68,6 +69,7 @@ const (
|
|||
|
||||
var llamaCPPVariants = []string{
|
||||
LLamaCPPAVX2,
|
||||
LLamaCPPAVX512,
|
||||
LLamaCPPAVX,
|
||||
LLamaCPPFallback,
|
||||
LLamaCPPCUDA,
|
||||
|
@ -268,6 +270,12 @@ func selectGRPCProcessByHostCapabilities(backend, assetDir string, f16 bool) str
|
|||
log.Info().Msgf("[%s] attempting to load with AVX2 variant", backend)
|
||||
selectedProcess = p
|
||||
}
|
||||
} else if xsysinfo.HasCPUCaps(cpuid.AVX512F) {
|
||||
p := backendPath(assetDir, LLamaCPPAVX512)
|
||||
if _, err := os.Stat(p); err == nil {
|
||||
log.Info().Msgf("[%s] attempting to load with AVX512 variant", backend)
|
||||
selectedProcess = p
|
||||
}
|
||||
} else if xsysinfo.HasCPUCaps(cpuid.AVX) {
|
||||
p := backendPath(assetDir, LLamaCPPAVX)
|
||||
if _, err := os.Stat(p); err == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue