tensorflow/stream_executor/cuda/cuda_platform.cc
// Due to legacy issues in user code, we can't currently call InpectNumaNodes
// at module initialization time, because non-GPU programs still include this
// plugin via various methods, so instead, it has to be init-on-reference.
Due to legacy issues in user code, we can't currently call InpectNumaNodes
at module initialization time, because non-GPU programs still include this
plugin via various methods, so instead, it has to be init-on-reference.
Due to legacy issues in user code we can ' t currently call InpectNumaNodes at module initialization time because non - GPU programs still include this plugin via various methods so instead it has to be init - on - reference .
void CudaPlatform::InspectNumaNodes() {
  static absl::once_flag once;
  absl::call_once(once, [&] {
    for (int i = 0; i < VisibleDeviceCount(); i++) {
      StreamExecutor* exec = *ExecutorForDevice(i);
      if (i == 0) {
        min_numa_node_ = exec->GetDeviceDescription().numa_node();
        limit_numa_node_ = min_numa_node_ + 1;
      } else {
        min_numa_node_ =
            std::min(min_numa_node_, exec->GetDeviceDescription().numa_node());
        limit_numa_node_ = std::max(
            limit_numa_node_, exec->GetDeviceDescription().numa_node() + 1);
      }
    }
  });
}
void CudaPlatform :: InspectNumaNodes ( ) { static absl :: once_flag once ; absl :: call_once ( once , [ & ] { for ( int i = 0 ; i < VisibleDeviceCount ( ) ; i ++ ) { StreamExecutor * exec = * ExecutorForDevice ( i ) ; if ( i == 0 ) { min_numa_node_ = exec -> GetDeviceDescription ( ) . numa_node ( ) ; limit_numa_node_ = min_numa_node_ + 1 ; } else { min_numa_node_ = std :: min ( min_numa_node_ , exec -> GetDeviceDescription ( ) . numa_node ( ) ) ; limit_numa_node_ = std :: max ( limit_numa_node_ , exec -> GetDeviceDescription ( ) . numa_node ( ) + 1 ) ; } } } ) ; }
Due to legacy issues in user code, we can't currently call InpectNumaNodes
at module initialization time, because non-GPU programs still include this
plugin via various methods, so instead, it has to be init-on-reference.
Due to legacy issues in user code we can ' t currently call InpectNumaNodes at module initialization time because non - GPU programs still include this plugin via various methods so instead it has to be init - on - reference .
// To get NUMA node information, we need to create all executors, so we can // examine their device descriptions to see their bus assignments. // NUMA nodes may not start at 0, so set the minimum node  based on the // first executor we see.