@@ -133,24 +133,20 @@ def run_traces_fn(traces_dir, pytorch_path, rexp, *args, **kwargs):
133
133
conversion_cmd = ["python" , f"{ pytorch_path } /torch/cuda/_memory_viz.py" ,
134
134
"trace_plot" , memory_path + ".pickle" , "-o" , memory_path + ".html" ]
135
135
result = subprocess .run (conversion_cmd , capture_output = True )
136
- assert result .returncode == 0
137
136
138
137
def run (batch_size ,
139
138
model ,
140
- experiments_data = None ,
139
+ pytorch_path ,
140
+ sam_path ,
141
+ experiments_data ,
141
142
run_traces = False ,
142
143
run_experiments = False ,
143
144
traces_dir = None ,
144
145
num_workers = 32 ,
145
146
print_header = True ):
146
147
147
- pytorch_path = "/home/cpuhrsch/dev/pytorch"
148
- sam_path = "/home/cpuhrsch/dev/segment-anything"
149
148
assert model == "vit_b" or model == "vit_h"
150
149
151
- if experiments_data is None :
152
- experiments_data = "experiments_data"
153
-
154
150
rexp = functools .partial (run_experiment ,
155
151
experiments_data ,
156
152
sam_path ,
@@ -163,7 +159,7 @@ def run(batch_size,
163
159
assert traces_dir is not None
164
160
rt = functools .partial (run_traces_fn , traces_dir , pytorch_path , rexp )
165
161
166
- rt ("fp32" , "default" , capture_output = False )
162
+ rt ("fp32" , "default" , print_header = print_header )
167
163
rt ("fp16" , "codesign" , use_half = "bfloat16" )
168
164
rt ("compile" , "codesign" , use_half = "bfloat16" , use_compile = "max-autotune" )
169
165
rt ("SDPA" , "sdpa-decoder" , use_half = "bfloat16" , use_compile = "max-autotune" )
@@ -174,7 +170,7 @@ def run(batch_size,
174
170
rt ("sparse" , "local-fork" , use_half = "bfloat16" , use_compile = "max-autotune" , use_nested_tensor = True , compress = "sparse" )
175
171
176
172
if run_experiments :
177
- rexp ("fp32" , "default" , print_header = print_header , capture_output = False )
173
+ rexp ("fp32" , "default" , print_header = print_header )
178
174
print_header = False
179
175
rexp ("bf16" , "codesign" , use_half = "bfloat16" )
180
176
rexp ("compile" , "codesign" , use_half = "bfloat16" , use_compile = "max-autotune" )
0 commit comments