@@ -40,12 +40,13 @@ def run(self, cmd):
40
40
parse_status , gpu_time = self ._parse_logs (stdout .split ("\n " ))
41
41
if parse_status :
42
42
return gpu_time
43
- print ("Running Error:\n {}" .format (stdout ))
43
+ print ("Runing Error:\n {}" .format (stdout ))
44
44
return 0.0
45
45
46
46
def _nvprof (self , cmd ):
47
- return system .run_command ("nvprof --profile-from-start off {}" .format (
48
- cmd ))
47
+ #return system.run_command("nvprof --profile-from-start off {}".format(
48
+ # cmd))
49
+ return system .run_command ("nvprof {}" .format (cmd ))
49
50
50
51
def _parse_logs (self , logs ):
51
52
line_from = None
@@ -97,12 +98,13 @@ def run(self, cmd):
97
98
parse_status , gpu_time = self ._parse_logs (stdout .split ("\n " ))
98
99
if parse_status :
99
100
return gpu_time
100
- print ("Running Error:\n {}" .format (stdout ))
101
+ print ("Runing Error:\n {}" .format (stdout ))
101
102
return 0.0
102
103
103
104
def _nsight (self , cmd ):
104
- return system .run_command (
105
- "nsys nvprof --profile-from-start=off -o tmp.qdrep {}" .format (cmd ))
105
+ #return system.run_command(
106
+ # "nsys nvprof --profile-from-start=off -o tmp.qdrep {}".format(cmd))
107
+ return system .run_command ("nsys nvprof -o tmp.qdrep {}" .format (cmd ))
106
108
107
109
def _parse_logs (self , logs ):
108
110
kernel_line_from = None
@@ -174,17 +176,16 @@ def launch(benchmark_script, benchmark_script_args, with_nvprof=False):
174
176
"""
175
177
176
178
def _set_profiler (args , value ):
177
- if "--profiler" in args :
178
- for i in range (len (args )):
179
- if args [i ] == "--profiler" :
180
- args [i + 1 ] = value
181
- break
182
- else :
179
+ for i in range (len (args )):
180
+ if args [i ] == "--profiler" :
181
+ args [i + 1 ] = value
182
+ break
183
+ if i >= len (args ):
183
184
args .append ("--profiler" )
184
185
args .append (value )
185
186
186
- if with_nvprof :
187
- _set_profiler (benchmark_script_args , "nvprof" )
187
+ # if with_nvprof:
188
+ # _set_profiler(benchmark_script_args, "nvprof")
188
189
cmd = "{} {} {}" .format (sys .executable , benchmark_script ,
189
190
" " .join (benchmark_script_args ))
190
191
if with_nvprof :
@@ -193,7 +194,7 @@ def _set_profiler(args, value):
193
194
else :
194
195
runner = NvprofRunner ()
195
196
gpu_time = runner .run (cmd )
196
- _set_profiler (benchmark_script_args , "none" )
197
+ # _set_profiler(benchmark_script_args, "none")
197
198
return gpu_time
198
199
else :
199
200
stdout , exit_code = system .run_command (cmd )
0 commit comments