mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 18:36:41 +02:00
Refine default thread selection for NUMA systems (#7322)
Until we have full NUMA support, this adjusts the default thread selection algorithm to count up the number of performance cores across all sockets.
This commit is contained in:
parent
c826e57475
commit
16f4eabe2d
3 changed files with 2121 additions and 6 deletions
|
@ -175,6 +175,11 @@ func (si SystemInfo) GetOptimalThreadCount() int {
|
|||
if len(si.System.CPUs) == 0 {
|
||||
return 0
|
||||
}
|
||||
// Allocate thread count matching the performance cores on a single socket
|
||||
return si.System.CPUs[0].CoreCount - si.System.CPUs[0].EfficiencyCoreCount
|
||||
|
||||
coreCount := 0
|
||||
for _, c := range si.System.CPUs {
|
||||
coreCount += c.CoreCount - c.EfficiencyCoreCount
|
||||
}
|
||||
|
||||
return coreCount
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue