Skip to content

Commit 39d0cd0

Browse files
authored
Merge pull request #9 from AmpereComputingAI/binh/v2.0.0_bench
Add support for Ampere optimized llama.cpp v2.0.0
2 parents 65c8f6b + bca50a6 commit 39d0cd0

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

benchmarks/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def get_file_dir():
1212

1313

1414
def docker_init():
15-
tag = "amperecomputingai/llama.cpp:1.2.3"
15+
tag = "amperecomputingai/llama.cpp:2.0.0"
1616
if subprocess.run(
1717
["docker", "pull", tag]).returncode != 0:
1818
print("Docker pull process failed!")

benchmarks/utils/benchmark.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,19 @@ def main():
116116
current_subprocesses = list()
117117
for n in range(args.num_processes):
118118
logfile = f"{logs_dir}/log_{n}"
119-
cmd = ["numactl", f"--physcpubind={gen_threads_config(args.num_threads, n)}",
120-
"/llm/batched-bench", args.model, str(args.kv_cache), "2048", "512", "0", "0", "0", str(args.prompt_size), str(TOKENS),
121-
str(args.batch_size), str(args.num_threads)]
119+
if os.path.exists("/llm/batched-bench"):
120+
# command-line for v1
121+
cmd = ["numactl", f"--physcpubind={gen_threads_config(args.num_threads, n)}",
122+
"/llm/batched-bench", args.model, str(args.kv_cache), "2048", "512", "0", "0", "0", str(args.prompt_size), str(TOKENS),
123+
str(args.batch_size), str(args.num_threads)]
124+
elif os.path.exists("/llm/llama-batched-bench"):
125+
# command-line for v2
126+
cmd = ["numactl", f"--physcpubind={gen_threads_config(args.num_threads, n)}",
127+
"/llm/llama-batched-bench", "-m", args.model, "-c", str(args.kv_cache), "-b", "2048", "-ub", "512", "-npp", str(args.prompt_size), "-ntg", str(TOKENS),
128+
"-npl", str(args.batch_size), "-t", str(args.num_threads), "-tb", str(args.num_threads), "-td", str(args.num_threads)]
129+
else:
130+
print("FAIL: batched-bench not found!")
131+
sys.exit(1)
122132
current_subprocesses.append(
123133
subprocess.Popen(cmd, stdout=open(logfile, 'wb'), stderr=open(logfile, 'wb')))
124134
start = time.time()

0 commit comments

Comments
 (0)