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_r164209525
 
 

 ##########
 File path: python/mxnet/profiler.py
 ##########
 @@ -20,28 +20,34 @@
 # pylint: disable=too-many-branches, too-many-statements
 """Profiler setting methods."""
 from __future__ import absolute_import
-
 import ctypes
-from .base import _LIB, check_call, c_str
+from .base import _LIB, check_call, c_str, ProfileHandle, c_str_array
 
-def profiler_set_config(mode='symbolic', filename='profile.json'):
+def profiler_set_config(flags):
     """Set up the configure of profiler.
 
     Parameters
     ----------
-    mode : string, optional
-        Indicates whether to enable the profiler, can
-        be 'symbolic', or 'all'. Defaults to `symbolic`.
-    filename : string, optional
-        The name of output trace file. Defaults to 'profile.json'.
+    flags : list of key/value pair tuples
+        Indicates configuration parameters
+          profile_all : boolean, all profile types enabled
+          profile_symbolic : boolean, whether to profile symbolic operators
+          profile_imperative : boolean, whether to profile imperative operators
+          profile_memory : boolean, whether to profile memory usage
+          profile_api : boolean, whether to profile the C API
+          file_name : string, output file for profile data
+          continuous_dump : boolean, whether to periodically dump profiling 
data to file
+          dump_period : float, seconds between profile data dumps
 
 Review comment:
   hmm this is a little complicated because there are two separate behaviors. 
continuous/contiguous_dump controls whether the DumpProfile() is atomic -- 
whether at the end of the call, the function "closes off" the json and that's a 
discrete piofile file.  One could periodically save multiple profiler files 
over time.  That is the "old way".  
   The "new way" is with continuous dump, where the file is closed off only on 
shutdown, thus making only one file possible.  One could use dump_period to 
automatically dump, or else call the dumps manually (although they would still 
be one continuous file).
   
   To merge these two config items, I would need to discard the old behavior 
(one discrete profile file for each Dump() call). Is that desired?

----------------------------------------------------------------
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