cjolivier01 commented on a change in pull request #8972: Profiling 
enhancements, python API, vtune and chrome tracing objects, etc.
URL: https://github.com/apache/incubator-mxnet/pull/8972#discussion_r169479911
 
 

 ##########
 File path: include/mxnet/c_api.h
 ##########
 @@ -227,10 +231,133 @@ MXNET_DLL int MXSetProfilerConfig(int mode, const char* 
filename);
  */
 MXNET_DLL int MXSetProfilerState(int state);
 
-/*! \brief Save profile and stop profiler */
-MXNET_DLL int MXDumpProfile();
+/*!
+ * \brief Save profile and stop profiler
+ * \param finished true if stat output should stop after this point
+ * \return 0 when success, -1 when failure happens.
+ */
+MXNET_DLL int MXDumpProfile(int finished);
+
+
+/*!
+ * \brief Print aggregate stats to the a string
+ * \param out_str Will receive a pointer to the output string
+ * \param reset Clear the aggregate stats after printing
+ * \return 0 when success, -1 when failure happens.
+ * \note
+ */
+MXNET_DLL int MXAggregateProfileStatsPrint(const char **out_str, int reset);
+
+/*!
+ * \brief Pause profiler tuning collection
+ * \param paused If nonzero, profiling pauses. Otherwise, profiling 
resumes/continues
+ * \return 0 when success, -1 when failure happens.
+ * \note pausing and resuming is global and not recursive
+ */
+MXNET_DLL int MXProfilePause(int paused);
 
 Review comment:
   I considered this, but decided against it for a couple of reasons, including 
the fact that profiler_set_state() uses a string, and pause/resume need to be 
super-low overhead. 
   
   Also, the pause and resume are somewhat disconnected from the concepts of 
"start" and "stop" when it comes to VTune.  There's no need to use 'start' and 
'stop' when just profiling with vtune, and in fact, you may not want to start 
the profiler when profiling with vtune (since it may interfere with the 
profiling), but you'd still want access to ``__itt_pause()`` and 
``__itt_resume()`` during those times, even from python (note in VTune, it's 
two different calls). 
   
   It's also not clear what the progression would be:
   
   start->pause->start->stop ? start->pause->unpause->? It gets kind of weird 
when they're all connected as one concept.  You wouldn't want to accidentally 
start the profiler.
   
   wdyt?
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to