File tree 3 files changed +7
-16
lines changed
3 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,13 @@ struct LocalDevice::EigenThreadPoolInfo {
81
81
intra_op_parallelism_threads = env_num_threads;
82
82
// If no session setting or environment, compute a reasonable default.
83
83
if (intra_op_parallelism_threads == 0 ) {
84
- intra_op_parallelism_threads = port::MaxParallelism (numa_node);
84
+ intra_op_parallelism_threads = port::NumSchedulableCPUs ();
85
+ if (numa_node != port::kNUMANoAffinity ) {
86
+ // Assume that CPUs are equally distributed over available NUMA nodes.
87
+ // This may not be true, but there isn't currently a better way of
88
+ // determining the number of CPUs specific to the requested node.
89
+ intra_op_parallelism_threads /= port::NUMANumNodes ();
90
+ }
85
91
}
86
92
}
87
93
ThreadOptions thread_opts;
Original file line number Diff line number Diff line change @@ -46,11 +46,6 @@ int NumSchedulableCPUs();
46
46
// called during initialization, i.e., before before main() has started.
47
47
int MaxParallelism ();
48
48
49
- // Returns an estimate for the maximum parallelism for this process on the
50
- // provided numa node, or any numa node if `numa_node` is kNUMANoAffinity.
51
- // See MaxParallelism() for more information.
52
- int MaxParallelism (int numa_node);
53
-
54
49
// Returns the total number of CPUs on the system. This number should
55
50
// not change even if the underlying cluster management software may
56
51
// change the number of schedulable CPUs. Unlike `NumSchedulableCPUs`, if the
Original file line number Diff line number Diff line change @@ -82,16 +82,6 @@ int NumSchedulableCPUs() {
82
82
83
83
int MaxParallelism () { return NumSchedulableCPUs (); }
84
84
85
- int MaxParallelism (int numa_node) {
86
- if (numa_node != port::kNUMANoAffinity ) {
87
- // Assume that CPUs are equally distributed over available NUMA nodes.
88
- // This may not be true, but there isn't currently a better way of
89
- // determining the number of CPUs specific to the requested node.
90
- return NumSchedulableCPUs () / port::NUMANumNodes ();
91
- }
92
- return NumSchedulableCPUs ();
93
- }
94
-
95
85
int NumTotalCPUs () {
96
86
int count = absl::base_internal::NumCPUs ();
97
87
return (count <= 0 ) ? kUnknownCPU : count;
You can’t perform that action at this time.
0 commit comments