YujiOshima commented on a change in pull request #8722: Profiler: set cpu/gpu 
num during execution
URL: https://github.com/apache/incubator-mxnet/pull/8722#discussion_r152521064
 
 

 ##########
 File path: src/engine/profiler.cc
 ##########
 @@ -45,12 +50,11 @@ Profiler::Profiler()
   : state_(kNotRunning), enable_output_(false), filename_("profile.json") {
   this->init_time_ = NowInUsec();
 
-  // TODO(ziheng) get device number during execution
-  int kMaxNumCpus = 64;
-  this->cpu_num_ = kMaxNumCpus;
+  this->cpu_num_ = std::thread::hardware_concurrency();
 #if MXNET_USE_CUDA
-  int kMaxNumGpus = 32;
-  this->gpu_num_ = kMaxNumGpus;
+  int gpu_num = 0;
+  CUDA_CALL(cudaGetDeviceCount(&gpu_num));
 
 Review comment:
   @piiswrong Thank you for your comment.
   I understood the purpose of using the constant number.
   How about dynamically setting only the number of CPUs?
   More than 64 CPUs are not ordinary but not impossible.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to