Skip to content
Snippets Groups Projects
Commit 276a50e5 authored by Elizabeth's avatar Elizabeth
Browse files

Added support for command line args

parent 67075e41
No related branches found
No related tags found
No related merge requests found
...@@ -2,9 +2,21 @@ import glob ...@@ -2,9 +2,21 @@ import glob
import os import os
import subprocess import subprocess
import shutil import shutil
import sys
from collections import defaultdict from collections import defaultdict
'''
FORMAT
** LayerName NumOpsInLayer <cols>
OpName Col1Val Col2Val ...
** Conv1 1 h2f_time h2f_energy fp32_time fp32_energy f2h_time f2h_energy fp16_perf_time fp16_perf_energy fp16_time fp16_energy
Conv1 51.8808 97.2844 319.582 601.966 12.81 18.758 388.092 650.649 340.037 590.664
'''
class TableGenerator: class TableGenerator:
__ops_header_delimiter = "#" __ops_header_delimiter = "#"
...@@ -53,7 +65,7 @@ class TableGenerator: ...@@ -53,7 +65,7 @@ class TableGenerator:
3. Writes the internal table to <network_name>_tensors.txt file and uses the 3. Writes the internal table to <network_name>_tensors.txt file and uses the
<network_name>_ops.txt file as a guideline in terms of row order <network_name>_ops.txt file as a guideline in terms of row order
''' '''
self.__run_inputted_binaries() #self.__run_inputted_binaries()
self.__build_internal_table() self.__build_internal_table()
self.__output_table_to_file() self.__output_table_to_file()
...@@ -282,8 +294,11 @@ class TableGenerator: ...@@ -282,8 +294,11 @@ class TableGenerator:
if __name__ == "__main__": if __name__ == "__main__":
binary_dir_path = "/home/nvidia/Gitlab/hpvm/llvm/projects/hpvm-tensor-rt/build_pldi/mobilenet" if len(sys.argv) != 4:
num_iters = 1 print("python table_generator.py <binary dir path> <num itrs> <profiler bin path>")
profiler_binary_name = "/home/nvidia/awesome_profiler/pp" exit(1)
binary_dir_path = sys.argv[1]
num_iters = int(sys.argv[2])
profiler_binary_name = sys.argv[3]
table_gen = TableGenerator(binary_dir_path, num_iters, profiler_binary_name) table_gen = TableGenerator(binary_dir_path, num_iters, profiler_binary_name)
table_gen.generate_table() table_gen.generate_table()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment