diff --git a/artifact/bench_comparison.py b/artifact/bench_comparison.py index 0445a82..4e43c68 100644 --- a/artifact/bench_comparison.py +++ b/artifact/bench_comparison.py @@ -1,5 +1,6 @@ import csv import common_util +from common_util import plot, calculate_averages_comparison from multiprocessing import Pool from matplotlib import pyplot as plt import numpy as np @@ -8,7 +9,7 @@ cmd = [ "linpack", "llama", - "rgbd_tum", + # "rgbd_tum", "bt", "cg", "ft", @@ -21,7 +22,7 @@ folder = [ "linpack", "llama", - "ORB_SLAM2", + # "ORB_SLAM2", "nas", "nas", "nas", @@ -34,7 +35,7 @@ arg = [ [], ["stories110M.bin", "-z", "tokenizer.bin", "-t", "0.0"], - ["./ORBvoc.txt", "./TUM3.yaml", "./", "./associations/fr1_xyz.txt"], + # ["./ORBvoc.txt", "./TUM3.yaml", "./", "./associations/fr1_xyz.txt"], [], [], [], @@ -47,7 +48,7 @@ envs = [ "a=b", "OMP_NUM_THREADS=1", - "a=b", + # "a=b", "OMP_NUM_THREADS=1", "OMP_NUM_THREADS=1", "OMP_NUM_THREADS=1", @@ -59,6 +60,7 @@ ] pool = Pool(processes=20) + def run_mvvm(): results = [] results1 = [] @@ -112,7 +114,9 @@ def run_hcontainer(): try: from datetime import datetime - time_object = datetime.strptime(line.split()[2].replace("elapsed", ""), "%H:%M:%S").time() + time_object = datetime.strptime( + line.split()[2].replace("elapsed", ""), "%H:%M:%S" + ).time() print(time_object) except: exec_time = float(line.split()[0].replace("user", "")) @@ -154,7 +158,9 @@ def run_qemu_x86_64(): try: from datetime import datetime - time_object = datetime.strptime(line.split()[2].replace("elapsed", ""), "%H:%M:%S").time() + time_object = datetime.strptime( + line.split()[2].replace("elapsed", ""), "%H:%M:%S" + ).time() print(time_object) except: exec_time = float(line.split()[0].replace("user", "")) @@ -195,7 +201,9 @@ def run_qemu_aarch64(): try: from datetime import datetime - time_object = datetime.strptime(line.split()[2].replace("elapsed", ""), "%H:%M:%S").time() + time_object = datetime.strptime( + line.split()[2].replace("elapsed", ""), "%H:%M:%S" + ).time() print(time_object) except: exec_time = float(line.split()[0].replace("user", "")) @@ -236,7 +244,9 @@ def run_native(): try: from datetime import datetime - time_object = datetime.strptime(line.split()[2].replace("elapsed", ""), "%H:%M:%S").time() + time_object = datetime.strptime( + line.split()[2].replace("elapsed", ""), "%H:%M:%S" + ).time() print(time_object) except: exec_time = float(line.split()[0].replace("user", "")) @@ -266,56 +276,136 @@ def write_to_csv(filename): native_results[idx][1], ] ) + + def read_from_csv(filename): with open(filename, "r") as csvfile: reader = csv.reader(csvfile) next(reader) results = [] for row in reader: - results.append((row[0], float(row[1]), float(row[2]), float(row[3]), float(row[4]), float(row[5]))) + results.append( + ( + row[0], + float(row[1]), + float(row[2]), + float(row[3]), + float(row[4]), + float(row[5]), + ) + ) return results -def plot(results): - font = {'size': 18} - - plt.rc('font', **font) - workloads = defaultdict(list) - for workload, mvvm_values,hcontainer_values, qemu_x86_64_values,qemu_aarch64_values,native_values in results: - workloads[ - workload.replace("OMP_NUM_THREADS=", "") - .replace("-g20", "") - .replace("-n300", "") - .replace(" -f ", "") - .replace("-vn300", "") - .replace("maze-6404.txt", "") - .replace("stories110M.bin", "") - .replace("-z tokenizer.bin -t 0.0", "").replace("a=b", "") - .strip() - ].append(( hcontainer_values, mvvm_values, qemu_x86_64_values,qemu_aarch64_values,native_values)) +def plot(results, results1): + font = {"size": 20} + plt.tight_layout() + plt.rc("font", **font) + workloads = defaultdict(list) + workloads1 = defaultdict(list) + for ( + workload, + mvvm_values, + hcontainer_values, + qemu_x86_64_values, + qemu_aarch64_values, + native_values, + ) in results: + if not workload.__contains__("sp") and not workload.__contains__("lu") and not workload.__contains__("tc"): + workloads[workload.split(" ")[1].replace(".aot", "")].append( + ( + hcontainer_values, + mvvm_values, + qemu_x86_64_values, + qemu_aarch64_values, + native_values, + ) + ) statistics = {} for workload, times in workloads.items(): - hcontainer_values, mvvm_values, qemu_x86_64_values,qemu_aarch64_values,native_values= zip(*times) + ( + hcontainer_values, + mvvm_values, + qemu_x86_64_values, + qemu_aarch64_values, + native_values, + ) = zip(*times) statistics[workload] = { "hcontainer_median": np.median(hcontainer_values), "mvvm_median": np.median(mvvm_values), - "qemu_x86_64_median" :np.median(qemu_x86_64_values), - "qemu_aarch64_median" :np.median(qemu_aarch64_values), - "native_median" :np.median(native_values), + "qemu_x86_64_median": np.median(qemu_x86_64_values), + "qemu_aarch64_median": np.median(qemu_aarch64_values), + "native_median": np.median(native_values), "hcontainer_std": np.std(hcontainer_values), "mvvm_std": np.std(mvvm_values), - "qemu_x86_64_std" :np.std(qemu_x86_64_values), - "qemu_aarch64_std" :np.std(qemu_aarch64_values), - "native_std" :np.std(native_values), + "qemu_x86_64_std": np.std(qemu_x86_64_values), + "qemu_aarch64_std": np.std(qemu_aarch64_values), + "native_std": np.std(native_values), + } + for ( + workload, + mvvm_values, + hcontainer_values, + qemu_x86_64_values, + qemu_aarch64_values, + native_values, + ) in results1: + if not workload.__contains__("sp") and not workload.__contains__("lu") and not workload.__contains__("tc"): + workloads1[workload.split(" ")[1].replace(".aot", "")].append( + ( + hcontainer_values, + mvvm_values, + qemu_x86_64_values, + qemu_aarch64_values, + native_values, + ) + ) + statistics1 = {} + for workload, times in workloads1.items(): + ( + hcontainer_values, + mvvm_values, + qemu_x86_64_values, + qemu_aarch64_values, + native_values, + ) = zip(*times) + statistics1[workload] = { + "hcontainer_median": np.median(hcontainer_values), + "mvvm_median": np.median(mvvm_values), + "qemu_x86_64_median": np.median(qemu_x86_64_values), + "qemu_aarch64_median": np.median(qemu_aarch64_values), + "native_median": np.median(native_values), + "hcontainer_std": np.std(hcontainer_values), + "mvvm_std": np.std(mvvm_values), + "qemu_x86_64_std": np.std(qemu_x86_64_values), + "qemu_aarch64_std": np.std(qemu_aarch64_values), + "native_std": np.std(native_values), } fig, ax = plt.subplots(figsize=(20, 10)) index = np.arange(len(statistics)) - bar_width = 0.7/5 + bar_width = 0.7 / 8 for i, (workload, stats) in enumerate(statistics.items()): ax.bar( index[i], + stats["native_median"], + bar_width, + yerr=stats["native_std"], + capsize=5, + color="cyan", + label="native" if i == 0 else "", + ) + ax.bar( + index[i] + bar_width, + statistics1[workload]["native_median"], + bar_width, + yerr=statistics1[workload]["native_std"], + capsize=5, + color="cyan", + ) + ax.bar( + index[i] + bar_width * 2, stats["hcontainer_median"], bar_width, yerr=stats["hcontainer_std"], @@ -324,7 +414,16 @@ def plot(results): label="hcontainer" if i == 0 else "", ) ax.bar( - index[i] + bar_width, + index[i] + bar_width * 3, + statistics1[workload]["hcontainer_median"], + bar_width, + yerr=statistics1[workload]["hcontainer_std"], + capsize=5, + color="blue", + ) + + ax.bar( + index[i] + bar_width * 4, stats["mvvm_median"], bar_width, yerr=stats["mvvm_std"], @@ -333,7 +432,16 @@ def plot(results): label="mvvm" if i == 0 else "", ) ax.bar( - index[i]+ bar_width *2, + index[i] + bar_width * 5, + statistics1[workload]["mvvm_median"], + bar_width, + yerr=statistics1[workload]["mvvm_std"], + capsize=5, + color="red", + ) + + ax.bar( + index[i] + bar_width * 6, stats["qemu_x86_64_median"], bar_width, yerr=stats["qemu_x86_64_std"], @@ -342,7 +450,16 @@ def plot(results): label="qemu_x86_64" if i == 0 else "", ) ax.bar( - index[i]+ bar_width*3, + index[i] + bar_width * 7, + statistics1[workload]["qemu_x86_64_median"], + bar_width, + yerr=statistics1[workload]["qemu_x86_64_std"], + capsize=5, + color="brown", + ) + + ax.bar( + index[i] + bar_width * 8, stats["qemu_aarch64_median"], bar_width, yerr=stats["qemu_aarch64_std"], @@ -351,20 +468,20 @@ def plot(results): label="qemu_aarch64" if i == 0 else "", ) ax.bar( - index[i]+ bar_width*4, - stats["native_median"], + index[i] + bar_width * 9, + statistics1[workload]["qemu_aarch64_median"], bar_width, - yerr=stats["native_std"], + yerr=statistics1[workload]["qemu_aarch64_std"], capsize=5, - color="cyan", - label="native" if i == 0 else "", + color="purple", ) + # ax.set_xlabel(workload) ticklabel = (x for x in list(statistics.keys())) print(statistics.keys()) - ax.set_xticks(index) + ax.set_xticks(index + bar_width * 4) - ax.set_xticklabels(ticklabel,fontsize =10) + ax.set_xticklabels(ticklabel, fontsize=20) ax.set_ylabel("Execution time (s)") ax.legend() @@ -375,14 +492,24 @@ def plot(results): if __name__ == "__main__": - mvvm_results = run_mvvm() - native_results = run_native() - qemu_x86_64_results = run_qemu_x86_64() - # # print the results - qemu_aarch64_results = run_qemu_aarch64() - hcontainer_results = run_hcontainer() - - write_to_csv("comparison.csv") - + # mvvm_results = [("a=b linpack.aot",34.021069),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",29.995634),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",29.995634),("OMP_NUM_THREADS=1 bt.aot",97.646537),("OMP_NUM_THREADS=1 cg.aot",37.130862),("OMP_NUM_THREADS=1 ft.aot",46.20586),("OMP_NUM_THREADS=1 lu.aot",0.050734),("OMP_NUM_THREADS=1 mg.aot",29.199269),("OMP_NUM_THREADS=1 sp.aot",16.257109),("a=b redis.aot",296.145142),("a=b hdastar.aot maze-6404.txt 8",11.045916),("a=b linpack.aot",34.206223),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",27.570724),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",27.570724),("OMP_NUM_THREADS=1 bt.aot",95.72704),("OMP_NUM_THREADS=1 cg.aot",35.174173),("OMP_NUM_THREADS=1 ft.aot",46.675348),("OMP_NUM_THREADS=1 lu.aot",0.058697),("OMP_NUM_THREADS=1 mg.aot",31.437348),("OMP_NUM_THREADS=1 sp.aot",17.091653),("a=b redis.aot",288.328081),("a=b hdastar.aot maze-6404.txt 8",11.405105),("a=b linpack.aot",35.299232),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",28.656332),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",28.656332),("OMP_NUM_THREADS=1 bt.aot",95.897016),("OMP_NUM_THREADS=1 cg.aot",35.501491),("OMP_NUM_THREADS=1 ft.aot",46.906197),("OMP_NUM_THREADS=1 lu.aot",0.03796),("OMP_NUM_THREADS=1 mg.aot",29.226483),("OMP_NUM_THREADS=1 sp.aot",17.092985),("a=b redis.aot",288.250117),("a=b hdastar.aot maze-6404.txt 8",10.65366),("a=b linpack.aot",33.738135),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",27.527596),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",27.527596),("OMP_NUM_THREADS=1 bt.aot",94.089478),("OMP_NUM_THREADS=1 cg.aot",35.294456),("OMP_NUM_THREADS=1 ft.aot",47.10809),("OMP_NUM_THREADS=1 lu.aot",0.053327),("OMP_NUM_THREADS=1 mg.aot",29.876738),("OMP_NUM_THREADS=1 sp.aot",17.344869),("a=b redis.aot",286.45943),("a=b hdastar.aot maze-6404.txt 8",11.559773),("a=b linpack.aot",33.81198),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",28.370864),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",28.370864),("OMP_NUM_THREADS=1 bt.aot",95.656937),("OMP_NUM_THREADS=1 cg.aot",36.493237),("OMP_NUM_THREADS=1 ft.aot",49.011925),("OMP_NUM_THREADS=1 lu.aot",0.050512),("OMP_NUM_THREADS=1 mg.aot",30.709787),("OMP_NUM_THREADS=1 sp.aot",17.512012),("a=b redis.aot",283.937262),("a=b hdastar.aot maze-6404.txt 8",11.183503),("a=b linpack.aot",32.98269),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",29.27254),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",29.27254),("OMP_NUM_THREADS=1 bt.aot",95.943804),("OMP_NUM_THREADS=1 cg.aot",36.596166),("OMP_NUM_THREADS=1 ft.aot",47.009408),("OMP_NUM_THREADS=1 lu.aot",0.044345),("OMP_NUM_THREADS=1 mg.aot",29.069261),("OMP_NUM_THREADS=1 sp.aot",17.241978),("a=b redis.aot",287.613588),("a=b hdastar.aot maze-6404.txt 8",11.186353),("a=b linpack.aot",33.10233),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",28.730093),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",28.730093),("OMP_NUM_THREADS=1 bt.aot",97.747853),("OMP_NUM_THREADS=1 cg.aot",36.673356),("OMP_NUM_THREADS=1 ft.aot",46.847511),("OMP_NUM_THREADS=1 lu.aot",0.052715),("OMP_NUM_THREADS=1 mg.aot",30.12969),("OMP_NUM_THREADS=1 sp.aot",16.956676),("a=b redis.aot",280.486803),("a=b hdastar.aot maze-6404.txt 8",11.134241),("a=b linpack.aot",35.097291),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",28.005771),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",28.005771),("OMP_NUM_THREADS=1 bt.aot",96.974046),("OMP_NUM_THREADS=1 cg.aot",36.951569),("OMP_NUM_THREADS=1 ft.aot",48.541943),("OMP_NUM_THREADS=1 lu.aot",0.063633),("OMP_NUM_THREADS=1 mg.aot",31.42804),("OMP_NUM_THREADS=1 sp.aot",16.8186),("a=b redis.aot",275.056764),("a=b hdastar.aot maze-6404.txt 8",11.378461),("a=b linpack.aot",33.157102),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",27.924637),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",27.924637),("OMP_NUM_THREADS=1 bt.aot",95.841526),("OMP_NUM_THREADS=1 cg.aot",35.334907),("OMP_NUM_THREADS=1 ft.aot",47.986966),("OMP_NUM_THREADS=1 lu.aot",0.061085),("OMP_NUM_THREADS=1 mg.aot",29.009124),("OMP_NUM_THREADS=1 sp.aot",17.008031),("a=b redis.aot",263.225509),("a=b hdastar.aot maze-6404.txt 8",9.820092),("a=b linpack.aot",32.903653),("OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0",28.312841),("a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt",28.312841),("OMP_NUM_THREADS=1 bt.aot",89.99542),("OMP_NUM_THREADS=1 cg.aot",34.771269),("OMP_NUM_THREADS=1 ft.aot",44.030195),("OMP_NUM_THREADS=1 lu.aot",0.046369),("OMP_NUM_THREADS=1 mg.aot",29.505974),("OMP_NUM_THREADS=1 sp.aot",17.565224),("a=b redis.aot",250.541232),("a=b hdastar.aot maze-6404.txt 8",12.546132)] + # # print("mvvm_results=", mvvm_results) + # # native_results = run_native() + # # print("native_results=", native_results) + # native_results= [('a=b linpack', 34.025), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 26.027), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.004), ('OMP_NUM_THREADS=1 bt', 57.026), ('OMP_NUM_THREADS=1 cg', 23.001), ('OMP_NUM_THREADS=1 ft', 33.019), ('OMP_NUM_THREADS=1 lu', 0.007), ('OMP_NUM_THREADS=1 mg', 11.0), ('OMP_NUM_THREADS=1 sp', 2.0), ('a=b redis', 23.039), ('a=b hdastar maze-6404.txt 8', 4.051), ('a=b linpack', 32.026), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 25.078), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.005), ('OMP_NUM_THREADS=1 bt', 54.019), ('OMP_NUM_THREADS=1 cg', 21.093), ('OMP_NUM_THREADS=1 ft', 30.087), ('OMP_NUM_THREADS=1 lu', 0.007), ('OMP_NUM_THREADS=1 mg', 12.052), ('OMP_NUM_THREADS=1 sp', 1.08), ('a=b redis', 21.027), ('a=b hdastar maze-6404.txt 8', 5.011), ('a=b linpack', 33.02), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 25.067), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 54.022), ('OMP_NUM_THREADS=1 cg', 22.06), ('OMP_NUM_THREADS=1 ft', 32.004), ('OMP_NUM_THREADS=1 lu', 0.003), ('OMP_NUM_THREADS=1 mg', 10.067), ('OMP_NUM_THREADS=1 sp', 1.024), ('a=b redis', 20.034), ('a=b hdastar maze-6404.txt 8', 4.078), ('a=b linpack', 32.025), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 29.091), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.002), ('OMP_NUM_THREADS=1 bt', 53.063), ('OMP_NUM_THREADS=1 cg', 21.099), ('OMP_NUM_THREADS=1 ft', 30.027), ('OMP_NUM_THREADS=1 lu', 0.004), ('OMP_NUM_THREADS=1 mg', 10.026), ('OMP_NUM_THREADS=1 sp', 1.023), ('a=b redis', 25.023), ('a=b hdastar maze-6404.txt 8', 25.023), ('a=b linpack', 32.021), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 30.077), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.002), ('OMP_NUM_THREADS=1 bt', 53.075), ('OMP_NUM_THREADS=1 cg', 22.039), ('OMP_NUM_THREADS=1 ft', 31.062), ('OMP_NUM_THREADS=1 lu', 0.004), ('OMP_NUM_THREADS=1 mg', 10.059), ('OMP_NUM_THREADS=1 sp', 1.03), ('a=b redis', 18.038), ('a=b hdastar maze-6404.txt 8', 6.082), ('a=b linpack', 31.094), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 29.044), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 53.048), ('OMP_NUM_THREADS=1 cg', 21.052), ('OMP_NUM_THREADS=1 ft', 31.047), ('OMP_NUM_THREADS=1 lu', 0.003), ('OMP_NUM_THREADS=1 mg', 13.042), ('OMP_NUM_THREADS=1 sp', 1.024), ('a=b redis', 19.006), ('a=b hdastar maze-6404.txt 8', 7.05), ('a=b linpack', 32.075), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 25.041), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.004), ('OMP_NUM_THREADS=1 bt', 52.045), ('OMP_NUM_THREADS=1 cg', 22.087), ('OMP_NUM_THREADS=1 ft', 32.04), ('OMP_NUM_THREADS=1 lu', 0.008), ('OMP_NUM_THREADS=1 mg', 10.067), ('OMP_NUM_THREADS=1 sp', 1.063), ('a=b redis', 20.054), ('a=b hdastar maze-6404.txt 8', 5.033), ('a=b linpack', 33.081), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 25.064), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.004), ('OMP_NUM_THREADS=1 bt', 51.014), ('OMP_NUM_THREADS=1 cg', 21.089), ('OMP_NUM_THREADS=1 ft', 32.032), ('OMP_NUM_THREADS=1 lu', 0.003), ('OMP_NUM_THREADS=1 mg', 10.04), ('OMP_NUM_THREADS=1 sp', 1.024), ('a=b redis', 19.049), ('a=b hdastar maze-6404.txt 8', 5.041), ('a=b linpack', 32.081), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 29.003), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 49.034), ('OMP_NUM_THREADS=1 cg', 22.002), ('OMP_NUM_THREADS=1 ft', 31.013), ('OMP_NUM_THREADS=1 lu', 0.003), ('OMP_NUM_THREADS=1 mg', 10.027), ('OMP_NUM_THREADS=1 sp', 1.023), ('a=b redis', 20.073), ('a=b hdastar maze-6404.txt 8', 4.035), ('a=b linpack', 30.021), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 28.049), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 46.038), ('OMP_NUM_THREADS=1 cg', 21.04), ('OMP_NUM_THREADS=1 ft', 28.06), ('OMP_NUM_THREADS=1 lu', 0.003), ('OMP_NUM_THREADS=1 mg', 10.045), ('OMP_NUM_THREADS=1 sp', 1.02), ('a=b redis', 18.048), ('a=b hdastar maze-6404.txt 8', 4.081)] + # # qemu_x86_64_results = run_qemu_x86_64() + # qemu_x86_64_results = [('a=b linpack', 35.096), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 5618), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.006), ('OMP_NUM_THREADS=1 bt', 7830), ('OMP_NUM_THREADS=1 cg', 660.065), ('OMP_NUM_THREADS=1 ft', 7611), ('OMP_NUM_THREADS=1 lu', 3.046), ('OMP_NUM_THREADS=1 mg', 3361.038), ('OMP_NUM_THREADS=1 sp', 155.066), ('a=b redis', 119.01), ('a=b hdastar maze-6404.txt 8', 11.001), ('a=b linpack', 36.014), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 5615), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.005), ('OMP_NUM_THREADS=1 bt', 0.005), ('OMP_NUM_THREADS=1 cg', 660.004), ('OMP_NUM_THREADS=1 ft', 660.004), ('OMP_NUM_THREADS=1 lu', 3.031), ('OMP_NUM_THREADS=1 mg', 3413.076), ('OMP_NUM_THREADS=1 sp', 155.022), ('a=b redis', 211.012), ('a=b hdastar maze-6404.txt 8', 9.052), ('a=b linpack', 39.049), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 39.049), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.003), ('OMP_NUM_THREADS=1 bt', 0.003), ('OMP_NUM_THREADS=1 cg', 654.092), ('OMP_NUM_THREADS=1 ft', 654.092), ('OMP_NUM_THREADS=1 lu', 2.075), ('OMP_NUM_THREADS=1 mg', 3404.098), ('OMP_NUM_THREADS=1 sp', 182.026), ('a=b redis', 281.051), ('a=b hdastar maze-6404.txt 8', 281.051), ('a=b linpack', 63.074), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 6267), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.003), ('OMP_NUM_THREADS=1 bt', 0.003), ('OMP_NUM_THREADS=1 cg', 634.09), ('OMP_NUM_THREADS=1 ft', 7436), ('OMP_NUM_THREADS=1 lu', 2.082), ('OMP_NUM_THREADS=1 mg', 3368.078), ('OMP_NUM_THREADS=1 sp', 154.015), ('a=b redis', 336.001), ('a=b hdastar maze-6404.txt 8', 336.001), ('a=b linpack', 144.05), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 7414), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.003), ('OMP_NUM_THREADS=1 bt', 7462), ('OMP_NUM_THREADS=1 cg', 613.075), ('OMP_NUM_THREADS=1 ft', 6135), ('OMP_NUM_THREADS=1 lu', 2.081), ('OMP_NUM_THREADS=1 mg', 3269.094), ('OMP_NUM_THREADS=1 sp', 153.095), ('a=b redis', 261.009), ('a=b hdastar maze-6404.txt 8', 261.009), ('a=b linpack', 36.009), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 5431), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.005), ('OMP_NUM_THREADS=1 bt', 7536), ('OMP_NUM_THREADS=1 cg', 620.086), ('OMP_NUM_THREADS=1 ft', 6205), ('OMP_NUM_THREADS=1 lu', 2.068), ('OMP_NUM_THREADS=1 mg', 3256.077), ('OMP_NUM_THREADS=1 sp', 156.033), ('a=b redis', 236.085), ('a=b hdastar maze-6404.txt 8', 12.052), ('a=b linpack', 35.063), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 6234), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.004), ('OMP_NUM_THREADS=1 bt', 7416), ('OMP_NUM_THREADS=1 cg', 617.067), ('OMP_NUM_THREADS=1 ft', 6235), ('OMP_NUM_THREADS=1 lu', 2.089), ('OMP_NUM_THREADS=1 mg', 3264.088), ('OMP_NUM_THREADS=1 sp', 153.005), ('a=b redis', 231.013), ('a=b hdastar maze-6404.txt 8', 231.013), ('a=b linpack', 35.084), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 5530), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.002), ('OMP_NUM_THREADS=1 bt', 7580), ('OMP_NUM_THREADS=1 cg', 651.054), ('OMP_NUM_THREADS=1 ft', 7391), ('OMP_NUM_THREADS=1 lu', 2.035), ('OMP_NUM_THREADS=1 mg', 3263.014), ('OMP_NUM_THREADS=1 sp', 154.016), ('a=b redis', 256.025), ('a=b hdastar maze-6404.txt 8',43730), ('a=b linpack', 37.063), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 5513), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.002), ('OMP_NUM_THREADS=1 bt', >>>), ('OMP_NUM_THREADS=1 cg', 623.095), ('OMP_NUM_THREADS=1 ft', 7223), ('OMP_NUM_THREADS=1 lu', 2.035), ('OMP_NUM_THREADS=1 mg', 3232.095), ('OMP_NUM_THREADS=1 sp', 153.046), ('a=b redis', 228.085), ('a=b hdastar maze-6404.txt 8', 9.048), ('a=b linpack', 35.056), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 5228), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.004), ('OMP_NUM_THREADS=1 bt', 6998), ('OMP_NUM_THREADS=1 cg', 615.044), ('OMP_NUM_THREADS=1 ft', 6814), ('OMP_NUM_THREADS=1 lu', 2.037), ('OMP_NUM_THREADS=1 mg', 3164.03), ('OMP_NUM_THREADS=1 sp', 154.067), ('a=b redis', 221.009), ('a=b hdastar maze-6404.txt 8', 10.077)] + # # # print the results + # # print("qemu_x86_64_results=", qemu_x86_64_results) + # qemu_aarch64_results = run_qemu_aarch64() + # print("qemu_aarch64_results=", qemu_aarch64_results) + # # hcontainer_results = run_hcontainer() + # # print("hcontainer_results=", hcontainer_results) + # hcontainer_results= [('a=b linpack', 26.038), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 28.023), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 171.037), ('OMP_NUM_THREADS=1 cg', 25.09), ('OMP_NUM_THREADS=1 ft', 69.088), ('OMP_NUM_THREADS=1 lu', 0.02), ('OMP_NUM_THREADS=1 mg', 18.048), ('OMP_NUM_THREADS=1 sp', 1.024), ('a=b redis', 169.013), ('a=b hdastar maze-6404.txt 8', 0.0), ('a=b linpack', 26.05), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 28.085), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 172.038), ('OMP_NUM_THREADS=1 cg', 25.032), ('OMP_NUM_THREADS=1 ft', 73.039), ('OMP_NUM_THREADS=1 lu', 0.02), ('OMP_NUM_THREADS=1 mg', 17.097), ('OMP_NUM_THREADS=1 sp', 1.027), ('a=b redis', 195.034), ('a=b hdastar maze-6404.txt 8', 0.0), ('a=b linpack', 26.023), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 27.098), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 173.055), ('OMP_NUM_THREADS=1 cg', 25.001), ('OMP_NUM_THREADS=1 ft', 71.098), ('OMP_NUM_THREADS=1 lu', 0.004), ('OMP_NUM_THREADS=1 mg', 17.057), ('OMP_NUM_THREADS=1 sp', 1.041), ('a=b redis', 174.041), ('a=b hdastar maze-6404.txt 8', 0.0), ('a=b linpack', 25.092), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 27.087), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 168.01), ('OMP_NUM_THREADS=1 cg', 24.095), ('OMP_NUM_THREADS=1 ft', 72.004), ('OMP_NUM_THREADS=1 lu', 0.005), ('OMP_NUM_THREADS=1 mg', 17.088), ('OMP_NUM_THREADS=1 sp', 1.067), ('a=b redis', 179.019), ('a=b hdastar maze-6404.txt 8', 0.0), ('a=b linpack', 26.064), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 27.061), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 171.028), ('OMP_NUM_THREADS=1 cg', 24.075), ('OMP_NUM_THREADS=1 ft', 72.025), ('OMP_NUM_THREADS=1 lu', 0.005), ('OMP_NUM_THREADS=1 mg', 17.05), ('OMP_NUM_THREADS=1 sp', 1.06), ('a=b redis', 205.011), ('a=b hdastar maze-6404.txt 8', 0.0), ('a=b linpack', 28.047), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 30.028), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 165.071), ('OMP_NUM_THREADS=1 cg', 25.0), ('OMP_NUM_THREADS=1 ft', 71.06), ('OMP_NUM_THREADS=1 lu', 0.005), ('OMP_NUM_THREADS=1 mg', 17.011), ('OMP_NUM_THREADS=1 sp', 1.071), ('a=b redis', 167.011), ('a=b hdastar maze-6404.txt 8', 0.0), ('a=b linpack', 26.087), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 26.099), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 163.098), ('OMP_NUM_THREADS=1 cg', 25.089), ('OMP_NUM_THREADS=1 ft', 66.056), ('OMP_NUM_THREADS=1 lu', 0.006), ('OMP_NUM_THREADS=1 mg', 18.018), ('OMP_NUM_THREADS=1 sp', 1.052), ('a=b redis', 161.032), ('a=b hdastar maze-6404.txt 8', 0.0), ('a=b linpack', 27.05), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 26.082), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 155.076), ('OMP_NUM_THREADS=1 cg', 24.088), ('OMP_NUM_THREADS=1 ft', 68.08), ('OMP_NUM_THREADS=1 lu', 0.004), ('OMP_NUM_THREADS=1 mg', 17.069), ('OMP_NUM_THREADS=1 sp', 1.065), ('a=b redis', 189.096), ('a=b hdastar maze-6404.txt 8', 0.0), ('a=b linpack', 27.053), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 28.003), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 147.058), ('OMP_NUM_THREADS=1 cg', 26.021), ('OMP_NUM_THREADS=1 ft', 64.068), ('OMP_NUM_THREADS=1 lu', 0.005), ('OMP_NUM_THREADS=1 mg', 18.001), ('OMP_NUM_THREADS=1 sp', 1.013), ('a=b redis', 164.056), ('a=b hdastar maze-6404.txt 8', 0.0), ('a=b linpack', 26.035), ('OMP_NUM_THREADS=1 llama stories110M.bin -z tokenizer.bin -t 0.0', 27.024), ('a=b rgbd_tum ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', 0.0), ('OMP_NUM_THREADS=1 bt', 139.076), ('OMP_NUM_THREADS=1 cg', 24.047), ('OMP_NUM_THREADS=1 ft', 60.056), ('OMP_NUM_THREADS=1 lu', 0.005), ('OMP_NUM_THREADS=1 mg', 17.008), ('OMP_NUM_THREADS=1 sp', 1.023), ('a=b redis', 138.061), ('a=b hdastar maze-6404.txt 8', 0.0)] + # write_to_csv("comparison.csv") + results = read_from_csv("comparison.csv") - plot(results) + print(calculate_averages_comparison(results)) + results1 = read_from_csv("comparison_mac.csv") + print(calculate_averages_comparison(results1)) + plot(results, results1) diff --git a/artifact/bench_comparison_gapbs_mac.py b/artifact/bench_comparison_gapbs_mac.py index 6215d54..773cd26 100644 --- a/artifact/bench_comparison_gapbs_mac.py +++ b/artifact/bench_comparison_gapbs_mac.py @@ -311,13 +311,14 @@ def plot(results): if __name__ == "__main__": - mvvm_results = run_mvvm() - native_results = run_native() - qemu_x86_64_results = run_qemu_x86_64() - # # print the results - qemu_aarch64_results = run_qemu_aarch64() + # mvvm_results = run_mvvm() + # native_results = run_native() + # qemu_x86_64_results = run_qemu_x86_64() + # # # print the results + # qemu_aarch64_results = run_qemu_aarch64() - write_to_csv("comparison_gapbs.csv") + # write_to_csv("comparison_gapbs.csv") results = read_from_csv("comparison_gapbs.csv") plot(results) + diff --git a/artifact/bench_loop_counter.py b/artifact/bench_loop_counter.py new file mode 100644 index 0000000..37e46ce --- /dev/null +++ b/artifact/bench_loop_counter.py @@ -0,0 +1,303 @@ +import csv +import common_util +from common_util import ( + plot_loop_counter, + plot_loop_counter_snapshot, + calculate_loop_counter_averages, + aot_variant_freq, + calculate_loop_counter_snapshot_averages, +) +from multiprocessing import Pool + +cmd = [ + "llama", + "bc", + "bfs", + "cc", + "cc_sv", + "pr", + "pr_spmv", + "sssp", + "tc", + "bt", + "cg", + "ep", + "ft", + "lu", + "mg", + "sp", + "redis", + # "hdastar", +] +folder = [ + "llama", + "gapbs", + "gapbs", + "gapbs", + "gapbs", + "gapbs", + "gapbs", + "gapbs", + "gapbs", + "nas", + "nas", + "nas", + "nas", + "nas", + "nas", + "nas", + "redis", + # "hdastar", +] +arg = [ + ["stories110M.bin", "-z", "tokenizer.bin", "-t", "0.0"], + ["-g20", "-vn300"], + ["-g20", "-vn300"], + ["-g20", "-vn300"], + ["-g20", "-vn300"], + ["-g20", "-vn300"], + ["-g20", "-vn300"], + ["-g20", "-vn300"], + ["-g20", "-n1"], + [], + [], + [], + [], + [], + [], + [], + [], + # ["maze-6404.txt", "8"], +] +envs = [ + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "OMP_NUM_THREADS=1", + "a=b", + # "a=b", +] + +pool = Pool(processes=16) + + +def run_mvvm(): + results = [[] for _ in range(len(aot_variant_freq))] + name = [] + results1 = [] + for _ in range(common_util.trial): + for i in range(len(cmd)): + for j in range(len(common_util.aot_variant_freq)): + aot = cmd[i] + common_util.aot_variant_freq[j] + results1.append( + pool.apply_async(common_util.run, (aot, arg[i], envs[i])) + ) + # print the results + results1 = [x.get() for x in results1] + exec_time = "" + for exec, output in results1: + lines = output.split("\n") + for line in lines: + if line.__contains__("Execution time:"): + exec_time = line.split(" ")[-2] + # print(exec, exec_time) + + for a in common_util.aot_variant_freq: + if exec.__contains__(a): + if a == "-ckpt-loop-counter-1.aot": + results[0].append(exec_time) + elif a == "-ckpt-loop-counter-4.aot": + results[1].append(exec_time) + elif a == "-ckpt-loop-counter-8.aot": + results[2].append(exec_time) + elif a == "-ckpt-loop-counter-16.aot": + results[3].append(exec_time) + elif a == "-ckpt-loop-counter-20.aot": + results[4].append(exec_time) + elif a == "-ckpt-loop-counter-30.aot": + results[5].append(exec_time) + elif a == "-ckpt-loop-pgo.aot": + results[6].append(exec_time) + elif a == "-pure.aot": + results[8].append(exec_time) + elif ( + a == ".aot" + and not exec.__contains__("-ckpt-loop-counter-1.aot") + and not exec.__contains__("-ckpt-loop-counter-4.aot") + and not exec.__contains__("-ckpt-loop-counter-8.aot") + and not exec.__contains__("-ckpt-loop-counter-16.aot") + and not exec.__contains__("-ckpt-loop-counter-20.aot") + and not exec.__contains__("-ckpt-loop-counter-30.aot") + and not exec.__contains__("-ckpt-loop-pgo.aot") + and not exec.__contains__("-pure.aot") + ): + results[7].append(exec_time) + name.append(exec) + final_results = list(zip(name, *results)) + print(results) + return final_results + + +def run_mvvm_profile(): + results1 = [] + # for _ in range(common_util.trial): + for i in range(len(cmd)): + # for j in range(len(common_util.aot_variant_freq)): + aot = cmd[i] + "-ckpt-loop-pgo.aot" + results1.append( + pool.apply_async(common_util.run_profile, (aot, arg[i], envs[i])) + ) + results1 = [x.get() for x in results1] + + +def run_mvvm_snapshot(): + results = [[] for _ in range(len(aot_variant_freq))] + name = [] + results1 = [] + for _ in range(common_util.trial): + for i in range(len(cmd)): + for j in range(len(common_util.aot_variant_freq)): + aot = cmd[i] + common_util.aot_variant_freq[j] + results1.append( + pool.apply_async(common_util.run_checkpoint, (aot, arg[i], envs[i])) + ) + # print the results + results1 = [x.get() for x in results1] + exec_time = "" + for exec, output in results1: + lines = output.split("\n") + for line in lines: + if line.__contains__("Snapshot Overhead:"): + exec_time = line.split(" ")[-2] + # print(exec, exec_time) + + for a in common_util.aot_variant_freq: + if exec.__contains__(a): + if a == "-ckpt-loop-counter-1.aot": + results[0].append(exec_time) + elif a == "-ckpt-loop-counter-4.aot": + results[1].append(exec_time) + elif a == "-ckpt-loop-counter-8.aot": + results[2].append(exec_time) + elif a == "-ckpt-loop-counter-16.aot": + results[3].append(exec_time) + elif a == "-ckpt-loop-counter-20.aot": + results[4].append(exec_time) + elif a == "-ckpt-loop-counter-30.aot": + results[5].append(exec_time) + elif a == "-ckpt-loop-pgo.aot": + results[6].append(exec_time) + elif a == "-pure.aot": + results[8].append(exec_time) + elif ( + a == ".aot" + and not exec.__contains__("-ckpt-loop-counter-1.aot") + and not exec.__contains__("-ckpt-loop-counter-4.aot") + and not exec.__contains__("-ckpt-loop-counter-8.aot") + and not exec.__contains__("-ckpt-loop-counter-16.aot") + and not exec.__contains__("-ckpt-loop-counter-20.aot") + and not exec.__contains__("-ckpt-loop-counter-30.aot") + and not exec.__contains__("-ckpt-loop-pgo.aot") + and not exec.__contains__("-pure.aot") + ): + results[7].append(exec_time) + name.append(exec) + final_results = list(zip(name, *results)) + print(results) + return final_results + + +def write_to_csv(filename): + # 'data' is a list of tuples, e.g., [(checkpoint_result_0, checkpoint_result_1, restore_result_2), ...] + with open(filename, "a+", newline="") as csvfile: + writer = csv.writer(csvfile) + # Optionally write headers + writer.writerow(["name", *aot_variant_freq]) + + # Write the data + for idx, row in enumerate(mvvm_results): + writer.writerow( + [ + row[0], + row[1], + row[2], + row[3], + row[4], + row[5], + row[6], + row[7], + row[8], + row[9], + ] + ) + + +def read_from_csv(filename): + with open(filename, "r") as csvfile: + reader = csv.reader(csvfile) + next(reader) + results = [] + for row in reader: + results.append( + ( + row[0], + float(row[1]), + float(row[2]), + float(row[3]), + float(row[4]), + float(row[5]), + float(row[6]), + float(row[7]), + float(row[8]), + float(row[9]), + ) + ) + return results + + +def read_from_csv_snapshot(filename): + with open(filename, "r") as csvfile: + reader = csv.reader(csvfile) + next(reader) + results = [] + for row in reader: + results.append( + ( + row[0], + float(row[1]), + float(row[2]), + float(row[3]), + float(row[4]), + float(row[5]), + float(row[6]), + ) + ) + return results + + +if __name__ == "__main__": + # run_mvvm_profile() + # mvvm_results = run_mvvm() + # write_to_csv("policy_loop_counter2.csv") + mvvm_results = read_from_csv("policy_loop_counter2.csv") + plot_loop_counter(mvvm_results, "policy_loop_counter.pdf") + print(calculate_loop_counter_averages(mvvm_results)) + # mvvm_results = run_mvvm_snapshot() + # write_to_csv("policy_loop_snapshot.csv") + mvvm_results = read_from_csv_snapshot("policy_loop_snapshot.csv") + # mvvm_results = read_from_csv("policy_loop_snapshot.csv") + plot_loop_counter_snapshot(mvvm_results, "policy_loop_counter_snapshot.pdf") + print(calculate_loop_counter_snapshot_averages(mvvm_results)) diff --git a/artifact/bench_policy.py b/artifact/bench_policy.py index ac61742..6a96469 100644 --- a/artifact/bench_policy.py +++ b/artifact/bench_policy.py @@ -1,9 +1,7 @@ import csv import common_util from multiprocessing import Pool -import matplotlib.pyplot as plt -import numpy as np -from collections import defaultdict +from common_util import plot, calculate_averages cmd = [ "llama", @@ -123,13 +121,13 @@ def run_mvvm(): results_1.append(exec_time) elif a == "-stack.aot": results_2.append(exec_time) - elif a == "-ckpt-every-dirty.aot": + elif a == "-ckpt-loop-counter.aot": results_3.append(exec_time) elif a == "-ckpt-loop.aot": results_4.append(exec_time) elif a == "-ckpt-loop-dirty.aot": results_5.append(exec_time) - elif a==".aot" and not exec.__contains__("-pure.aot") and not exec.__contains__("-stack.aot")and not exec.__contains__("-ckpt-every-dirty.aot") and not exec.__contains__("-ckpt-loop.aot") and not exec.__contains__("-ckpt-loop-dirty.aot"): + elif a==".aot" and not exec.__contains__("-pure.aot") and not exec.__contains__("-stack.aot")and not exec.__contains__("-ckpt-loop-counter.aot") and not exec.__contains__("-ckpt-loop.aot") and not exec.__contains__("-ckpt-loop-dirty.aot"): results_0.append(exec_time) name.append(exec) results = list( @@ -178,120 +176,12 @@ def read_from_csv(filename): next(reader) results = [] for row in reader: - results.append((row[0], float(row[1]), float(row[2]), float(row[3]), float(row[4]), float(row[5]), float(row[6]))) + results.append((row[0], float(row[1]), float(row[2]), float(row[3]), float(row[5]), float(row[6]))) return results - -def plot(results): - font = {'size': 18} - - plt.rc('font', **font) - workloads = defaultdict(list) - for workload,pure, aot, stack,ckpt_every,loop,loop_dirty in results: - workloads[ - workload.replace("OMP_NUM_THREADS=", "") - .replace("-g20", "") - .replace("-n300", "") - .replace(" -f ", "") - .replace("-vn300", "") - .replace("maze-6404.txt", "") - .replace("stories110M.bin", "") - .replace("-z tokenizer.bin -t 0.0", "") - .strip() - ].append(( pure,aot, stack,loop,loop_dirty,ckpt_every)) - - statistics = {} - for workload, times in workloads.items(): - pures,aots, stacks,loops,loop_dirtys,ckpt_everys= zip(*times) - statistics[workload] = { - "pure_median": np.median(pures), - "aot_median": np.median(aots), - "loop_median" :np.median(loops), - "loop_dirty_median" :np.median(loop_dirtys), - "ckpt_every_median" :np.median(ckpt_everys), - "stack_median": np.median(stacks), - "pure_std": np.std(pures), - "aot_std": np.std(aots), - "loop_std" :np.std(loops), - "loop_dirty_std" :np.std(loop_dirtys), - "ckpt_every_std" :np.std(ckpt_everys), - "stack_std": np.std(stacks), - } - - fig, ax = plt.subplots(figsize=(20, 10)) - index = np.arange(len(statistics)) - bar_width = 0.7 - - for i, (workload, stats) in enumerate(statistics.items()): - ax.bar( - index[i], - stats["ckpt_every_median"], - bar_width, - yerr=stats["ckpt_every_std"], - capsize=5, - color="blue", - label="ckpt_every" if i == 0 else "", - ) - ax.bar( - index[i], - stats["loop_dirty_median"], - bar_width, - yerr=stats["loop_dirty_std"], - capsize=5, - color="red", - label="loop_dirty" if i == 0 else "", - ) - ax.bar( - index[i], - stats["loop_median"], - bar_width, - yerr=stats["loop_std"], - capsize=5, - color="brown", - label="loop" if i == 0 else "", - ) - ax.bar( - index[i], - stats["stack_median"], - bar_width, - yerr=stats["stack_std"], - capsize=5, - color="purple", - label="stack" if i == 0 else "", - ) - ax.bar( - index[i], - stats["aot_median"], - bar_width, - yerr=stats["aot_std"], - capsize=5, - color="cyan", - label="aot" if i == 0 else "", - ) - ax.bar( - index[i], - stats["pure_median"], - bar_width, - yerr=stats["pure_std"], - capsize=5, - color="green", - label="pure" if i == 0 else "", - ) - # ax.set_xlabel(workload) - ticklabel = (x for x in list(statistics.keys())) - print(statistics.keys()) - ax.set_xticks(index) - - ax.set_xticklabels(ticklabel,fontsize =10) - ax.set_ylabel("Execution time (s)") - ax.legend() - - # add text at upper left - ax.legend(loc="upper right") - - plt.savefig("performance_singlethread.pdf") if __name__ == "__main__": -# mvvm_results = run_mvvm() -# write_to_csv("policy.csv") + mvvm_results = run_mvvm() + write_to_csv("policy.csv") mvvm_results = read_from_csv("policy.csv") - plot(mvvm_results) + plot(mvvm_results, "policy_singlethread.pdf") + print(calculate_averages(mvvm_results)) diff --git a/artifact/bench_policy_mac.py b/artifact/bench_policy_mac.py index ff1384c..752a9e7 100644 --- a/artifact/bench_policy_mac.py +++ b/artifact/bench_policy_mac.py @@ -1,9 +1,7 @@ import csv import common_util +from common_util import plot, calculate_averages from multiprocessing import Pool -import matplotlib.pyplot as plt -import numpy as np -from collections import defaultdict cmd = [ "llama", @@ -178,122 +176,13 @@ def read_from_csv(filename): next(reader) results = [] for row in reader: - results.append((row[0], float(row[1]), float(row[2]), float(row[3]), float(row[4]), float(row[5]), float(row[6]))) + results.append((row[0], float(row[1]), float(row[2]), float(row[3]), float(row[5]), float(row[6]))) return results - - -def plot(results): - font = {'size': 18} - - plt.rc('font', **font) - workloads = defaultdict(list) - for workload,pure, aot, stack,ckpt_every,loop,loop_dirty in results: - workloads[ - workload.replace("OMP_NUM_THREADS=", "") - .replace("-g20", "") - .replace("-n300", "") - .replace(" -f ", "") - .replace("-vn300", "") - .replace("maze-6404.txt", "") - .replace("stories110M.bin", "") - .replace("-z tokenizer.bin -t 0.0", "") - .strip() - ].append(( pure,aot, stack,loop,loop_dirty,ckpt_every)) - - statistics = {} - for workload, times in workloads.items(): - pures,aots, stacks,loops,loop_dirtys,ckpt_everys= zip(*times) - statistics[workload] = { - "pure_median": np.median(pures), - "aot_median": np.median(aots), - "loop_median" :np.median(loops), - "loop_dirty_median" :np.median(loop_dirtys), - "ckpt_every_median" :np.median(ckpt_everys), - "stack_median": np.median(stacks), - "pure_std": np.std(pures), - "aot_std": np.std(aots), - "loop_std" :np.std(loops), - "loop_dirty_std" :np.std(loop_dirtys), - "ckpt_every_std" :np.std(ckpt_everys), - "stack_std": np.std(stacks), - } - - fig, ax = plt.subplots(figsize=(20, 10)) - index = np.arange(len(statistics)) - bar_width = 0.7 - - for i, (workload, stats) in enumerate(statistics.items()): - ax.bar( - index[i], - stats["ckpt_every_median"], - bar_width, - yerr=stats["ckpt_every_std"], - capsize=5, - color="blue", - label="ckpt_every" if i == 0 else "", - ) - ax.bar( - index[i], - stats["loop_dirty_median"], - bar_width, - yerr=stats["loop_dirty_std"], - capsize=5, - color="red", - label="loop_dirty" if i == 0 else "", - ) - ax.bar( - index[i], - stats["loop_median"], - bar_width, - yerr=stats["loop_std"], - capsize=5, - color="brown", - label="loop" if i == 0 else "", - ) - ax.bar( - index[i], - stats["stack_median"], - bar_width, - yerr=stats["stack_std"], - capsize=5, - color="purple", - label="stack" if i == 0 else "", - ) - ax.bar( - index[i], - stats["aot_median"], - bar_width, - yerr=stats["aot_std"], - capsize=5, - color="cyan", - label="aot" if i == 0 else "", - ) - ax.bar( - index[i], - stats["pure_median"], - bar_width, - yerr=stats["pure_std"], - capsize=5, - color="green", - label="pure" if i == 0 else "", - ) - # ax.set_xlabel(workload) - ticklabel = (x for x in list(statistics.keys())) - print(statistics.keys()) - ax.set_xticks(index) - - ax.set_xticklabels(ticklabel,fontsize =10) - ax.set_ylabel("Execution time (s)") - ax.legend() - - # add text at upper left - ax.legend(loc="upper right") - - plt.savefig("performance_singlethread.pdf") if __name__ == "__main__": # mvvm_results = run_mvvm() # write_to_csv("policy.csv") - mvvm_results = read_from_csv("policy.csv") - plot(mvvm_results) \ No newline at end of file + mvvm_results = read_from_csv("policy_mac.csv") + plot(mvvm_results, "policy_mac.pdf") + print(calculate_averages(mvvm_results)) \ No newline at end of file diff --git a/artifact/bench_policy_multithread.py b/artifact/bench_policy_multithread.py index 11a648b..62fc4fd 100644 --- a/artifact/bench_policy_multithread.py +++ b/artifact/bench_policy_multithread.py @@ -1,9 +1,7 @@ import csv import common_util +from common_util import plot, calculate_averages from multiprocessing import Pool -import matplotlib.pyplot as plt -import numpy as np -from collections import defaultdict cmd = [ "llama", @@ -123,7 +121,7 @@ def run_mvvm(): results_1.append(exec_time) elif a == "-stack.aot": results_2.append(exec_time) - elif a == "-ckpt-every-dirty.aot": + elif a == "-ckpt-loop-counter.aot": results_3.append(exec_time) elif a == "-ckpt-loop.aot": results_4.append(exec_time) @@ -133,7 +131,7 @@ def run_mvvm(): a == ".aot" and not exec.__contains__("-pure.aot") and not exec.__contains__("-stack.aot") - and not exec.__contains__("-ckpt-every-dirty.aot") + and not exec.__contains__("-ckpt-loop-counter.aot") and not exec.__contains__("-ckpt-loop.aot") and not exec.__contains__("-ckpt-loop-dirty.aot") ): @@ -167,7 +165,6 @@ def write_to_csv(filename): "aot", "pure.aot", "stack.aot", - "ckpt-every-dirty.aot", "ckpt-loop.aot", "ckpt-loop-dirty.aot", ] @@ -175,7 +172,7 @@ def write_to_csv(filename): # Write the data for idx, row in enumerate(mvvm_results): - writer.writerow([row[0], row[1], row[2], row[3], row[4], row[5], row[6]]) + writer.writerow([row[0], row[1], row[2], row[3], row[4], row[5]]) def read_from_csv(filename): @@ -190,128 +187,15 @@ def read_from_csv(filename): float(row[1]), float(row[2]), float(row[3]), - float(row[4]), float(row[5]), float(row[6]), ) ) return results - - -def plot(results): - font = {"size": 18} - - plt.rc("font", **font) - workloads = defaultdict(list) - for workload, pure, aot, stack, ckpt_every, loop, loop_dirty in results: - workloads[ - workload.replace("OMP_NUM_THREADS=", "") - .replace("-g20", "") - .replace("-n300", "") - .replace(" -f ", "") - .replace("-vn300", "") - .replace("maze-6404.txt", "") - .replace("stories110M.bin", "") - .replace("-z tokenizer.bin -t 0.0", "") - .strip() - ].append((pure, aot, stack, loop, loop_dirty, ckpt_every)) - - statistics = {} - for workload, times in workloads.items(): - pures, aots, stacks, loops, loop_dirtys, ckpt_everys = zip(*times) - statistics[workload] = { - "pure_median": np.median(pures), - "aot_median": np.median(aots), - "loop_median": np.median(loops), - "loop_dirty_median": np.median(loop_dirtys), - "ckpt_every_median": np.median(ckpt_everys), - "stack_median": np.median(stacks), - "pure_std": np.std(pures), - "aot_std": np.std(aots), - "loop_std": np.std(loops), - "loop_dirty_std": np.std(loop_dirtys), - "ckpt_every_std": np.std(ckpt_everys), - "stack_std": np.std(stacks), - } - - fig, ax = plt.subplots(figsize=(20, 10)) - index = np.arange(len(statistics)) - bar_width = 0.7 - - for i, (workload, stats) in enumerate(statistics.items()): - ax.bar( - index[i], - stats["ckpt_every_median"], - bar_width, - yerr=stats["ckpt_every_std"], - capsize=5, - color="blue", - label="ckpt_every" if i == 0 else "", - ) - ax.bar( - index[i], - stats["loop_dirty_median"], - bar_width, - yerr=stats["loop_dirty_std"], - capsize=5, - color="red", - label="loop_dirty" if i == 0 else "", - ) - ax.bar( - index[i], - stats["loop_median"], - bar_width, - yerr=stats["loop_std"], - capsize=5, - color="brown", - label="loop" if i == 0 else "", - ) - ax.bar( - index[i], - stats["stack_median"], - bar_width, - yerr=stats["stack_std"], - capsize=5, - color="purple", - label="stack" if i == 0 else "", - ) - ax.bar( - index[i], - stats["aot_median"], - bar_width, - yerr=stats["aot_std"], - capsize=5, - color="cyan", - label="aot" if i == 0 else "", - ) - ax.bar( - index[i], - stats["pure_median"], - bar_width, - yerr=stats["pure_std"], - capsize=5, - color="green", - label="pure" if i == 0 else "", - ) - # ax.set_xlabel(workload) - ticklabel = (x for x in list(statistics.keys())) - print(statistics.keys()) - ax.set_xticks(index) - - ax.set_xticklabels(ticklabel, fontsize=10) - ax.set_ylabel("Execution time (s)") - ax.legend() - - # add text at upper left - ax.legend(loc="upper right") - - # plt.show() - - plt.savefig("performance_multithread.pdf") - - + if __name__ == "__main__": mvvm_results = run_mvvm() write_to_csv("policy_multithread.csv") mvvm_results = read_from_csv("policy_multithread.csv") - plot(mvvm_results) + # plot(mvvm_results, "policy_multithread.pdf") + # print(calculate_averages(mvvm_results)) \ No newline at end of file diff --git a/artifact/ckpt_restore_latency.py b/artifact/ckpt_restore_latency.py index bb905a9..0b82ce4 100644 --- a/artifact/ckpt_restore_latency.py +++ b/artifact/ckpt_restore_latency.py @@ -388,13 +388,13 @@ def plot(result, file_name="ckpt_restore_latency.pdf"): def plot_whole( result_mvvm, result_criu, result_qemu, file_name="ckpt_restore_latency_whole.pdf" ): - font = {"size": 18} + font = {"size": 20} plt.rc("font", **font) workloads = defaultdict(list) for workload, snapshot, recovery in result_mvvm: workloads[ - workload.replace("OMP_NUM_THREADS=", "") + workload.replace("OMP_NUM_THREADS=2", "").replace("OMP_NUM_THREADS=4", "").replace("hdastar", "hda").replace("stories15M.bin", "") .replace("-g15", "") .replace("-n300", "") .replace(" -f ", "") @@ -408,7 +408,7 @@ def plot_whole( workloads_criu = defaultdict(list) for workload, snapshot, recovery in result_criu: workloads_criu[ - workload.replace("OMP_NUM_THREADS=", "") + workload.replace("OMP_NUM_THREADS=2", "").replace("OMP_NUM_THREADS=4", "").replace("hdastar", "hda").replace("stories15M.bin", "") .replace("-g15", "") .replace("-n300", "") .replace(" -f ", "") @@ -422,7 +422,7 @@ def plot_whole( workloads_qemu = defaultdict(list) for workload, snapshot, recovery in result_qemu: workloads_qemu[ - workload.replace("OMP_NUM_THREADS=", "") + workload.replace("OMP_NUM_THREADS=2", "").replace("OMP_NUM_THREADS=4", "").replace("hdastar", "hda").replace("stories15M.bin", "") .replace("-g15", "") .replace("-n300", "") .replace(" -f ", "") @@ -456,7 +456,7 @@ def plot_whole( # Plotting fig, ax = plt.subplots(figsize=(15, 7)) # Define the bar width and positions - bar_width = 0.7 / 5 + bar_width = 0.7 / 4 index = np.arange(len(statistics)) # Plot the bars for each workload @@ -524,7 +524,7 @@ def plot_whole( ax.set_ylabel("Time") ax.set_xticks(index + bar_width / 2) ticklabel = (x.replace("a=b", "") for x in list(statistics.keys())) - ax.set_xticklabels(ticklabel, fontsize=10) + ax.set_xticklabels(ticklabel, fontsize=20) ax.legend() # Show the plot @@ -542,12 +542,12 @@ def plot_whole( # print(len(arg), len(cmd), len(envs)) # criu_result = run_criu() # write_to_csv(criu_result, "ckpt_restore_latency_criu.csv") - # plot(criu_result, "ckpt_restore_latency_criu.pdf") + # # plot(criu_result, "ckpt_restore_latency_criu.pdf") # qemu_result = run_qemu() # write_to_csv(qemu_result, "ckpt_restore_latency_qemu.csv") mvvm_result = read_from_csv("ckpt_restore_latency.csv") criu_result = read_from_csv("ckpt_restore_latency_criu.csv") - # print(criu_result) + print(criu_result) qemu_result = read_from_csv("ckpt_restore_latency_qemu.csv") plot_whole(mvvm_result, criu_result, qemu_result) # plot_qemu(results, "ckpt_restore_latency_qemu.pdf") diff --git a/artifact/common_util.py b/artifact/common_util.py index c437f72..c0a6915 100644 --- a/artifact/common_util.py +++ b/artifact/common_util.py @@ -81,6 +81,69 @@ def calculate_averages(results): return dict(total_averages) +def calculate_loop_counter_averages(results): + workload_normalized = defaultdict(list) + + # Step 1: Normalize values for each workload + for workload, ckptloopcounter1, ckptloopcounter4, ckptloopcounter8, ckptloopcounter16, ckptloopcounter20,ckptloopcounter30,ckptlooppgo,aot,pure in results: + # Assuming 'pure' is always non-zero + workload_normalized[workload].append( + { + "ckptloopcounter1": ckptloopcounter1 / pure if pure else 0, + "ckptloopcounter4": ckptloopcounter4 / pure if pure else 0, + "ckptloopcounter8": ckptloopcounter8 / pure if pure else 0, + "ckptloopcounter16": ckptloopcounter16 / pure if pure else 0, + "ckptloopcounter20": ckptloopcounter20 / pure if pure else 0, + "ckptloopcounter30": ckptloopcounter30 / pure if pure else 0, + "ckptlooppgo": ckptlooppgo / pure if pure else 0, + "aot": aot / pure if pure else 0, + "pure": 1 + } + ) + + # Step 2 and 3: Calculate total average for each policy + total_averages = defaultdict(float) + for workload, policies in workload_normalized.items(): + for policy, values in policies[0].items(): + total_averages[policy] += values + + # Divide by the number of workloads to get the average + num_workloads = len(workload_normalized) + for policy in total_averages: + total_averages[policy] /= num_workloads + + return dict(total_averages) + +def calculate_loop_counter_snapshot_averages(results): + workload_normalized = defaultdict(list) + + # Step 1: Normalize values for each workload + for workload, ckptloopcounter1, ckptloopcounter4, ckptloopcounter8, ckptloopcounter16, ckptloopcounter20,ckptloopcounter30 in results: + # Assuming 'pure' is always non-zero + workload_normalized[workload].append( + { + "ckptloopcounter1": 1, + "ckptloopcounter4": ckptloopcounter4 / ckptloopcounter1 if ckptloopcounter1 else 0, + "ckptloopcounter8": ckptloopcounter8 / ckptloopcounter1 if ckptloopcounter1 else 0, + "ckptloopcounter16": ckptloopcounter16 / ckptloopcounter1 if ckptloopcounter1 else 0, + "ckptloopcounter20": ckptloopcounter20 / ckptloopcounter1 if ckptloopcounter1 else 0, + "ckptloopcounter30": ckptloopcounter30 / ckptloopcounter1 if ckptloopcounter1 else 0, + } + ) + + # Step 2 and 3: Calculate total average for each policy + total_averages = defaultdict(float) + for workload, policies in workload_normalized.items(): + for policy, values in policies[0].items(): + total_averages[policy] += values + + # Divide by the number of workloads to get the average + num_workloads = len(workload_normalized) + for policy in total_averages: + total_averages[policy] /= num_workloads + + return dict(total_averages) + def plot(results, file_name): font = {"size": 18} @@ -138,6 +201,168 @@ def plot(results, file_name): plt.savefig(file_name) +def plot_loop_counter(results, file_name): + font = {"size": 18} + plt.rc("font", **font) + workloads = defaultdict(list) + + # Simplifying and grouping your data + for workload, ckptloopcounter1s, ckptloopcounter4s, ckptloopcounter8s, ckptloopcounter16s, ckptloopcounter20s,ckptloopcounter30s,ckptlooppgos,aots,pures in results: + workloads[workload.split(" ")[1].replace(".aot", "")].append( + (float(ckptloopcounter1s), float(ckptloopcounter4s), float(ckptloopcounter8s), float(ckptloopcounter16s), float(ckptloopcounter20s),float(ckptloopcounter30s),float(ckptlooppgos),float(aots),float(pures)) + ) + + # Calculate statistics + statistics = {} + for workload, times in workloads.items(): + ckptloopcounter1s, ckptloopcounter4s, ckptloopcounter8s, ckptloopcounter16s, ckptloopcounter20s,ckptloopcounter30s,ckptlooppgos,aots,pures = zip(*times) + divisor =np.median(pures) + ckptloopcounter1s = [x/divisor for x in ckptloopcounter1s] + ckptloopcounter4s = [x/divisor for x in ckptloopcounter4s] + ckptloopcounter8s = [x/divisor for x in ckptloopcounter8s] + ckptloopcounter16s = [x/divisor for x in ckptloopcounter16s] + + ckptloopcounter20s = [x/divisor for x in ckptloopcounter20s] + ckptloopcounter30s = [x/divisor for x in ckptloopcounter30s] + ckptlooppgos = [x/divisor for x in ckptlooppgos] + aots = [x/divisor for x in aots] + pures = [x/divisor for x in pures] + statistics[workload] = [ + ("ckptloopcounter1", np.median(ckptloopcounter1s), np.std(ckptloopcounter1s)), + ("ckptloopcounter4", np.median(ckptloopcounter4s), np.std(ckptloopcounter4s)), + ("ckptloopcounter8", np.median(ckptloopcounter8s), np.std(ckptloopcounter8s)), + ("ckptloopcounter16", np.median(ckptloopcounter16s), np.std(ckptloopcounter16s)), + ("ckptloopcounter20", np.median(ckptloopcounter20s), np.std(ckptloopcounter20s)), + ("ckptloopcounter30", np.median(ckptloopcounter30s), np.std(ckptloopcounter30s)), + ("ckptlooppgo", np.median(ckptlooppgos), np.std(ckptlooppgos)), + ("aot", np.median(aots), np.std(aots)), + ("pure", np.median(pures), np.std(pures)), + ] + + fig, ax = plt.subplots(figsize=(20, 10)) + index = np.arange(len(statistics)) + bar_width = 0.7 # Adjusted for visual clarity + color = [ + "ckptloopcounter1", + "ckptloopcounter4", + "ckptloopcounter8", + "ckptloopcounter16", + "ckptloopcounter20", + "ckptloopcounter30", + "ckptlooppgo", + "pure", + "aot", + ] + x_ = [1, 4, 8, 16, 20, 30,40, 50,60] + # x_ = [1< bool: @@ -328,7 +564,7 @@ def run_checkpoint_restore( def run_checkpoint(aot_file: str, arg: list[str], env: str) -> tuple[str, str]: - cmd = f"./MVVM_checkpoint -t ./bench/{aot_file} {' '.join(['-a ' + str(x) for x in arg])} -e {env} -c 10000" + cmd = f"./MVVM_checkpoint -t ./bench/{aot_file} {' '.join(['-a ' + str(x) for x in arg])} -e {env} -c 100000" print(cmd) cmd = cmd.split() result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -540,7 +776,23 @@ def run_qemu_checkpoint( def run(aot_file: str, arg: list[str], env: str, extra: str = "") -> tuple[str, str]: - cmd = f"./MVVM_checkpoint -t ../build/bench/{aot_file} {' '.join(['-a ' + str(x) for x in arg])} -e {env} {extra}" + cmd = f"./MVVM_checkpoint -t ./bench/{aot_file} {' '.join(['-a ' + str(x) for x in arg])} -e {env} {extra}" + print(cmd) + cmd = cmd.split() + result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + try: + output = result.stdout.decode("utf-8") + except: + output = result.stdout + exec = " ".join([env] + [aot_file] + arg) + # print(exec) + # print(output) + return (exec, output) + + +def run_profile(aot_file: str, arg: list[str], env: str, extra: str = "") -> tuple[str, str]: + wasm_file = aot_file.replace("aot","wasm") + cmd = f"./MVVM_profile -w ./bench/{wasm_file} -t ./bench/{aot_file} {' '.join(['-a ' + str(x) for x in arg])} -e {env} {extra}" print(cmd) cmd = cmd.split() result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -728,8 +980,8 @@ def run_checkpoint_restore_burst( # Execute run_checkpoint and capture its result res = [] exec_with_log("rm ./*.out") - exec_with_log("pkill MVVM_checkpoint") - exec_with_log("pkill MVVM_restore") + exec_with_log("sudo pkill MVVM_checkpoint") + exec_with_log("sudo pkill MVVM_restore") exec_with_log(f"ssh -t {burst} pkill MVVM_checkpoint") exec_with_log(f"ssh -t {burst} pkill MVVM_restore") exec_with_log(f"ssh -t {burst} rm {pwd_mac}/build/*.out") @@ -745,50 +997,69 @@ def run_checkpoint_restore_burst( f"script -f -q /dev/null -c './MVVM_restore -t ./bench/{aot_file1} {extra3}' >> MVVM_restore.1.out &" ) exec_with_log( - f"../artifact/run_with_energy_monitoring.sh MVVM_restore 1 {aot_file} &" + f"sudo ../artifact/run_with_energy_monitoring.sh MVVM_restore 1 {aot_file} &" ) exec_with_log( f"script -f -q /dev/null -c './MVVM_restore -t ./bench/{aot_file} {extra7}' >> MVVM_restore.4.out &" ) exec_with_log( - f"../artifact/run_with_energy_monitoring.sh MVVM_restore 4 {aot_file1} &" + f"sudo ../artifact/run_with_energy_monitoring.sh MVVM_restore 4 {aot_file1} &" ) - exec_with_log("sleep 10") + exec_with_log("sleep 100") + exec_with_log( f"./MVVM_checkpoint -t ./bench/{aot_file1} {' '.join(['-a ' + str(x) for x in arg1])} -e {env} {extra1} > MVVM_checkpoint.0.out &" ) exec_with_log( - f"../artifact/run_with_energy_monitoring.sh MVVM_checkpoint 0 {aot_file} &" + f"sudo ../artifact/run_with_energy_monitoring.sh MVVM_checkpoint 0 {aot_file} &" ) + + exec_with_log("sleep 640") - exec_with_log("sleep 10") exec_with_log( f"script -f -q /dev/null -c 'ssh -t {burst} ./MVVM_checkpoint -t ./bench/{aot_file} {' '.join(['-a ' + str(x) for x in arg])} -e {env} {extra6}' > MVVM_checkpoint.1.out &" ) + exec_with_log( + f"ssh -t {burst} {pwd_mac}/artifact/run_with_energy_monitoring_mac.sh MVVM_checkpoint 1 {aot_file1} &" + ) # exec_with_log(f"ssh -t mac ../artifact/run_with_energy_monitoring_mac.sh MVVM_checkpoint 1 {aot_file} &") exec_with_log(f"pkill -SIGINT MVVM_checkpoint") + sleep(1) + exec_with_log(f"pkill -SIGINT MVVM_checkpoint") - exec_with_log("sleep 100") + exec_with_log("sleep 50") exec_with_log(f"ssh -t {burst} pkill -SIGINT MVVM_restore") exec_with_log(f"ssh -t {burst} pkill -SIGINT MVVM_checkpoint") exec_with_log( f"script -f -q /dev/null -c 'ssh -t {burst} ./MVVM_restore -t ./bench/{aot_file1} {extra4}' >> MVVM_restore.2.out &" ) + exec_with_log( + f"ssh -t {burst} {pwd_mac}/artifact/run_with_energy_monitoring_mac.sh MVVM_restore 2 {aot_file} &" + ) exec_with_log( f"script -f -q /dev/null -c 'ssh -t {burst} ./MVVM_restore -t ./bench/{aot_file} {extra8}' >> MVVM_restore.5.out &" ) - exec_with_log("sleep 100") + exec_with_log( + f"ssh -t {burst} {pwd_mac}/artifact/run_with_energy_monitoring_mac.sh MVVM_restore 5 {aot_file1} &" + ) + exec_with_log("sleep 50") exec_with_log(f"pkill -SIGINT MVVM_restore") exec_with_log( f"script -f -q /dev/null -c './MVVM_restore -t ./bench/{aot_file} {extra9}' >> MVVM_restore.6.out &" ) + exec_with_log( + f"sudo ../artifact/run_with_energy_monitoring.sh MVVM_restore 6 {aot_file1} &" + ) exec_with_log( f"script -f -q /dev/null -c './MVVM_restore -t ./bench/{aot_file1} {extra5}' >> MVVM_restore.3.out &" ) + exec_with_log( + f"sudo ../artifact/run_with_energy_monitoring.sh MVVM_restore 3 {aot_file} &" + ) # Return a combined result or just the checkpoint result as needed - exec_with_log("sleep 100") + exec_with_log("sleep 50") exec_with_log(f"ssh -t {burst} pkill -SIGINT MVVM_restore") exec_with_log(f"sleep 1000") exec_with_log(f"scp {burst}:{pwd_mac}/build/*.*.out ./") diff --git a/artifact/result/policy.csv b/artifact/result/policy.csv index 52fa2c8..fedb796 100644 --- a/artifact/result/policy.csv +++ b/artifact/result/policy.csv @@ -1,19 +1,181 @@ name,aot,pure.aot,stack.aot,ckpt-every-dirty.aot,ckpt-loop.aot,ckpt-loop-dirty.aot -OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,36.838634,35.490774,35.35192,35.35192,198.85921,195.364888 -OMP_NUM_THREADS=1 bc.aot -g20 -vn300,605.145746,605.145746,505.868372,505.868372,2832.941772,2643.51066 -OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,152.820818,152.820818,106.538025,106.538025,880.15895,810.526482 -OMP_NUM_THREADS=1 cc.aot -g20 -vn300,289.614659,289.614659,174.031847,174.031847,991.653426,1140.914195 -OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,346.56919,346.56919,290.536631,290.536631,2054.915379,2225.318927 -OMP_NUM_THREADS=1 pr.aot -g20 -vn300,330.497569,330.497569,292.699061,292.699061,3772.003879,3664.336752 -OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,268.482607,268.482607,253.826483,253.826483,3341.810219,3171.734207 -OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,427.322708,427.322708,358.032088,358.032088,1796.494136,1682.712455 -OMP_NUM_THREADS=1 tc.aot -g20 -n1,116.105684,116.105684,43.902305,43.902305,288.510501,283.057227 -OMP_NUM_THREADS=1 bt.aot,122.623808,74.751417,75.967604,75.967604,225.124168,226.011014 -OMP_NUM_THREADS=1 cg.aot,42.340921,31.23792,38.988279,38.988279,481.981174,490.708536 -OMP_NUM_THREADS=1 ep.aot,0.000893,0.00068,0.000762,0.000762,0.002982,0.002341 -OMP_NUM_THREADS=1 ft.aot,71.436148,65.882009,56.196119,56.196119,585.085743,608.715938 -OMP_NUM_THREADS=1 lu.aot,0.044005,0.028972,0.03122,0.03122,0.112689,0.117199 -OMP_NUM_THREADS=1 mg.aot,34.188291,24.821178,27.389655,27.389655,304.112518,304.972522 -OMP_NUM_THREADS=1 sp.aot,17.560042,3.989463,6.568757,6.568757,48.527141,49.368021 -OMP_NUM_THREADS=1 redis.aot,56.605383,11.058664,19.21135,19.21135,81.180751,83.398717 -a=b hdastar.aot maze-6404.txt 8,11.700573,3.84014,7.154896,7.154896,12.099818,11.431265 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,26.32401,24.47275,25.321076,25.321076,28.210757,28.361349 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,330.175385,330.175385,287.66762,287.66762,378.43329,450.406083 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,77.442258,77.442258,59.608873,59.608873,75.939167,86.952318 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,127.297564,127.297564,117.563771,117.563771,140.754028,178.084641 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,183.643673,183.643673,151.803182,151.803182,196.635993,238.32247 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,210.696264,210.696264,198.663949,198.663949,257.639548,249.199703 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,178.722241,178.722241,178.80467,178.80467,232.050268,205.669251 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,276.031535,276.031535,259.896001,259.896001,332.261979,379.651648 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,52.947289,52.947289,28.014317,28.014317,41.937946,36.250411 +OMP_NUM_THREADS=1 bt.aot,53.901182,49.834429,51.950295,51.950295,64.165615,60.354006 +OMP_NUM_THREADS=1 cg.aot,23.741945,21.331396,23.463246,23.463246,34.835456,36.64675 +OMP_NUM_THREADS=1 ep.aot,0.002409,0.000642,0.002196,0.002196,0.001753,0.002254 +OMP_NUM_THREADS=1 ft.aot,34.921668,42.638944,42.787694,42.787694,85.351141,79.631072 +OMP_NUM_THREADS=1 lu.aot,0.046032,0.030321,0.046097,0.046097,0.056525,0.049528 +OMP_NUM_THREADS=1 mg.aot,21.919803,20.30285,20.041431,20.041431,42.097394,37.96801 +OMP_NUM_THREADS=1 sp.aot,6.606837,3.380887,6.203338,6.203338,7.355136,7.827257 +OMP_NUM_THREADS=1 redis.aot,19.218774,8.953303,16.486451,16.486451,20.718721,24.309655 +a=b hdastar.aot maze-6404.txt 8,10.852607,10.852607,7.171778,7.171778,9.114045,10.045842 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,25.897895,25.062638,25.868386,25.868386,28.922918,29.765523 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,301.832709,301.832709,282.896189,282.896189,373.382094,431.826209 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,75.649175,75.649175,66.754663,66.754663,78.329767,87.567007 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,140.451921,140.451921,107.166618,107.166618,130.806252,160.562792 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,179.209809,179.209809,168.558224,168.558224,216.848247,251.820018 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,208.34811,208.34811,184.848394,184.848394,218.079389,239.554281 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,183.542291,183.542291,181.628771,181.628771,240.256062,229.553617 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,257.323542,257.323542,245.717304,245.717304,324.181721,386.033067 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,48.603685,48.603685,29.733615,29.733615,39.745585,36.583095 +OMP_NUM_THREADS=1 bt.aot,57.247907,44.65032,48.043901,48.043901,58.635469,54.20708 +OMP_NUM_THREADS=1 cg.aot,25.558449,23.037484,21.886869,21.886869,38.05295,37.475349 +OMP_NUM_THREADS=1 ep.aot,0.002428,0.002061,0.000875,0.000875,0.00234,0.001783 +OMP_NUM_THREADS=1 ft.aot,41.163005,42.095884,39.235179,39.235179,81.749142,82.768726 +OMP_NUM_THREADS=1 lu.aot,0.0306,0.033103,0.045803,0.045803,0.031862,0.033398 +OMP_NUM_THREADS=1 mg.aot,20.977961,20.749273,19.90198,19.90198,42.691378,40.159088 +OMP_NUM_THREADS=1 sp.aot,6.955699,3.308932,5.013995,5.013995,7.923486,8.003463 +OMP_NUM_THREADS=1 redis.aot,21.833607,8.222594,16.140356,16.140356,22.810622,21.972362 +a=b hdastar.aot maze-6404.txt 8,11.033102,7.240213,7.756062,7.756062,10.274468,9.814888 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,26.250435,25.423585,27.599794,27.599794,27.599192,28.251551 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,314.679735,314.679735,270.289248,270.289248,357.712316,431.108137 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,73.376584,73.376584,63.60365,63.60365,78.689536,87.024644 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,140.11572,140.11572,114.583749,114.583749,140.211058,162.117204 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,177.790982,177.790982,154.976378,154.976378,198.82113,239.954035 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,201.459629,201.459629,187.65443,187.65443,211.776292,239.561886 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,179.296536,179.296536,169.747016,169.747016,228.811209,210.947264 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,259.062045,259.062045,236.983772,236.983772,332.904539,389.824371 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,48.01526,48.01526,28.251774,28.251774,45.607345,36.208163 +OMP_NUM_THREADS=1 bt.aot,58.914451,43.970751,46.791867,46.791867,60.678927,55.057852 +OMP_NUM_THREADS=1 cg.aot,25.341725,20.587571,21.469303,21.469303,38.622473,36.344222 +OMP_NUM_THREADS=1 ep.aot,0.002369,0.002623,0.002234,0.002234,0.002202,0.001986 +OMP_NUM_THREADS=1 ft.aot,38.171406,39.41038,42.198242,42.198242,83.410683,86.013585 +OMP_NUM_THREADS=1 lu.aot,0.031647,0.031615,0.046278,0.046278,0.076836,0.04956 +OMP_NUM_THREADS=1 mg.aot,22.581312,19.635273,19.962494,19.962494,38.769531,40.396965 +OMP_NUM_THREADS=1 sp.aot,8.064402,3.259449,5.679862,5.679862,8.799148,8.083138 +OMP_NUM_THREADS=1 redis.aot,19.296517,8.502986,16.869177,16.869177,22.616757,22.691199 +a=b hdastar.aot maze-6404.txt 8,10.726137,9.019793,8.55229,8.55229,10.38056,8.322293 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,25.780773,27.984222,25.782612,25.782612,28.284101,27.888294 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,323.152811,323.152811,279.796384,279.796384,355.40529,434.689572 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,74.16518,74.16518,62.167992,62.167992,77.207588,88.56518 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,134.119155,134.119155,110.216663,110.216663,139.206263,159.530592 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,175.264863,175.264863,186.144251,186.144251,196.988476,239.400409 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,210.587771,210.587771,188.169157,188.169157,253.010977,228.003097 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,185.517594,185.517594,178.751871,178.751871,229.561618,212.737272 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,252.969914,252.969914,246.402566,246.402566,316.733045,387.168169 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,48.489634,48.489634,29.881035,29.881035,37.415762,38.354918 +OMP_NUM_THREADS=1 bt.aot,56.89909,48.137656,50.222577,50.222577,58.898057,61.212617 +OMP_NUM_THREADS=1 cg.aot,24.412837,20.948442,21.658964,21.658964,35.472218,39.132246 +OMP_NUM_THREADS=1 ep.aot,0.002434,0.002017,0.002152,0.002152,0.002259,0.00112 +OMP_NUM_THREADS=1 ft.aot,35.977617,40.743295,39.605921,39.605921,84.185494,83.649818 +OMP_NUM_THREADS=1 lu.aot,0.045066,0.044102,0.0313,0.0313,0.037366,0.034468 +OMP_NUM_THREADS=1 mg.aot,22.26322,19.659268,19.140591,19.140591,40.509674,38.073912 +OMP_NUM_THREADS=1 sp.aot,7.865384,3.139919,5.540717,5.540717,7.264193,7.710061 +OMP_NUM_THREADS=1 redis.aot,20.533998,8.019865,15.51726,15.51726,20.62757,23.131462 +a=b hdastar.aot maze-6404.txt 8,10.464631,7.392301,7.191872,7.191872,10.409401,7.894778 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,25.837071,26.738099,24.923856,24.923856,29.165012,28.439733 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,314.501501,314.501501,273.900725,273.900725,360.837865,426.278387 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,78.481072,78.481072,62.32406,62.32406,76.636029,90.845622 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,133.390783,133.390783,111.557558,111.557558,138.117748,164.813666 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,182.906579,182.906579,163.099766,163.099766,191.588166,242.322348 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,209.683275,209.683275,196.469089,196.469089,246.69717,231.663868 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,184.60817,184.60817,189.745193,189.745193,229.564299,211.29861 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,250.441204,250.441204,250.598474,250.598474,330.9731,390.616741 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,47.987218,47.987218,29.907979,29.907979,39.354687,36.597246 +OMP_NUM_THREADS=1 bt.aot,53.207902,47.620866,52.146854,52.146854,59.069318,56.237051 +OMP_NUM_THREADS=1 cg.aot,24.004543,20.580296,23.613196,23.613196,35.818493,37.025575 +OMP_NUM_THREADS=1 ep.aot,0.001468,0.001022,0.001316,0.001316,0.002222,0.00226 +OMP_NUM_THREADS=1 ft.aot,40.800166,41.823841,37.977687,37.977687,83.176892,90.67427 +OMP_NUM_THREADS=1 lu.aot,0.044778,0.030765,0.032874,0.032874,0.035267,0.047967 +OMP_NUM_THREADS=1 mg.aot,20.860895,19.084838,19.060223,19.060223,36.923657,37.850105 +OMP_NUM_THREADS=1 sp.aot,8.151102,4.250997,4.950717,4.950717,9.241186,7.087115 +OMP_NUM_THREADS=1 redis.aot,21.246748,7.883218,15.798874,15.798874,20.591897,24.042566 +a=b hdastar.aot maze-6404.txt 8,11.010384,7.52467,7.889078,7.889078,8.587365,9.419011 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,26.537821,25.196114,25.694055,25.694055,27.503037,27.666747 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,318.564071,318.564071,272.166234,272.166234,368.351506,425.000584 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,72.494651,72.494651,63.986772,63.986772,76.251307,90.021781 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,135.923028,135.923028,111.575616,111.575616,135.681464,154.812836 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,177.482972,177.482972,161.440022,161.440022,197.451383,245.29796 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,199.074999,199.074999,194.109977,194.109977,212.547019,238.013128 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,185.921444,185.921444,178.192411,178.192411,229.808763,213.470004 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,258.258887,258.258887,244.9681,244.9681,321.930857,393.209565 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,49.072675,49.072675,29.523676,29.523676,37.600505,37.495613 +OMP_NUM_THREADS=1 bt.aot,56.061872,45.410402,49.107181,49.107181,69.249532,63.213962 +OMP_NUM_THREADS=1 cg.aot,25.553841,21.720631,24.238275,24.238275,38.139489,37.110586 +OMP_NUM_THREADS=1 ep.aot,0.002437,0.001032,0.002148,0.002148,0.002243,0.002033 +OMP_NUM_THREADS=1 ft.aot,37.736021,40.802964,40.769184,40.769184,81.071561,82.644068 +OMP_NUM_THREADS=1 lu.aot,0.028817,0.031719,0.041083,0.041083,0.057154,0.049447 +OMP_NUM_THREADS=1 mg.aot,23.528798,26.215859,20.656737,20.656737,40.990668,41.334405 +OMP_NUM_THREADS=1 sp.aot,7.362903,3.05665,4.777694,4.777694,8.336833,7.233483 +OMP_NUM_THREADS=1 redis.aot,22.761611,7.755403,16.662092,16.662092,20.081315,21.864476 +a=b hdastar.aot maze-6404.txt 8,10.630752,6.754623,7.91986,7.91986,11.06454,10.592427 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,26.420552,25.272422,25.414114,25.414114,27.99459,29.610516 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,324.348348,324.348348,277.155939,277.155939,352.86143,437.373153 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,74.301036,74.301036,63.867351,63.867351,79.479022,91.010344 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,132.771272,132.771272,111.567531,111.567531,131.411353,163.090223 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,180.629288,180.629288,159.345642,159.345642,196.993921,241.251872 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,201.082306,201.082306,197.732137,197.732137,212.76443,240.395436 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,184.516734,184.516734,174.439484,174.439484,238.32265,208.321341 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,256.049784,256.049784,247.825421,247.825421,314.961832,400.006322 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,48.750154,48.750154,28.727283,28.727283,40.058054,37.817562 +OMP_NUM_THREADS=1 bt.aot,54.20956,50.478909,49.161971,49.161971,68.076078,60.812714 +OMP_NUM_THREADS=1 cg.aot,24.051822,21.546076,21.970631,21.970631,38.241553,38.372489 +OMP_NUM_THREADS=1 ep.aot,0.002161,0.001988,0.002337,0.002337,0.001501,0.001803 +OMP_NUM_THREADS=1 ft.aot,37.62511,41.095477,41.676236,41.676236,82.942625,84.622683 +OMP_NUM_THREADS=1 lu.aot,0.044509,0.0298,0.03147,0.03147,0.05195,0.032843 +OMP_NUM_THREADS=1 mg.aot,22.686923,19.558681,23.194409,23.194409,37.123832,39.559927 +OMP_NUM_THREADS=1 sp.aot,6.698042,3.019232,6.181779,6.181779,8.556297,7.854604 +OMP_NUM_THREADS=1 redis.aot,19.985551,7.784956,16.247402,16.247402,21.22738,23.924321 +a=b hdastar.aot maze-6404.txt 8,11.428559,7.807589,7.641667,7.641667,10.37134,9.31812 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,26.321996,25.293732,25.265051,25.265051,29.096076,29.277358 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,329.616817,329.616817,257.308444,257.308444,374.680137,400.251367 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,72.912612,72.912612,63.421465,63.421465,79.444676,90.3527 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,141.82421,141.82421,115.324972,115.324972,137.434808,160.808515 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,169.948771,169.948771,153.627804,153.627804,208.913151,230.606307 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,219.514623,219.514623,206.68461,206.68461,236.981813,259.508493 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,190.073335,190.073335,170.889703,170.889703,222.354379,200.130006 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,270.962289,270.962289,230.256891,230.256891,339.143226,403.594826 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,48.050755,48.050755,30.347488,30.347488,40.529058,38.032497 +OMP_NUM_THREADS=1 bt.aot,57.424035,52.257798,47.171533,47.171533,68.676444,60.887263 +OMP_NUM_THREADS=1 cg.aot,23.956185,22.446286,21.764883,21.764883,35.423631,39.586645 +OMP_NUM_THREADS=1 ep.aot,0.002449,0.001997,0.001011,0.001011,0.002848,0.001103 +OMP_NUM_THREADS=1 ft.aot,36.62239,38.08549,42.054578,42.054578,85.050462,88.49877 +OMP_NUM_THREADS=1 lu.aot,0.046617,0.041752,0.045795,0.045795,0.052249,0.049507 +OMP_NUM_THREADS=1 mg.aot,20.832592,17.917964,19.414119,19.414119,40.649036,41.412074 +OMP_NUM_THREADS=1 sp.aot,7.248053,3.601834,4.827026,4.827026,7.826959,7.191556 +OMP_NUM_THREADS=1 redis.aot,22.433107,8.16123,15.712845,15.712845,21.376499,23.684484 +a=b hdastar.aot maze-6404.txt 8,11.178987,7.449411,7.348959,7.348959,11.061452,11.532072 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,26.947609,25.74252,25.824146,25.824146,28.347634,27.93061 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,325.054915,325.054915,267.988911,267.988911,336.750211,406.071056 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,78.83731,78.83731,64.943422,64.943422,76.024603,84.064329 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,130.086382,130.086382,114.403351,114.403351,143.209377,168.316412 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,184.523923,184.523923,161.643572,161.643572,188.316515,256.275452 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,196.567903,196.567903,185.294063,185.294063,246.264065,252.684381 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,191.901375,191.901375,189.155775,189.155775,246.078941,220.652512 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,264.544209,264.544209,233.545047,233.545047,315.27784,373.977711 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,48.801216,48.801216,28.880913,28.880913,42.321601,37.29396 +OMP_NUM_THREADS=1 bt.aot,61.606888,45.946288,49.388428,49.388428,63.197976,58.418854 +OMP_NUM_THREADS=1 cg.aot,26.650049,20.655145,22.993191,22.993191,35.408235,39.709148 +OMP_NUM_THREADS=1 ep.aot,0.00244,0.001748,0.001824,0.001824,0.001379,0.000959 +OMP_NUM_THREADS=1 ft.aot,36.609956,41.063118,39.834432,39.834432,82.900716,86.396241 +OMP_NUM_THREADS=1 lu.aot,0.044621,0.03155,0.046682,0.046682,0.037211,0.042901 +OMP_NUM_THREADS=1 mg.aot,24.687424,19.267439,19.709943,19.709943,36.611072,45.20645 +OMP_NUM_THREADS=1 sp.aot,7.20248,4.016831,5.158459,5.158459,7.634931,7.725866 +OMP_NUM_THREADS=1 redis.aot,20.707256,7.970608,16.274266,16.274266,20.190021,23.832224 +a=b hdastar.aot maze-6404.txt 8,11.100112,6.938433,7.659034,7.659034,10.602706,9.321554 +OMP_NUM_THREADS=1 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,25.742684,25.567359,25.517804,25.517804,27.949099,28.69195 +OMP_NUM_THREADS=1 bc.aot -g20 -vn300,293.500437,293.500437,265.817801,265.817801,377.236796,400.615316 +OMP_NUM_THREADS=1 bfs.aot -g20 -vn300,77.43475,77.43475,65.200964,65.200964,80.541388,92.151348 +OMP_NUM_THREADS=1 cc.aot -g20 -vn300,134.298936,134.298936,112.990433,112.990433,132.663106,166.181747 +OMP_NUM_THREADS=1 cc_sv.aot -g20 -vn300,179.406628,179.406628,165.294943,165.294943,188.277157,259.328227 +OMP_NUM_THREADS=1 pr.aot -g20 -vn300,198.481549,198.481549,198.284859,198.284859,227.491134,254.426726 +OMP_NUM_THREADS=1 pr_spmv.aot -g20 -vn300,206.182164,206.182164,178.789799,178.789799,249.772134,197.579045 +OMP_NUM_THREADS=1 sssp.aot -g20 -vn300,258.329308,258.329308,238.914772,238.914772,299.423341,330.321472 +OMP_NUM_THREADS=1 tc.aot -g20 -n1,53.40175,53.40175,29.056049,29.056049,37.406897,40.278365 +OMP_NUM_THREADS=1 bt.aot,59.790527,51.5704,55.282739,55.282739,67.169513,55.411618 +OMP_NUM_THREADS=1 cg.aot,25.255956,21.090215,24.257374,24.257374,37.960099,39.776335 +OMP_NUM_THREADS=1 ep.aot,0.002944,0.000883,0.002147,0.002147,0.001377,0.002816 +OMP_NUM_THREADS=1 ft.aot,34.958844,41.600796,41.736728,41.736728,80.46322,80.244682 +OMP_NUM_THREADS=1 lu.aot,0.050619,0.028869,0.041997,0.041997,0.034423,0.048764 +OMP_NUM_THREADS=1 mg.aot,21.71718,18.232409,19.209119,19.209119,54.81343,39.817097 +OMP_NUM_THREADS=1 sp.aot,7.144054,3.065541,5.119661,5.119661,7.768602,7.098628 +OMP_NUM_THREADS=1 redis.aot,20.023443,8.288062,15.783689,15.783689,20.273333,24.003487 +a=b hdastar.aot maze-6404.txt 8,10.908282,6.086806,7.484129,7.484129,10.110525,10.370118 diff --git a/artifact/result/policy_multithread.csv b/artifact/result/policy_multithread.csv index de97499..4d0b561 100644 --- a/artifact/result/policy_multithread.csv +++ b/artifact/result/policy_multithread.csv @@ -1,58 +1,4 @@ name,aot,pure.aot,stack.aot,ckpt-every-dirty.aot,ckpt-loop.aot,ckpt-loop-dirty.aot -OMP_NUM_THREADS=4 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,10.017898,10.538071,9.551293,9.551293,52.572907,58.174687 -OMP_NUM_THREADS=4 bc.aot -g20 -vn300,231.541847,231.541847,197.232313,197.232313,1630.789125,1642.650659 -OMP_NUM_THREADS=4 bfs.aot -g20 -vn300,65.096905,65.096905,56.080233,56.080233,519.08394,512.712417 -OMP_NUM_THREADS=4 cc.aot -g20 -vn300,165.967726,165.967726,104.077259,104.077259,583.955076,637.09575 -OMP_NUM_THREADS=4 cc_sv.aot -g20 -vn300,185.382474,185.382474,129.455157,129.455157,873.077472,889.527948 -OMP_NUM_THREADS=4 pr.aot -g20 -vn300,59.505688,59.505688,51.44526,51.44526,801.815683,814.781761 -OMP_NUM_THREADS=4 pr_spmv.aot -g20 -vn300,78.739079,78.739079,64.305969,64.305969,932.059638,937.161274 -OMP_NUM_THREADS=4 sssp.aot -g20 -vn300,276.183438,276.183438,234.0212,234.0212,1042.837332,1086.634561 -OMP_NUM_THREADS=4 tc.aot -g20 -n1,39.949079,39.949079,22.501251,22.501251,161.282844,163.515375 -OMP_NUM_THREADS=4 bt.aot,70.475124,53.32907,59.691541,59.691541,130.768544,137.916229 -OMP_NUM_THREADS=4 cg.aot,32.625126,18.603542,18.894772,18.894772,206.37486,211.096798 -OMP_NUM_THREADS=4 ep.aot,0.003015,0.001876,0.002612,0.002612,0.005063,0.002794 -OMP_NUM_THREADS=4 ft.aot,16.043054,13.759922,14.225016,14.225016,155.341532,156.453344 -OMP_NUM_THREADS=4 lu.aot,0.039933,0.049057,0.035829,0.035829,0.1047,0.099759 -OMP_NUM_THREADS=4 mg.aot,29.936622,19.958747,20.884183,20.884183,106.603824,114.759174 -OMP_NUM_THREADS=4 sp.aot,33.832973,20.002695,22.167469,22.167469,70.783177,63.685357 -OMP_NUM_THREADS=4 redis.aot,57.495774,9.580163,18.098083,18.098083,77.271008,78.862054 -a=b hdastar.aot maze-6404.txt 8,10.9408,3.20139,5.495154,5.495154,11.946834,8.968433 -OMP_NUM_THREADS=4 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,11.285482,8.696805,8.719069,8.719069,45.587062,54.595998 -OMP_NUM_THREADS=4 bc.aot -g20 -vn300,228.180862,228.180862,196.644105,196.644105,1703.040742,1736.204013 -OMP_NUM_THREADS=4 bfs.aot -g20 -vn300,64.901881,64.901881,53.423697,53.423697,496.595615,518.28573 -OMP_NUM_THREADS=4 cc.aot -g20 -vn300,156.226125,156.226125,96.384282,96.384282,598.375946,595.620608 -OMP_NUM_THREADS=4 cc_sv.aot -g20 -vn300,172.1208,172.1208,117.084912,117.084912,838.12775,891.836542 -OMP_NUM_THREADS=4 pr.aot -g20 -vn300,59.804795,59.804795,48.629867,48.629867,742.457012,743.669954 -OMP_NUM_THREADS=4 pr_spmv.aot -g20 -vn300,80.962334,80.962334,61.994429,61.994429,980.537201,936.869386 -OMP_NUM_THREADS=4 sssp.aot -g20 -vn300,273.989241,273.989241,224.864193,224.864193,1064.527767,1067.949112 -OMP_NUM_THREADS=4 tc.aot -g20 -n1,39.78107,39.78107,22.121677,22.121677,166.89708,168.807898 -OMP_NUM_THREADS=4 bt.aot,81.000707,53.906011,59.455827,59.455827,132.262379,134.614112 -OMP_NUM_THREADS=4 cg.aot,26.566948,25.623014,17.822263,17.822263,208.72334,208.652902 -OMP_NUM_THREADS=4 ep.aot,0.004101,0.003475,0.003786,0.003786,0.005356,0.003773 -OMP_NUM_THREADS=4 ft.aot,15.002259,15.630616,14.760759,14.760759,158.338649,155.379575 -OMP_NUM_THREADS=4 lu.aot,0.062055,0.024446,0.0405,0.0405,0.099567,0.097056 -OMP_NUM_THREADS=4 mg.aot,30.585384,18.628778,18.124699,18.124699,114.088661,102.032073 -OMP_NUM_THREADS=4 sp.aot,40.105214,23.724932,27.745403,27.745403,65.620997,62.128954 -OMP_NUM_THREADS=4 redis.aot,56.354405,10.119493,17.909284,17.909284,77.499407,79.835904 -a=b hdastar.aot maze-6404.txt 8,9.35697,7.024824,6.778998,6.778998,10.939126,10.388784 -OMP_NUM_THREADS=4 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,11.876132,8.922248,9.69194,9.69194,47.601604,47.685453 -OMP_NUM_THREADS=4 bc.aot -g20 -vn300,214.770088,214.770088,200.993059,200.993059,1737.181198,1841.921895 -OMP_NUM_THREADS=4 bfs.aot -g20 -vn300,69.683795,69.683795,57.97691,57.97691,479.21154,497.166874 -OMP_NUM_THREADS=4 cc.aot -g20 -vn300,151.560553,151.560553,98.569124,98.569124,578.294962,604.293522 -OMP_NUM_THREADS=4 cc_sv.aot -g20 -vn300,171.754246,171.754246,116.552469,116.552469,856.158443,901.033594 -OMP_NUM_THREADS=4 pr.aot -g20 -vn300,55.452224,55.452224,52.557448,52.557448,756.836125,763.669305 -OMP_NUM_THREADS=4 pr_spmv.aot -g20 -vn300,65.320206,65.320206,56.402029,56.402029,960.368081,976.701841 -OMP_NUM_THREADS=4 sssp.aot -g20 -vn300,273.388615,273.388615,224.002082,224.002082,1134.207162,1189.01097 -OMP_NUM_THREADS=4 tc.aot -g20 -n1,30.579374,30.579374,22.442656,22.442656,28.126748,29.122663 -OMP_NUM_THREADS=4 bt.aot,74.62627,57.594137,53.934058,53.934058,64.171541,61.391608 -OMP_NUM_THREADS=4 cg.aot,21.262384,21.131603,20.910612,20.910612,35.209194,35.883791 -OMP_NUM_THREADS=4 ep.aot,0.002265,0.002804,0.002634,0.002634,0.002462,0.002571 -OMP_NUM_THREADS=4 ft.aot,14.439449,13.430229,14.243589,14.243589,24.267449,28.891808 -OMP_NUM_THREADS=4 lu.aot,0.054306,0.038539,0.03546,0.03546,0.051181,0.052417 -OMP_NUM_THREADS=4 mg.aot,17.88104,19.578546,21.113502,21.113502,26.102983,34.509171 -OMP_NUM_THREADS=4 sp.aot,24.318857,27.967577,21.065164,21.065164,24.113757,26.228236 -OMP_NUM_THREADS=4 redis.aot,22.92621,10.171869,17.93138,17.93138,22.818408,24.522828 -a=b hdastar.aot maze-6404.txt 8,9.343366,6.257246,7.95168,7.95168,8.826389,9.692145 OMP_NUM_THREADS=4 llama.aot stories110M.bin -z tokenizer.bin -t 0.0,9.777629,9.002316,8.278268,8.278268,11.776923,10.077228 OMP_NUM_THREADS=4 bc.aot -g20 -vn300,235.962264,235.962264,205.165808,205.165808,288.253252,341.204129 OMP_NUM_THREADS=4 bfs.aot -g20 -vn300,67.984061,67.984061,57.501841,57.501841,72.718786,89.771209 diff --git a/artifact/result/windows.csv b/artifact/result/windows.csv index 817eea9..b9729cd 100644 --- a/artifact/result/windows.csv +++ b/artifact/result/windows.csv @@ -1,81 +1,24 @@ name,mvvm,native -a=b linpack.aot,36.875728,25.089 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,760.961321,12.049 -OMP_NUM_THREADS=1 cg.aot,20.553871,96.003 -OMP_NUM_THREADS=1 ep.aot,0.000519,28.055 -OMP_NUM_THREADS=1 ft.aot,27.5285,10.057 -OMP_NUM_THREADS=1 lu.aot,0.023669,0.002 -OMP_NUM_THREADS=1 mg.aot,18.439463,24.097 -a=b redis.aot,34.938116,0.003 -a=b linpack.aot,36.463317,9.017 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,742.233683,0.051 -OMP_NUM_THREADS=1 cg.aot,21.159921,0.051 -OMP_NUM_THREADS=1 ep.aot,0.000514,26.001 -OMP_NUM_THREADS=1 ft.aot,27.590321,12.054 -OMP_NUM_THREADS=1 lu.aot,0.024134,97.0 -OMP_NUM_THREADS=1 mg.aot,18.545828,29.005 -a=b redis.aot,34.812165,10.071 -a=b linpack.aot,36.913629,0.002 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,748.680853,25.043 -OMP_NUM_THREADS=1 cg.aot,20.662478,0.003 -OMP_NUM_THREADS=1 ep.aot,0.000424,9.002 -OMP_NUM_THREADS=1 ft.aot,27.951032,0.051 -OMP_NUM_THREADS=1 lu.aot,0.022966,0.051 -OMP_NUM_THREADS=1 mg.aot,18.514203,25.003 -a=b redis.aot,34.982459,12.043 -a=b linpack.aot,36.834715,88.071 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,755.615254,27.05 -OMP_NUM_THREADS=1 cg.aot,20.635818,10.048 -OMP_NUM_THREADS=1 ep.aot,0.000407,0.003 -OMP_NUM_THREADS=1 ft.aot,27.45233,23.062 -OMP_NUM_THREADS=1 lu.aot,0.023021,0.003 -OMP_NUM_THREADS=1 mg.aot,18.777736,9.004 -a=b redis.aot,34.910377,0.053 -a=b linpack.aot,36.670241,0.053 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,754.313282,25.04 -OMP_NUM_THREADS=1 cg.aot,20.773552,12.042 -OMP_NUM_THREADS=1 ep.aot,0.000427,87.076 -OMP_NUM_THREADS=1 ft.aot,27.558167,27.045 -OMP_NUM_THREADS=1 lu.aot,0.023717,10.042 -OMP_NUM_THREADS=1 mg.aot,18.574712,0.002 -a=b redis.aot,34.847002,23.079 -a=b linpack.aot,37.00937,0.003 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,799.227787,9.003 -OMP_NUM_THREADS=1 cg.aot,24.116978,0.052 -OMP_NUM_THREADS=1 ep.aot,0.000501,0.052 -OMP_NUM_THREADS=1 ft.aot,28.097015,25.016 -OMP_NUM_THREADS=1 lu.aot,0.022781,12.041 -OMP_NUM_THREADS=1 mg.aot,18.495219,89.088 -a=b redis.aot,35.798685,27.058 -a=b linpack.aot,36.814429,10.046 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,743.609241,0.002 -OMP_NUM_THREADS=1 cg.aot,21.472738,24.009 -OMP_NUM_THREADS=1 ep.aot,0.000507,0.003 -OMP_NUM_THREADS=1 ft.aot,27.901536,9.011 -OMP_NUM_THREADS=1 lu.aot,0.022625,0.052 -OMP_NUM_THREADS=1 mg.aot,18.491945,0.052 -a=b redis.aot,35.126543,26.035 -a=b linpack.aot,37.132155,12.028 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,762.204546,83.044 -OMP_NUM_THREADS=1 cg.aot,23.295101,27.082 -OMP_NUM_THREADS=1 ep.aot,0.000545,10.056 -OMP_NUM_THREADS=1 ft.aot,37.508713,0.002 -OMP_NUM_THREADS=1 lu.aot,0.024291,27.004 -OMP_NUM_THREADS=1 mg.aot,19.495638,0.003 -a=b redis.aot,36.892017,9.007 -a=b linpack.aot,19.805608,0.052 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,785.371629,7.09 -OMP_NUM_THREADS=1 cg.aot,20.722234,25.097 -OMP_NUM_THREADS=1 ep.aot,0.000427,12.047 -OMP_NUM_THREADS=1 ft.aot,27.942502,86.088 -OMP_NUM_THREADS=1 lu.aot,0.023177,27.04 -OMP_NUM_THREADS=1 mg.aot,18.482471,10.044 -a=b redis.aot,35.381083,0.002 -a=b linpack.aot,37.148041,24.065 -a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,757.206547,0.003 -OMP_NUM_THREADS=1 cg.aot,20.886888,9.018 -OMP_NUM_THREADS=1 ep.aot,0.000421,0.053 -OMP_NUM_THREADS=1 ft.aot,27.930926,0.017 -OMP_NUM_THREADS=1 lu.aot,0.022977,25.085 -OMP_NUM_THREADS=1 mg.aot,18.825622,12.038 -a=b redis.aot,37.090249,86.066 +a=b linpack-stack.aot,22.375226,26.06 +OMP_NUM_THREADS=1 llama-stack.aot stories110M.bin -z tokenizer.bin -t 0.0,13.907481,12.062 +a=b rgbd_tum-stack.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,195.641854,91.005 +OMP_NUM_THREADS=1 bt-stack.aot,44.273104,150.008 +OMP_NUM_THREADS=1 cg-stack.aot,20.147779,65.097 +OMP_NUM_THREADS=1 ep-stack.aot,0.000259,0.029 +OMP_NUM_THREADS=1 ft-stack.aot,27.976403,138.086 +OMP_NUM_THREADS=1 lu-stack.aot,0.015354,0.013 +OMP_NUM_THREADS=1 mg-stack.aot,15.557569,57.002 +OMP_NUM_THREADS=1 sp-stack.aot,4.120332,0.054 +a=b redis-stack.aot,12.275519,128.018 +a=b linpack-stack.aot,39.574689,27.097 +OMP_NUM_THREADS=1 llama-stack.aot stories110M.bin -z tokenizer.bin -t 0.0,13.067252,13.001 +a=b rgbd_tum-stack.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt,181.33331,102.06 +OMP_NUM_THREADS=1 bt-stack.aot,41.422482,165.071 +OMP_NUM_THREADS=1 cg-stack.aot,20.387558,68.007 +OMP_NUM_THREADS=1 ep-stack.aot,0.000308,0.029 +OMP_NUM_THREADS=1 ft-stack.aot,28.016912,131.074 +OMP_NUM_THREADS=1 lu-stack.aot,0.015908,0.01 +OMP_NUM_THREADS=1 mg-stack.aot,15.597774,58.0 +OMP_NUM_THREADS=1 sp-stack.aot,4.21897,0.057 +a=b redis-stack.aot,12.718634,130.03 + diff --git a/artifact/result/windows.pdf b/artifact/result/windows.pdf index f2f8e9c..79d0f2c 100644 Binary files a/artifact/result/windows.pdf and b/artifact/result/windows.pdf differ diff --git a/artifact/usecase_burst_computing.py b/artifact/usecase_burst_computing.py index 75a389e..ff67531 100644 --- a/artifact/usecase_burst_computing.py +++ b/artifact/usecase_burst_computing.py @@ -16,18 +16,18 @@ new_port12 = 14440 cmd = [ "redis", # low priority task - "redis", # high priority task + "rgbd_tum", # high priority task ] folder = [ "redis", - "redis", # frame per cents + "ORB_SLAM2", # frame per cents ] arg = [ [], [ "./ORBvoc.txt", "./TUM3.yaml", - "./rgbd_dataset_freiburg3_long_office_household_validation", + "./", "./associations/fr3_office_val.txt", ], ] @@ -311,7 +311,7 @@ def plot_time(reu, aot_energy, aot_ps, aot1_energy, aot1_ps): time_spots1.append(new_time_spot) time_spots1.pop(to_pop) if idx != len(exec_time1) - 1: - time_spots1.append(time[idx + 6] - sum(exec_time1[idx+1]) - base) + time_spots1.append(time[idx + 6] - sum(exec_time1[idx + 1]) - base) avg_extended, percentile99_extended = get_avg_99percent(sum_aot) avg_exec_time1, percentile_99_exec_time1 = get_avg_99percent(sum_aot1) ax.plot(time_spots, avg_extended, "blue") @@ -358,9 +358,7 @@ def plot_time(reu, aot_energy, aot_ps, aot1_energy, aot1_ps): for line in aot: try: if line.__contains__("2024"): - exec_time_aot1.append( - parse_time_no_msec(line.split(" ")[3]) - 10 - ) + exec_time_aot1.append(parse_time_no_msec(line.split(" ")[3]) - 10) cpu.append(0) memory.append(0) # print(exec_time) @@ -435,84 +433,76 @@ def plot_time(reu, aot_energy, aot_ps, aot1_energy, aot1_ps): # print("slowtier = ", slowtier) # snapshot = get_snapshot_overhead() # print("snapshot = ", snapshot) - # plot skew + # # plot skew # write_to_csv("burst_computing.csv") # results = read_from_csv("burst_computing.csv") # plot(results) - # reu = get_burst_compute() - cmd = f"cat ./MVVM_checkpoint.0.out ./MVVM_restore.0.out ./MVVM_restore.1.out ./MVVM_restore.2.out ./MVVM_restore.3.out ./MVVM_checkpoint.1.out ./MVVM_restore.4.out ./MVVM_restore.5.out ./MVVM_restore.6.out" - cmd = cmd.split() - result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - try: - output = result.stdout.decode("utf-8") - except: - output = result.stdout - reu = output + reu = get_burst_compute() # reu="" with open("burst.txt", "w") as f: f.write(str(reu)) - # reu = "" - # with open("burst.txt", "r") as f: - # reu = f.read() - # with open("MVVM_checkpoint.ps.1.out") as f: - # checkpoint1 = f.read() - # with open("MVVM_checkpoint.ps.out") as f: - # checkpoint = f.read() - # with open("MVVM_restore.ps.6.out") as f: - # restore6 = f.read() - # with open("MVVM_restore.ps.5.out") as f: - # restore5 = f.read() - # with open("MVVM_restore.ps.4.out") as f: - # restore4 = f.read() - # with open("MVVM_restore.ps.3.out") as f: - # restore3 = f.read() - # with open("MVVM_restore.ps.2.out") as f: - # restore2 = f.read() - # with open("MVVM_restore.ps.1.out") as f: - # restore1 = f.read() - # with open("MVVM_restore.ps.out") as f: - # restore = f.read() - - # with open("MVVM_checkpoint.energy.1.out") as f: - # checkpoint_energy1 = f.read() - # with open("MVVM_checkpoint.energy.out") as f: - # checkpoint_energy = f.read() - # with open("MVVM_restore.energy.6.out") as f: - # restore_energy6 = f.read() - # with open("MVVM_restore.energy.5.out") as f: - # restore_energy5 = f.read() - # with open("MVVM_restore.energy.4.out") as f: - # restore_energy4 = f.read() - # with open("MVVM_restore.energy.3.out") as f: - # restore_energy3 = f.read() - # with open("MVVM_restore.energy.2.out") as f: - # restore_energy2 = f.read() - # with open("MVVM_restore.energy.1.out") as f: - # restore_energy1 = f.read() - # with open("MVVM_restore.energy.out") as f: - # restore_energy = f.read() + reu = "" + with open("burst.txt", "r") as f: + reu = f.read() + with open("MVVM_checkpoint.ps.1.out") as f: + checkpoint1 = f.read() + with open("MVVM_checkpoint.ps.out") as f: + checkpoint = f.read() + with open("MVVM_restore.ps.6.out") as f: + restore6 = f.read() + with open("MVVM_restore.ps.5.out") as f: + restore5 = f.read() + with open("MVVM_restore.ps.4.out") as f: + restore4 = f.read() + with open("MVVM_restore.ps.3.out") as f: + restore3 = f.read() + with open("MVVM_restore.ps.2.out") as f: + restore2 = f.read() + with open("MVVM_restore.ps.1.out") as f: + restore1 = f.read() + with open("MVVM_restore.ps.out") as f: + restore = f.read() + + with open("MVVM_checkpoint.energy.1.out") as f: + checkpoint_energy1 = f.read() + with open("MVVM_checkpoint.energy.out") as f: + checkpoint_energy = f.read() + with open("MVVM_restore.energy.6.out") as f: + restore_energy6 = f.read() + with open("MVVM_restore.energy.5.out") as f: + restore_energy5 = f.read() + with open("MVVM_restore.energy.4.out") as f: + restore_energy4 = f.read() + with open("MVVM_restore.energy.3.out") as f: + restore_energy3 = f.read() + with open("MVVM_restore.energy.2.out") as f: + restore_energy2 = f.read() + with open("MVVM_restore.energy.1.out") as f: + restore_energy1 = f.read() + with open("MVVM_restore.energy.out") as f: + restore_energy = f.read() plot_time( reu, - None, - None, - None, - None, - # [ - # checkpoint_energy, - # restore_energy, - # restore_energy1, - # restore_energy3, - # restore_energy2, - # ], - # [checkpoint1, restore3, restore4, restore5, restore6], - # [ - # checkpoint_energy1, - # restore_energy3, - # restore_energy4, - # restore_energy5, - # restore_energy6, - # ], - # [checkpoint1, restore3, restore4, restore5, restore6], + # None, + # None, + # None, + # None, + [ + checkpoint_energy, + restore_energy, + restore_energy1, + restore_energy3, + restore_energy2, + ], + [checkpoint1, restore3, restore4, restore5, restore6], + [ + checkpoint_energy1, + restore_energy3, + restore_energy4, + restore_energy5, + restore_energy6, + ], + [checkpoint1, restore3, restore4, restore5, restore6], ) diff --git a/artifact/usecase_optimistic_computing.py b/artifact/usecase_optimistic_computing.py index 11a02d0..f246f96 100644 --- a/artifact/usecase_optimistic_computing.py +++ b/artifact/usecase_optimistic_computing.py @@ -365,9 +365,9 @@ def plot_time(reu, checkpoint, checkpoint1, restore, restore1): avg_extended, percentile99_extended = get_avg_99percent(exec_time[1] + exec_time[2] + exec_time[3]) avg_exec_time1, percentile_99_exec_time1 = get_avg_99percent(exec_time[0]) ax.plot(time_spots, avg_extended, "blue") - # ax.plot(time_spots, percentile99_extended, color="purple", linestyle="--") + ax.plot(time_spots, percentile99_extended, color="purple", linestyle="--") ax.plot(time_spots2, avg_exec_time1, "r") - # ax.plot(time_spots2, percentile_99_exec_time1, color="pink", linestyle="--") + ax.plot(time_spots2, percentile_99_exec_time1, color="pink", linestyle="--") ax.set_xlabel("Time (s)") ax.set_ylabel("Average Trial Time (s)") plt.savefig("optimistic.pdf") @@ -482,9 +482,9 @@ def plot_time(reu, checkpoint, checkpoint1, restore, restore1): # # plot skew # write_to_csv("optimisitc_computing.csv") - results = read_from_csv("optimistic_computing.csv") + # results = read_from_csv("optimistic_computing.csv") - plot(results) + # plot(results) # reu = get_optimiztic_compute_overhead() # with open("optimistic.txt", "w") as f: # f.write(str(reu)) diff --git a/bench/CMakeLists.txt b/bench/CMakeLists.txt index 8c47c54..a33c30a 100644 --- a/bench/CMakeLists.txt +++ b/bench/CMakeLists.txt @@ -9,70 +9,70 @@ else () endif () include(ExternalProject) -ExternalProject_Add(ORB_SLAM2 - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ORB_SLAM2 - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -DCMAKE_BUILD_TYPE=Release - -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} - -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake - -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/ORB_SLAM2 - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./rgbd_tum ${CMAKE_CURRENT_BINARY_DIR}/rgbd_tum.wasm -) -ExternalProject_Add(ORB_SLAM2-native - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ORB_SLAM2 - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -DCMAKE_BUILD_TYPE=Release - -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} - ${CMAKE_CURRENT_SOURCE_DIR}/ORB_SLAM2 - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./rgbd_tum ${CMAKE_CURRENT_BINARY_DIR}/rgbd_tum -) -ExternalProject_Add(gapbs - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gapbs - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -DCMAKE_BUILD_TYPE=Release - -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} - -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake - -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/gapbs - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./bc ${CMAKE_CURRENT_BINARY_DIR}/bc.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./bfs ${CMAKE_CURRENT_BINARY_DIR}/bfs.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./cc ${CMAKE_CURRENT_BINARY_DIR}/cc.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./cc_sv ${CMAKE_CURRENT_BINARY_DIR}/cc_sv.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./converter ${CMAKE_CURRENT_BINARY_DIR}/converter.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./pr ${CMAKE_CURRENT_BINARY_DIR}/pr.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./pr_spmv ${CMAKE_CURRENT_BINARY_DIR}/pr_spmv.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./sssp ${CMAKE_CURRENT_BINARY_DIR}/sssp.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./tc ${CMAKE_CURRENT_BINARY_DIR}/tc.wasm -) -ExternalProject_Add(gapbs-native - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gapbs - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -DCMAKE_BUILD_TYPE=Release - -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} - ${CMAKE_CURRENT_SOURCE_DIR}/gapbs - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./bc ${CMAKE_CURRENT_BINARY_DIR}/bc && - ${CMAKE_COMMAND} -E copy_if_different ./bfs ${CMAKE_CURRENT_BINARY_DIR}/bfs && - ${CMAKE_COMMAND} -E copy_if_different ./cc ${CMAKE_CURRENT_BINARY_DIR}/cc && - ${CMAKE_COMMAND} -E copy_if_different ./cc_sv ${CMAKE_CURRENT_BINARY_DIR}/cc_sv && - ${CMAKE_COMMAND} -E copy_if_different ./converter ${CMAKE_CURRENT_BINARY_DIR}/converter && - ${CMAKE_COMMAND} -E copy_if_different ./pr ${CMAKE_CURRENT_BINARY_DIR}/pr && - ${CMAKE_COMMAND} -E copy_if_different ./pr_spmv ${CMAKE_CURRENT_BINARY_DIR}/pr_spmv && - ${CMAKE_COMMAND} -E copy_if_different ./sssp ${CMAKE_CURRENT_BINARY_DIR}/sssp && - ${CMAKE_COMMAND} -E copy_if_different ./tc ${CMAKE_CURRENT_BINARY_DIR}/tc -) +# ExternalProject_Add(ORB_SLAM2 +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ORB_SLAM2 +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -DCMAKE_BUILD_TYPE=Release +# -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} +# -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake +# -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 +# ${CMAKE_CURRENT_SOURCE_DIR}/ORB_SLAM2 +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./rgbd_tum ${CMAKE_CURRENT_BINARY_DIR}/rgbd_tum.wasm +# ) +# ExternalProject_Add(ORB_SLAM2-native +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ORB_SLAM2 +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -DCMAKE_BUILD_TYPE=Release +# -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} +# ${CMAKE_CURRENT_SOURCE_DIR}/ORB_SLAM2 +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./rgbd_tum ${CMAKE_CURRENT_BINARY_DIR}/rgbd_tum +# ) + ExternalProject_Add(gapbs + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gapbs + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND ${CMAKE_COMMAND} + -DCMAKE_BUILD_TYPE=Release + -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} + -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake + -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 + ${CMAKE_CURRENT_SOURCE_DIR}/gapbs + BUILD_COMMAND ${CMAKE_COMMAND} --build . + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./bc ${CMAKE_CURRENT_BINARY_DIR}/bc.wasm && + ${CMAKE_COMMAND} -E copy_if_different ./bfs ${CMAKE_CURRENT_BINARY_DIR}/bfs.wasm && + ${CMAKE_COMMAND} -E copy_if_different ./cc ${CMAKE_CURRENT_BINARY_DIR}/cc.wasm && + ${CMAKE_COMMAND} -E copy_if_different ./cc_sv ${CMAKE_CURRENT_BINARY_DIR}/cc_sv.wasm && + ${CMAKE_COMMAND} -E copy_if_different ./converter ${CMAKE_CURRENT_BINARY_DIR}/converter.wasm && + ${CMAKE_COMMAND} -E copy_if_different ./pr ${CMAKE_CURRENT_BINARY_DIR}/pr.wasm && + ${CMAKE_COMMAND} -E copy_if_different ./pr_spmv ${CMAKE_CURRENT_BINARY_DIR}/pr_spmv.wasm && + ${CMAKE_COMMAND} -E copy_if_different ./sssp ${CMAKE_CURRENT_BINARY_DIR}/sssp.wasm && + ${CMAKE_COMMAND} -E copy_if_different ./tc ${CMAKE_CURRENT_BINARY_DIR}/tc.wasm + ) +# ExternalProject_Add(gapbs-native +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gapbs +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -DCMAKE_BUILD_TYPE=Release +# -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} +# ${CMAKE_CURRENT_SOURCE_DIR}/gapbs +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./bc ${CMAKE_CURRENT_BINARY_DIR}/bc && +# ${CMAKE_COMMAND} -E copy_if_different ./bfs ${CMAKE_CURRENT_BINARY_DIR}/bfs && +# ${CMAKE_COMMAND} -E copy_if_different ./cc ${CMAKE_CURRENT_BINARY_DIR}/cc && +# ${CMAKE_COMMAND} -E copy_if_different ./cc_sv ${CMAKE_CURRENT_BINARY_DIR}/cc_sv && +# ${CMAKE_COMMAND} -E copy_if_different ./converter ${CMAKE_CURRENT_BINARY_DIR}/converter && +# ${CMAKE_COMMAND} -E copy_if_different ./pr ${CMAKE_CURRENT_BINARY_DIR}/pr && +# ${CMAKE_COMMAND} -E copy_if_different ./pr_spmv ${CMAKE_CURRENT_BINARY_DIR}/pr_spmv && +# ${CMAKE_COMMAND} -E copy_if_different ./sssp ${CMAKE_CURRENT_BINARY_DIR}/sssp && +# ${CMAKE_COMMAND} -E copy_if_different ./tc ${CMAKE_CURRENT_BINARY_DIR}/tc +# ) ExternalProject_Add(redis SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/redis UPDATE_COMMAND "" @@ -97,125 +97,125 @@ ExternalProject_Add(gapbs-native BUILD_COMMAND ${CMAKE_COMMAND} --build . INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./redis ${CMAKE_CURRENT_BINARY_DIR}/redis ) -ExternalProject_Add(ftp - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ftp - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -DCMAKE_BUILD_TYPE=Release - -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} - -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk.cmake - -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/ftp - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./dataServer ${CMAKE_CURRENT_BINARY_DIR}/dataServer.wasm && ${CMAKE_COMMAND} -E copy_if_different ./remoteClient ${CMAKE_CURRENT_BINARY_DIR}/remoteClient.wasm -) -ExternalProject_Add(nas - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nas - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -DCMAKE_BUILD_TYPE=Release - -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} - -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake - -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/nas - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./bt ${CMAKE_CURRENT_BINARY_DIR}/bt.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./cg ${CMAKE_CURRENT_BINARY_DIR}/cg.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./ep ${CMAKE_CURRENT_BINARY_DIR}/ep.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./ft ${CMAKE_CURRENT_BINARY_DIR}/ft.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./lu ${CMAKE_CURRENT_BINARY_DIR}/lu.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./mg ${CMAKE_CURRENT_BINARY_DIR}/mg.wasm && - ${CMAKE_COMMAND} -E copy_if_different ./sp ${CMAKE_CURRENT_BINARY_DIR}/sp.wasm -) -ExternalProject_Add(nas-native - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nas - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -DCMAKE_BUILD_TYPE=Release - -GNinja -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/nas - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./bt ${CMAKE_CURRENT_BINARY_DIR}/bt && - ${CMAKE_COMMAND} -E copy_if_different ./cg ${CMAKE_CURRENT_BINARY_DIR}/cg && - ${CMAKE_COMMAND} -E copy_if_different ./ep ${CMAKE_CURRENT_BINARY_DIR}/ep && - ${CMAKE_COMMAND} -E copy_if_different ./ft ${CMAKE_CURRENT_BINARY_DIR}/ft && - ${CMAKE_COMMAND} -E copy_if_different ./lu ${CMAKE_CURRENT_BINARY_DIR}/lu && - ${CMAKE_COMMAND} -E copy_if_different ./mg ${CMAKE_CURRENT_BINARY_DIR}/mg && - ${CMAKE_COMMAND} -E copy_if_different ./sp ${CMAKE_CURRENT_BINARY_DIR}/sp -) -ExternalProject_Add(llama - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llama - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} - -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/llama - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./llama ${CMAKE_CURRENT_BINARY_DIR}/llama.wasm -) -ExternalProject_Add(llama-native - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llama - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -GNinja -DCMAKE_BUILD_TYPE=Release - ${CMAKE_CURRENT_SOURCE_DIR}/llama - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./llama ${CMAKE_CURRENT_BINARY_DIR}/llama -) -ExternalProject_Add(linpack - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/linpack - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} - -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk.cmake - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/linpack - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./linpack ${CMAKE_CURRENT_BINARY_DIR}/linpack.wasm -) -ExternalProject_Add(linpack-native - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/linpack - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/linpack - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./linpack ${CMAKE_CURRENT_BINARY_DIR}/linpack -) -ExternalProject_Add(hdastar - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hdastar - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} - -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/hdastar - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./hw5 ${CMAKE_CURRENT_BINARY_DIR}/hdastar.wasm -) -ExternalProject_Add(hdastar-native - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hdastar - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${CMAKE_COMMAND} - -GNinja -DCMAKE_BUILD_TYPE=Release - -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 - ${CMAKE_CURRENT_SOURCE_DIR}/hdastar - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./hw5 ${CMAKE_CURRENT_BINARY_DIR}/hdastar -) +# ExternalProject_Add(ftp +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ftp +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -DCMAKE_BUILD_TYPE=Release +# -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} +# -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk.cmake +# -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 +# ${CMAKE_CURRENT_SOURCE_DIR}/ftp +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./dataServer ${CMAKE_CURRENT_BINARY_DIR}/dataServer.wasm && ${CMAKE_COMMAND} -E copy_if_different ./remoteClient ${CMAKE_CURRENT_BINARY_DIR}/remoteClient.wasm +# ) +# ExternalProject_Add(nas +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nas +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -DCMAKE_BUILD_TYPE=Release +# -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} +# -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake +# -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 +# ${CMAKE_CURRENT_SOURCE_DIR}/nas +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./bt ${CMAKE_CURRENT_BINARY_DIR}/bt.wasm && +# ${CMAKE_COMMAND} -E copy_if_different ./cg ${CMAKE_CURRENT_BINARY_DIR}/cg.wasm && +# ${CMAKE_COMMAND} -E copy_if_different ./ep ${CMAKE_CURRENT_BINARY_DIR}/ep.wasm && +# ${CMAKE_COMMAND} -E copy_if_different ./ft ${CMAKE_CURRENT_BINARY_DIR}/ft.wasm && +# ${CMAKE_COMMAND} -E copy_if_different ./lu ${CMAKE_CURRENT_BINARY_DIR}/lu.wasm && +# ${CMAKE_COMMAND} -E copy_if_different ./mg ${CMAKE_CURRENT_BINARY_DIR}/mg.wasm && +# ${CMAKE_COMMAND} -E copy_if_different ./sp ${CMAKE_CURRENT_BINARY_DIR}/sp.wasm +# ) +# ExternalProject_Add(nas-native +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nas +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -DCMAKE_BUILD_TYPE=Release +# -GNinja -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 +# ${CMAKE_CURRENT_SOURCE_DIR}/nas +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./bt ${CMAKE_CURRENT_BINARY_DIR}/bt && +# ${CMAKE_COMMAND} -E copy_if_different ./cg ${CMAKE_CURRENT_BINARY_DIR}/cg && +# ${CMAKE_COMMAND} -E copy_if_different ./ep ${CMAKE_CURRENT_BINARY_DIR}/ep && +# ${CMAKE_COMMAND} -E copy_if_different ./ft ${CMAKE_CURRENT_BINARY_DIR}/ft && +# ${CMAKE_COMMAND} -E copy_if_different ./lu ${CMAKE_CURRENT_BINARY_DIR}/lu && +# ${CMAKE_COMMAND} -E copy_if_different ./mg ${CMAKE_CURRENT_BINARY_DIR}/mg && +# ${CMAKE_COMMAND} -E copy_if_different ./sp ${CMAKE_CURRENT_BINARY_DIR}/sp +# ) +# ExternalProject_Add(llama +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llama +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} +# -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake +# -DCMAKE_BUILD_TYPE=Release +# -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 +# ${CMAKE_CURRENT_SOURCE_DIR}/llama +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./llama ${CMAKE_CURRENT_BINARY_DIR}/llama.wasm +# ) +# ExternalProject_Add(llama-native +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llama +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -GNinja -DCMAKE_BUILD_TYPE=Release +# ${CMAKE_CURRENT_SOURCE_DIR}/llama +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./llama ${CMAKE_CURRENT_BINARY_DIR}/llama +# ) +# ExternalProject_Add(linpack +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/linpack +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} +# -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk.cmake +# -DCMAKE_BUILD_TYPE=Release +# -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 +# ${CMAKE_CURRENT_SOURCE_DIR}/linpack +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./linpack ${CMAKE_CURRENT_BINARY_DIR}/linpack.wasm +# ) +# ExternalProject_Add(linpack-native +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/linpack +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 +# ${CMAKE_CURRENT_SOURCE_DIR}/linpack +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./linpack ${CMAKE_CURRENT_BINARY_DIR}/linpack +# ) +# ExternalProject_Add(hdastar +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hdastar +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -GNinja -DWASI_SDK_DIR=${WASI_SDK} -DWASI_SDK_PREFIX=${WASI_SDK} +# -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK}/share/cmake/wasi-sdk-pthread.cmake +# -DCMAKE_BUILD_TYPE=Release +# -DCMAKE_SYSROOT=${WASI_SDK}/share/wasi-sysroot -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 +# ${CMAKE_CURRENT_SOURCE_DIR}/hdastar +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./hw5 ${CMAKE_CURRENT_BINARY_DIR}/hdastar.wasm +# ) +# ExternalProject_Add(hdastar-native +# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hdastar +# UPDATE_COMMAND "" +# PATCH_COMMAND "" +# CONFIGURE_COMMAND ${CMAKE_COMMAND} +# -GNinja -DCMAKE_BUILD_TYPE=Release +# -DCMAKE_C_COMPILER_WORK=1 -DCMAKE_CXX_COMPILER_WORK=1 +# ${CMAKE_CURRENT_SOURCE_DIR}/hdastar +# BUILD_COMMAND ${CMAKE_COMMAND} --build . +# INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ./hw5 ${CMAKE_CURRENT_BINARY_DIR}/hdastar +# ) if (WAMR_BUILD_AOT) function(bench_wamr_app input) @@ -249,11 +249,47 @@ if (WAMR_BUILD_AOT) ) add_custom_target(${input}_ckpt_loop_dirty_compile ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-dirty.aot) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-every-dirty.aot - COMMAND ${CMAKE_SOURCE_DIR}/lib/wasm-micro-runtime/wamr-compiler/build/wamrc --disable-aux-stack-check --enable-every-checkpoint --enable-aux-stack-dirty-bit -o ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-every-dirty.aot ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-30.aot + COMMAND ${CMAKE_SOURCE_DIR}/lib/wasm-micro-runtime/wamr-compiler/build/wamrc --threshold-bits=30 --disable-aux-stack-check --enable-counter-loop-checkpoint -o ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-30.aot ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm ) - add_custom_target(${input}_ckpt_every_dirty_compile DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-every-dirty.aot) + add_custom_target(${input}_ckpt_loop_counter_compile_30 ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-30.aot) + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-20.aot + COMMAND ${CMAKE_SOURCE_DIR}/lib/wasm-micro-runtime/wamr-compiler/build/wamrc --threshold-bits=20 --disable-aux-stack-check --enable-counter-loop-checkpoint -o ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-20.aot ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + ) + add_custom_target(${input}_ckpt_loop_counter_compile_20 ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-20.aot) + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-16.aot + COMMAND ${CMAKE_SOURCE_DIR}/lib/wasm-micro-runtime/wamr-compiler/build/wamrc --threshold-bits=16 --disable-aux-stack-check --enable-counter-loop-checkpoint -o ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-16.aot ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + ) + add_custom_target(${input}_ckpt_loop_counter_compile_16 ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-16.aot) + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-8.aot + COMMAND ${CMAKE_SOURCE_DIR}/lib/wasm-micro-runtime/wamr-compiler/build/wamrc --threshold-bits=8 --disable-aux-stack-check --enable-counter-loop-checkpoint -o ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-8.aot ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + ) + add_custom_target(${input}_ckpt_loop_counter_compile_8 ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-8.aot) + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-4.aot + COMMAND ${CMAKE_SOURCE_DIR}/lib/wasm-micro-runtime/wamr-compiler/build/wamrc --threshold-bits=4 --disable-aux-stack-check --enable-counter-loop-checkpoint -o ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-4.aot ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + ) + add_custom_target(${input}_ckpt_loop_counter_compile_4 ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-4.aot) + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-1.aot + COMMAND ${CMAKE_SOURCE_DIR}/lib/wasm-micro-runtime/wamr-compiler/build/wamrc --threshold-bits=1 --disable-aux-stack-check --enable-counter-loop-checkpoint -o ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-1.aot ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + ) + add_custom_target(${input}_ckpt_loop_counter_compile_1 ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-counter-1.aot) + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-pgo.aot + COMMAND ${CMAKE_SOURCE_DIR}/lib/wasm-micro-runtime/wamr-compiler/build/wamrc --enable-checkpoint-pgo --disable-aux-stack-check --enable-loop-checkpoint -o ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-pgo.aot ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}.wasm +) +add_custom_target(${input}_ckpt_loop_pgo ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${input}-ckpt-loop-pgo.aot) add_test(NAME bench_${input}_checkpoint COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../MVVM_checkpoint --target ${CMAKE_CURRENT_BINARY_DIR}/${input}.aot) add_test(NAME bench_${input}_restore COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../MVVM_restore --target ${CMAKE_CURRENT_BINARY_DIR}/${input}.aot) diff --git a/src/profile.cpp b/src/profile.cpp index 7be0757..d032cb4 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -44,8 +44,8 @@ void unwind(WASMExecEnv *instance) { } stack_record.emplace_back(stack); } - -void profile_sigint_handler(int sig) { wamr->replace_nop_with_int3(); } +void profile_register_sigtrap(); +void profile_sigfault_handler(int sig) { usleep(100); } void profile_sigtrap_handler(int sig) { auto exec_env = wamr->get_exec_env(); @@ -54,18 +54,46 @@ void profile_sigtrap_handler(int sig) { } void profile_register_sigtrap() { +#if defined(_WIN32) + signal(SIGILL, sigtrap_handler); + SPDLOG_DEBUG("SIGILL registered"); +#else struct sigaction sa {}; sigemptyset(&sa.sa_mask); sa.sa_handler = profile_sigtrap_handler; sa.sa_flags = SA_RESTART; + struct sigaction sb {}; + sigemptyset(&sb.sa_mask); + sb.sa_handler = profile_sigfault_handler; + sb.sa_flags = SA_RESTART; + // Register the signal handler for SIGTRAP if (sigaction(SIGTRAP, &sa, nullptr) == -1) { SPDLOG_ERROR("Error: cannot handle SIGTRAP"); exit(-1); + } else { + if (sigaction(SIGSYS, &sa, nullptr) == -1) { + SPDLOG_ERROR("Error: cannot handle SIGSYS"); + exit(-1); + } else { + if (sigaction(SIGSEGV, &sb, nullptr) == -1) { + SPDLOG_ERROR("Error: cannot handle SIGSEGV"); + exit(-1); + } else { + SPDLOG_DEBUG("SIGSEGV registered"); + } + SPDLOG_DEBUG("SIGSYS registered"); + } + SPDLOG_DEBUG("SIGTRAP registered"); } +#endif +} +void profile_sigint_handler(int sig) { + wamr->int3_ul = std::unique_lock(wamr->int3_mtx); + wamr->replace_nop_with_int3(); + wamr->int3_cv.notify_all(); } - void profile_register_sigint() { struct sigaction sa {}; sigemptyset(&sa.sa_mask); @@ -209,7 +237,7 @@ int main(int argc, char *argv[]) { for (const auto &e : func_count) { func_idx.emplace_back(e.first); } - auto get_func_name = "python3 /workspaces/MVVM/artifact/get_func_name.py " + wasm_file; + auto get_func_name = "python3 ../artifact/get_func_name.py " + wasm_file; for (const auto &e : func_idx) { get_func_name += " " + std::to_string(e); } diff --git a/src/wamr.cpp b/src/wamr.cpp index f5d5c33..10397ac 100644 --- a/src/wamr.cpp +++ b/src/wamr.cpp @@ -521,8 +521,8 @@ void WAMRInstance::recover(std::vector> *e_) { // invoke_init_c(); #if WASM_ENABLE_LIB_PTHREAD != 0 - SPDLOG_ERROR("no impl"); - exit(-1); + // SPDLOG_ERROR("no impl"); + // exit(-1); spawn_child(main_env, true); #endif // restart main thread execution @@ -967,6 +967,10 @@ void serialize_to_file(WASMExecEnv *instance) { } // finish filling vector #endif + auto end1 = std::chrono::high_resolution_clock::now(); + // get duration in us + auto dur1 = std::chrono::duration_cast(end1 - start); + SPDLOG_INFO("Snapshot Overhead: {} s", dur1.count() / 1000000.0); #if __linux__ if (dynamic_cast(writer)) { auto buffer = struct_pack::serialize(as);