dotnet / dotnet/machinelearning
Inconsistency for Num threads calculation if they don't specified
Open
area-Core
enhancement
Priority:3
tenet-performance
- Dominant language
- C#
- Stars
- 9.4k
- Forks
- 2k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 11
Description
We have few places in code with code like:
```
_threads = Math.Max(1, args.Threads ?? (Environment.ProcessorCount / 2));
```
in some places it's ```Math.Max(2, Environment.ProcessorCount - 1)```
in others it's`Args.NumThreads ?? Environment.ProcessorCount;`
which is a bit strange. It's either half of cores, all cores, or we left one core to be free.
KMeans, SdcaRegression, LinearClassifier , and BinaryLoader use half of available cores which leads to 50% CPU utilization.
@TomFinley, @GalOshri , @glebuk
Contributor guide
Assessment
This issue has not been assessed yet.