Skip to content

Commit

Permalink
update mac result
Browse files Browse the repository at this point in the history
  • Loading branch information
victoryang00 committed Mar 22, 2024
1 parent 49d2d40 commit 05e93e4
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 123 deletions.
18 changes: 10 additions & 8 deletions artifact/bench_mac.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
]
arg = [
[],
["./ORBvoc.txt,", "./TUM3.yaml", "./", "./associations/fr1_xyz.txt"],
["./ORBvoc.txt", "./TUM3.yaml", "./", "./associations/fr1_xyz.txt"],
["-g20", "-vn300"],
["-g20", "-vn300"],
["-g20", "-vn300"],
Expand Down Expand Up @@ -153,6 +153,7 @@ def read_from_csv(filename):
results.append((row[0], float(row[1]), float(row[2])))
return results


# print the results
def plot(result, file_name="mac.pdf"):
workloads = defaultdict(list)
Expand Down Expand Up @@ -208,7 +209,7 @@ def plot(result, file_name="mac.pdf"):
label="MVVM" if i == 0 else "",
)
ax.bar(
index[i] + bar_width,
index[i] + bar_width,
stats["native_median"],
bar_width,
yerr=stats["native_std"],
Expand All @@ -218,7 +219,7 @@ def plot(result, file_name="mac.pdf"):
)
# Labeling and formatting
ax.set_ylabel("Time(s)")
ax.set_xticks(index + bar_width )
ax.set_xticks(index + bar_width)
ticklabel = (x.replace("a=b", "") for x in list(statistics.keys()))
ax.set_xticklabels(ticklabel, fontsize=10)
ax.legend()
Expand All @@ -230,11 +231,12 @@ def plot(result, file_name="mac.pdf"):
# %%



if __name__ == "__main__":
mvvm_results = run_mvvm()
native_results = run_native()

