singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] chrishkchris commented on a change in pull request #694: SINGA-510 Add Time Profiling for Single GPU
Date Tue, 19 May 2020 15:21:04 GMT

chrishkchris commented on a change in pull request #694:
URL: https://github.com/apache/singa/pull/694#discussion_r427388097



##########
File path: include/singa/core/device.h
##########
@@ -134,6 +150,8 @@ class Device {
   int num_executors_ = 0;
   unsigned seed_ = 0;
   bool graph_enabled_ = false;
+  string profiling_mode_ = "CHRONO";
+  int verbosity_ = 0;

Review comment:
       I have changed both to enum classes in the revision

##########
File path: src/core/scheduler/scheduler.cc
##########
@@ -228,6 +229,60 @@ void Graph::Debug() {
   printf("%s", ss.str().c_str());
 }
 
+void Graph::PrintTimeProfiling() {
+  std::stringstream ss;
+
+  // verbosity level: 1 -> forward and backward propagation time
+  if (device_->verbosity() == 1) {
+    bool forward = true;
+    float forward_time = 0;
+    float backward_time = 0;
+    float time_elapsed;
+
+    for (size_t i = 0; i < nodes_.size(); ++i)
+      if (nodes_[i]->time_elapsed() > 0) {
+        if (forward == true)
+          // check the op of cross entropy backward, after that are backward ops
+          if (nodes_[i]->op_name().find("Backward") != std::string::npos)

Review comment:
       I have added the note, it is more accurate when either "SoftmaxCrossEntropy" or "Softmax"
is used, because both backward operation has "Backward" in the name as the dividing line between
the forward and backward.
   

##########
File path: src/model/layer/cudnn_activation.cc
##########
@@ -81,7 +81,7 @@ const Tensor CudnnActivation::Forward(int flag, const Tensor& input)
{
     CUDNN_CHECK(cudnnActivationForward(
         ctx->cudnn_handle, this->acti_desc_, &alpha, this->desc_,
         inblock->data(), &beta, this->desc_, outblock->mutable_data()));
-  }, {input.block()}, {output.block()});
+  }, {input.block()}, {output.block()}, "cudnnActivationForward");

Review comment:
       In my opinion, the folder src/model/layer is depecracted because it is not using the
autograd API, so it has minimal value to be updated at this stage. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message