Skip to content

Commit

Permalink
update atomic wait
Browse files Browse the repository at this point in the history
  • Loading branch information
victoryang00 committed Jan 30, 2024
1 parent dce471b commit 1760e67
Show file tree
Hide file tree
Showing 16 changed files with 457 additions and 109 deletions.
139 changes: 109 additions & 30 deletions artifact/analyze.ipynb

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions artifact/bench_hdastar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import common_util
from multiprocessing import Pool

cmd = ["hdastar", "hdastar", "hdastar"]
cmd = ["hw5","hw5", "hw5", "hw5"]
arg = [
["maze-6404.txt", "1"],
["maze-6404.txt", "2"],
["maze-6404.txt", "4"],
["maze-6404.txt", "8"],
Expand All @@ -15,10 +16,8 @@
# run the benchmarks
results = []
for i in range(len(cmd)):
for j in range(len(common_util.aot_variant)):
for env in ["a=b"]:
aot = cmd[i] + common_util.aot_variant[j]
results.append(pool.apply_async(common_util.run, (aot, arg[i], env)))
aot = cmd[i]
results.append(pool.apply_async(common_util.run_hcontainer, (aot,"hdastar", arg[i], "OMP_NUM_THREADS=1")))
pool.close()
pool.join()

Expand All @@ -31,7 +30,7 @@
print(exec)
lines = output.split("\n")
for line in lines:
if line.__contains__("Execution time:"):
if line.__contains__("real"):
print(line)

# read the results
Expand Down
99 changes: 85 additions & 14 deletions artifact/bench_linpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,100 @@


pool = Pool(processes=40)

# run the benchmarks
results = []
for i in range(len(cmd)):
for j in range(len(common_util.aot_variant)):
for env in ["LINPACK_ARRAY_SIZE=600"]:
aot = cmd[i] + common_util.aot_variant[j]
results.append(pool.apply_async(common_util.run, (aot, arg[i], env)))
pool.close()
pool.join()
def run_mvvm():
global results
results1 = []
for i in range(len(cmd)):
for j in range(len(common_util.aot_variant)):
for env in common_util.list_of_arg:
aot = cmd[i] + common_util.aot_variant[j]
results1.append(pool.apply_async(common_util.run, (aot, arg[i], env)))
# print the results
results += [x.get() for x in results1]


def run_hcontainer():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_hcontainer, (aot, "linpack", arg[i], "OMP_NUM_THREADS=1")
)
)
# print the results
results += [x.get() for x in results1]


def run_qemu_x86_64():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_qemu_x86_64, (aot, "linpack", arg[i], "OMP_NUM_THREADS=1")
)
)
# print the results
results += [x.get() for x in results1]


def run_qemu_aarch64():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_qemu_aarch64,
(aot, "linpack", arg[i], "OMP_NUM_THREADS=1"),
)
)
# print the results
results += [x.get() for x in results1]


def run_native():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_native, (aot, "linpack", arg[i], "OMP_NUM_THREADS=1")
)
)

# print the results
results += [x.get() for x in results1]

run_native()
run_qemu_x86_64()

# print the results
results = [x.get() for x in results]
# serialize the results

run_qemu_x86_64()
run_native()
with open("bench_linpack_results.pickle", "wb") as f:
pickle.dump(results, f)
for exec, output in results:
print(exec)
lines = output.split("\n")
for line in lines:
if line.__contains__("Execution time:"):
if (
line.__contains__("Execution time:")
or line.__contains__("real")
or line.__contains__("user")
):
print(line)

# read the results
with open("bench_linpack_results.pickle", "rb") as f:
results = pickle.load(f)
# with open("bench_linpack_results.pickle", "rb") as f:
# results = pickle.load(f)
102 changes: 88 additions & 14 deletions artifact/bench_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,112 @@
import common_util
from multiprocessing import Pool

cmd = [
"llama"
]
cmd = ["llama"]
arg = [
["stories15M.bin", "-z","tokenizer.bin", "-t", "0.0"],
["stories15M.bin", "-z", "tokenizer.bin", "-t", "0.0"],
]


pool = Pool(processes=40)

# run the benchmarks
results = []
for i in range(len(cmd)):
for j in range(len(common_util.aot_variant)):
for env in common_util.list_of_arg:
aot = cmd[i] + common_util.aot_variant[j]
results.append(pool.apply_async(common_util.run, (aot, arg[i], env)))
pool.close()
pool.join()


def run_mvvm():
global results
results1 = []
for i in range(len(cmd)):
for j in range(len(common_util.aot_variant)):
for env in common_util.list_of_arg:
aot = cmd[i] + common_util.aot_variant[j]
results1.append(pool.apply_async(common_util.run, (aot, arg[i], env)))
# print the results
results += [x.get() for x in results1]


def run_hcontainer():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_hcontainer, (aot, "llama", arg[i], "OMP_NUM_THREADS=1")
)
)
# print the results
results += [x.get() for x in results1]


def run_qemu_x86_64():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_qemu_x86_64, (aot, "llama", arg[i], "OMP_NUM_THREADS=1")
)
)
# print the results
results += [x.get() for x in results1]


def run_qemu_aarch64():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_qemu_aarch64,
(aot, "llama", arg[i], "OMP_NUM_THREADS=1"),
)
)
# print the results
results += [x.get() for x in results1]


def run_native():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_native, (aot, "llama", arg[i], "OMP_NUM_THREADS=1")
)
)

# print the results
results += [x.get() for x in results1]

run_native()
run_qemu_x86_64()
# print the results
results = [x.get() for x in results]
pool.close()
pool.join()
# serialize the results
with open("bench_llama_results.pickle", "wb") as f:
pickle.dump(results, f)

# serialize the results
for exec, output in results:
print(exec)
lines = output.split("\n")
for line in lines:
if line.startswith("Execution time:"):
if (
line.__contains__("Execution time:")
or line.__contains__("real")
or line.__contains__("user")
):
print(line)

# read the results
# with open("bench_results.pickle", "rb") as f:
# with open("bench_llama_results.pickle", "rb") as f:
# results = pickle.load(f)
98 changes: 80 additions & 18 deletions artifact/bench_nas.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,92 @@
arg = [[], [], [], [], [], [], []]


pool = Pool(processes=5)
pool = Pool(processes=10)
results = []

# run the benchmarks
results = []
for i in range(len(cmd)):
for j in range(len(common_util.aot_variant)):
for env in common_util.list_of_arg:
aot = cmd[i] + common_util.aot_variant[j]
results.append(pool.apply_async(common_util.run, (aot, arg[i], env)))
pool.close()
pool.join()

# print the results
results = [x.get() for x in results]
def run_mvvm():
global results
results1 = []
for i in range(len(cmd)):
for j in range(len(common_util.aot_variant)):
for env in common_util.list_of_arg:
aot = cmd[i] + common_util.aot_variant[j]
results1.append(pool.apply_async(common_util.run, (aot, arg[i], env)))
# print the results
results += [x.get() for x in results1]


def run_hcontainer():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_hcontainer, (aot, "nas", arg[i], "OMP_NUM_THREADS=1")
)
)
# print the results
results += [x.get() for x in results1]


def run_qemu_x86_64():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_qemu_x86_64, (aot, "nas", arg[i], "OMP_NUM_THREADS=1")
)
)
# print the results
results += [x.get() for x in results1]


def run_qemu_aarch64():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_qemu_aarch64,
(aot, "nas", arg[i], "OMP_NUM_THREADS=1"),
)
)
# print the results
results += [x.get() for x in results1]


def run_native():
global results
results1 = []

for i in range(len(cmd)):
aot = cmd[i]
results1.append(
pool.apply_async(
common_util.run_native, (aot, "nas", arg[i], "OMP_NUM_THREADS=1")
)
)

# print the results
results += [x.get() for x in results1]

run_native()
run_qemu_x86_64()
# serialize the results
with open("bench_nas_results.pickle", "wb") as f:
pickle.dump(results, f)
for exec, output in results:
print(exec)
lines = output.split("\n")
for line in lines:
if line.__contains__("Execution time:"):
if line.__contains__("Execution time:") or line.__contains__("real") or line.__contains__("user"):
print(line)

# read the results
# with open("bench_results.pickle", "rb") as f:
# results = pickle.load(f)
with open("bench_nas_results.pickle", "rb") as f:
results = pickle.load(f)
4 changes: 2 additions & 2 deletions artifact/bench_orb_slam3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from multiprocessing import Pool

cmd = [
"rgb",
"rgbd_tum",
]
arg = [
[],
[ "./ORBvoc.txt","./TUM1.yaml","./","./associations/fr2_desk.txt"],
]


Expand Down
Loading

0 comments on commit 1760e67

Please sign in to comment.