write_to_csv("mac.csv")
# mvvm_results = run_mvvm()
# native_results = run_native()
# # print("mvvm_results=",mvvm_results)
# print("native_results=",native_results)
# mvvm_results= [('a=b linpack.aot', '20.35297'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1756.614537'), ('OMP_NUM_THREADS=4 cc_sv.aot -g20 -vn300', '337.642205'), ('OMP_NUM_THREADS=4 pr_spmv.aot -g20 -vn300', '207.854911'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '752.853794'), ('OMP_NUM_THREADS=4 tc.aot -g20 -n1', '79.425973'), ('OMP_NUM_THREADS=4 bt.aot', '225.563336'), ('OMP_NUM_THREADS=4 cg.aot', '105.84309'), ('OMP_NUM_THREADS=4 ft.aot', '109.382876'), ('OMP_NUM_THREADS=4 lu.aot', '0.100862'), ('OMP_NUM_THREADS=4 mg.aot', '77.988457'), ('OMP_NUM_THREADS=4 sp.aot', '45.716619'), ('a=b redis.aot', '440.105842'), ('a=b linpack.aot', '20.292488'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1752.427599'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '650.273267'), ('OMP_NUM_THREADS=4 bt.aot', '221.060635'), ('OMP_NUM_THREADS=4 cg.aot', '83.902382'), ('OMP_NUM_THREADS=4 ft.aot', '108.55405'), ('OMP_NUM_THREADS=4 lu.aot', '0.099944'), ('OMP_NUM_THREADS=4 mg.aot', '76.068425'), ('OMP_NUM_THREADS=4 sp.aot', '44.252397'), ('a=b redis.aot', '436.661554'), ('a=b linpack.aot', '20.311249'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1750.945471'), ('OMP_NUM_THREADS=4 cc.aot -g20 -vn300', '257.6362'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '640.248003'), ('OMP_NUM_THREADS=4 cg.aot', '83.665063'), ('OMP_NUM_THREADS=4 ft.aot', '108.397934'), ('OMP_NUM_THREADS=4 lu.aot', '0.099937'), ('OMP_NUM_THREADS=4 mg.aot', '75.730582'), ('OMP_NUM_THREADS=4 sp.aot', '43.246373'), ('a=b redis.aot', '431.965889'), ('a=b linpack.aot', '20.12319'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1744.854772'), ('OMP_NUM_THREADS=4 cc_sv.aot -g20 -vn300', '323.408531'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '639.228057'), ('OMP_NUM_THREADS=4 tc.aot -g20 -n1', '77.180237'), ('OMP_NUM_THREADS=4 bt.aot', '219.571527'), ('OMP_NUM_THREADS=4 cg.aot', '84.089276'), ('OMP_NUM_THREADS=4 ft.aot', '108.373259'), ('OMP_NUM_THREADS=4 lu.aot', '0.101511'), ('OMP_NUM_THREADS=4 mg.aot', '75.808051'), ('OMP_NUM_THREADS=4 sp.aot', '43.507578'), ('a=b redis.aot', '430.646313'), ('a=b linpack.aot', '20.154494'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1747.744954'), ('OMP_NUM_THREADS=4 pr.aot -g20 -vn300', '172.685799'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '639.321099'), ('OMP_NUM_THREADS=4 tc.aot -g20 -n1', '77.176157'), ('OMP_NUM_THREADS=4 bt.aot', '220.643829'), ('OMP_NUM_THREADS=4 cg.aot', '83.617502'), ('OMP_NUM_THREADS=4 ft.aot', '108.375996'), ('OMP_NUM_THREADS=4 lu.aot', '0.099423'), ('OMP_NUM_THREADS=4 mg.aot', '75.713318'), ('OMP_NUM_THREADS=4 sp.aot', '43.262573'), ('a=b redis.aot', '432.311077'), ('a=b linpack.aot', '20.127186'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1747.198434'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '639.339902'), ('OMP_NUM_THREADS=4 tc.aot -g20 -n1', '77.189113'), ('OMP_NUM_THREADS=4 bt.aot', '220.017367'), ('OMP_NUM_THREADS=4 cg.aot', '83.987663'), ('OMP_NUM_THREADS=4 ft.aot', '108.316253'), ('OMP_NUM_THREADS=4 lu.aot', '0.099739'), ('OMP_NUM_THREADS=4 mg.aot', '75.808478'), ('OMP_NUM_THREADS=4 sp.aot', '43.184115'), ('a=b redis.aot', '434.06413'), ('a=b linpack.aot', '20.094815'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1745.192042'), ('OMP_NUM_THREADS=4 bfs.aot -g20 -vn300', '132.498137'), ('OMP_NUM_THREADS=4 pr.aot -g20 -vn300', '172.928574'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '640.216479'), ('OMP_NUM_THREADS=4 bt.aot', '219.973081'), ('OMP_NUM_THREADS=4 cg.aot', '84.080505'), ('OMP_NUM_THREADS=4 ft.aot', '108.467563'), ('OMP_NUM_THREADS=4 lu.aot', '0.099886'), ('OMP_NUM_THREADS=4 mg.aot', '75.930483'), ('OMP_NUM_THREADS=4 sp.aot', '43.790822'), ('a=b redis.aot', '433.181533'), ('a=b linpack.aot', '20.113912'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1746.466368'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '724.950474'), ('OMP_NUM_THREADS=4 cg.aot', '88.982113'), ('OMP_NUM_THREADS=4 ft.aot', '109.39976'), ('OMP_NUM_THREADS=4 lu.aot', '0.103163'), ('OMP_NUM_THREADS=4 mg.aot', '78.80666'), ('OMP_NUM_THREADS=4 sp.aot', '47.4579'), ('a=b redis.aot', '442.873866'), ('a=b linpack.aot', '20.899038'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1770.61544'), ('OMP_NUM_THREADS=4 cc.aot -g20 -vn300', '275.526444'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '728.232795'), ('OMP_NUM_THREADS=4 tc.aot -g20 -n1', '80.402936'), ('OMP_NUM_THREADS=4 bt.aot', '230.24286'), ('OMP_NUM_THREADS=4 cg.aot', '88.678567'), ('OMP_NUM_THREADS=4 ft.aot', '110.228341'), ('OMP_NUM_THREADS=4 lu.aot', '0.101845'), ('OMP_NUM_THREADS=4 mg.aot', '79.984639'), ('OMP_NUM_THREADS=4 sp.aot', '47.672618'), ('a=b redis.aot', '451.670712'), ('a=b linpack.aot', '21.172726'), ('a=b rgbd_tum.aot ./ORBvoc.txt ./TUM3.yaml ./ ./associations/fr1_xyz.txt', '1792.986851'), ('OMP_NUM_THREADS=4 sssp.aot -g20 -vn300', '777.678223'), ('OMP_NUM_THREADS=4 cg.aot', '90.86123'), ('OMP_NUM_THREADS=4 ft.aot', '112.358934'), ('OMP_NUM_THREADS=4 lu.aot', '0.105421'), ('OMP_NUM_THREADS=4 mg.aot', '81.579015'), ('OMP_NUM_THREADS=4 sp.aot', '50.432014'), ('a=b redis.aot', '452.357001')]
# write_to_csv("mac.csv")
results = read_from_csv("mac.csv")
plot(results, "mac.pdf")
201 changes: 101 additions & 100 deletions artifact/ckpt_restore_latency.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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"],
["-f", "./road.sg", "-n300"],
["-g20", "-vn300"],
["-g20", "-vn300"],
Expand Down Expand Up @@ -100,95 +100,95 @@
]


pool = Pool(processes=1)


def run_mvvm():
results = []
results1 = []

for i, c in enumerate(cmd):
aot = cmd[i] + common_util.aot_variant[0]
results1.append(
pool.apply_async(
common_util.run_checkpoint_restore,
(aot, arg[i], envs[i]),
)
)
results1 = [x.get() for x in results1]
write_to_csv(results1, "ckpt_restore_latency_raw.csv")
for exec, output in results1:
for o in range(len(output)):
lines = output[o].split("\n")
for line in lines:
if line.__contains__("Snapshot time:"):
time = line.split(" ")[-2]
snapshot_time = float(time)
if line.__contains__("Snapshot Memory:"):
time = line.split(" ")[-2]
snapshot_memory = float(time)
if line.__contains__("Recover time:"):
time = line.split(" ")[-1]
recover_time = float(time)

results += [(exec, snapshot_time, recover_time, snapshot_memory)]
return results


def run_criu():
results = []
results1 = []
for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_criu_checkpoint_restore,
(aot, folder[i], arg[i], envs[i]),
)
)
# print the results
results1 = [x.get() for x in results1]
write_to_csv_raw(results1, "ckpt_restore_latency_criu_raw.csv")
for exec, output in results1:
for o in range(len(output)):
lines = output[o].split("\n")
for line in lines:
if line.__contains__("Dumping finished successfully"):
time = line.split(" ")[0].replace("(", "").replace(")", "")
snapshot_time = float(time)
if line.__contains__("Restore finished successfully."):
time = line.split(" ")[0].replace("(", "").replace(")", "")
recover_time = float(time)
# print(output[o])
results += [(exec, snapshot_time, recover_time)]
return results


def run_qemu():
results = []
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_qemu_checkpoint_restore,
(aot, folder[i], arg[i], envs[i]),
)
)
# print the results
results1 = [x.get() for x in results1]
write_to_csv_raw(results1, "ckpt_restore_latency_qemu_raw.csv")
for exec, output in results1:
for o in range(len(output)):
lines = output[o].split("\n")
for line in lines:
if line.__contains__("total time: "):
time = line.split(" ")[-2]
snapshot_time = float(time) / 1000
print(exec, snapshot_time)
results += [(exec, snapshot_time, 0.0)]
return results
# pool = Pool(processes=1)


# def run_mvvm():
# results = []
# results1 = []

# for i, c in enumerate(cmd):
# aot = cmd[i] + common_util.aot_variant[0]
# results1.append(
# pool.apply_async(
# common_util.run_checkpoint_restore,
# (aot, arg[i], envs[i]),
# )
# )
# results1 = [x.get() for x in results1]
# write_to_csv(results1, "ckpt_restore_latency_raw.csv")
# for exec, output in results1:
# for o in range(len(output)):
# lines = output[o].split("\n")
# for line in lines:
# if line.__contains__("Snapshot time:"):
# time = line.split(" ")[-2]
# snapshot_time = float(time)
# if line.__contains__("Snapshot Memory:"):
# time = line.split(" ")[-2]
# snapshot_memory = float(time)
# if line.__contains__("Recover time:"):
# time = line.split(" ")[-1]
# recover_time = float(time)

# results += [(exec, snapshot_time, recover_time, snapshot_memory)]
# return results


# def run_criu():
# results = []
# results1 = []
# for i in range(len(cmd)):
# aot = cmd[i]
# results1.append(
# pool.apply_async(
# common_util.run_criu_checkpoint_restore,
# (aot, folder[i], arg[i], envs[i]),
# )
# )
# # print the results
# results1 = [x.get() for x in results1]
# write_to_csv_raw(results1, "ckpt_restore_latency_criu_raw.csv")
# for exec, output in results1:
# for o in range(len(output)):
# lines = output[o].split("\n")
# for line in lines:
# if line.__contains__("Dumping finished successfully"):
# time = line.split(" ")[0].replace("(", "").replace(")", "")
# snapshot_time = float(time)
# if line.__contains__("Restore finished successfully."):
# time = line.split(" ")[0].replace("(", "").replace(")", "")
# recover_time = float(time)
# # print(output[o])
# results += [(exec, snapshot_time, recover_time)]
# return results


# def run_qemu():
# results = []
# results1 = []

# for i in range(len(cmd)):
# aot = cmd[i]
# results1.append(
# pool.apply_async(
# common_util.run_qemu_checkpoint_restore,
# (aot, folder[i], arg[i], envs[i]),
# )
# )
# # print the results
# results1 = [x.get() for x in results1]
# write_to_csv_raw(results1, "ckpt_restore_latency_qemu_raw.csv")
# for exec, output in results1:
# for o in range(len(output)):
# lines = output[o].split("\n")
# for line in lines:
# if line.__contains__("total time: "):
# time = line.split(" ")[-2]
# snapshot_time = float(time) / 1000
# print(exec, snapshot_time)
# results += [(exec, snapshot_time, 0.0)]
# return results


def write_to_csv_raw(data, filename):
Expand Down Expand Up @@ -449,7 +449,7 @@ def plot_whole(
"criu_recovery_median": np.median(recoveries_criu),
"criu_snapshot_std": np.std(snapshots_criu),
"criu_recovery_std": np.std(recoveries_criu),
"qemu_snapshot_median": np.median(snapshots),
"qemu_snapshot_median": np.median(snapshots_qemu),
"qemu_snapshot_std": np.std(snapshots_qemu),
}

Expand Down Expand Up @@ -529,24 +529,25 @@ def plot_whole(

# Show the plot
plt.tight_layout()
plt.show()
# plt.show()
plt.savefig(file_name)
# %%

# %%

if __name__ == "__main__":
# mvvm_result = run_mvvm()
# write_to_csv(mvvm_result, "ckpt_restore_latency_profile.csv")

# print(len(arg), len(cmd), len(envs))
criu_result = run_criu()
write_to_csv(criu_result, "ckpt_restore_latency_criu.csv")
# criu_result = run_criu()
# write_to_csv(criu_result, "ckpt_restore_latency_criu.csv")
# 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")
# 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)
# qemu_result = read_from_csv("ckpt_restore_latency_qemu.csv")
# plot_whole(mvvm_result, criu_result, qemu_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")
2 changes: 1 addition & 1 deletion artifact/memory_footprint_overhead.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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"],
["-f", "./road.sg", "-n300"],
["-g20", "-vn300"],
["-g20", "-vn300"],
Expand Down
Loading

0 comments on commit 05e93e4

Please sign in to comment.