Skip to content

Commit d7da6e1

Browse files
committed
rerecord mem
1 parent e5f0408 commit d7da6e1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

inference_benchmark.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
BATCH_SIZE = 1
1010
BATCH_COUNT = 5
1111
NUM_WORKERS = 1
12-
PROFILE_MEMORY = False
12+
PROFILE_MEMORY = True
1313

1414
# https://huggingface.co/datasets/gsm8k
1515
HUGGING_FACE_GSMK_DATASET_ID = "gsm8k"
@@ -140,8 +140,6 @@ def benchmark(ckpt_dir,
140140
# with record_function("run_benchmark"):
141141
# _, load, inference, total = run_benchmark(data_loader, net)
142142
_, load, inference, total = run_benchmark(data_loader, net)
143-
profile_cuda_time = prof.key_averages().table(sort_by="cuda_time_total", row_limit=10)
144-
profile_cuda_mem = prof.key_averages().table(sort_by="self_cuda_memory_usage", row_limit=10)
145143

146144
print("\n\n Manual Profile Results...")
147145
print("Data-loading times")
@@ -156,9 +154,12 @@ def benchmark(ckpt_dir,
156154

157155
print("\n\n")
158156
print("Profiling sorted by CUDA time total")
157+
profile_cuda_time = prof.key_averages().table(sort_by="cuda_time_total", row_limit=10)
159158
print(profile_cuda_time)
159+
160160
print("\n\n")
161161
print("Profiling sorted by CUDA memory usage")
162+
profile_cuda_mem = prof.key_averages().table(sort_by="self_cuda_memory_usage", row_limit=10)
162163
print(profile_cuda_mem)
163164

164165

0 commit comments

Comments
 (0)