Skip to content

Commit 5a4955b

Browse files
scripts: fix lint errors
1 parent d9f50fa commit 5a4955b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

scripts/snapdragon/qdc/tests/test_bench.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88
model='../gguf/Llama-3.2-1B-Instruct-Q4_0.gguf'
99
cli_pref=f'cd {pkg_path} && LD_LIBRARY_PATH={lib_path} ADSP_LIBRARY_PATH={lib_path} {bin_path}'
1010

11+
1112
def run_cmd(cmd):
1213
p = subprocess.run(cmd, text = True, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
1314
sys.stdout.write(p.stdout)
1415
assert(p.returncode == 0)
1516

17+
1618
@pytest.mark.dependency()
1719
def test_install():
18-
run_cmd([ 'adb', 'push', 'llama.cpp', f'{tmp_path}' ])
19-
run_cmd([ 'adb', 'shell', f'chmod 755 {bin_path}/*' ])
20+
run_cmd(['adb', 'push', 'llama.cpp', f'{tmp_path}'])
21+
run_cmd(['adb', 'shell', f'chmod 755 {bin_path}/*'])
22+
2023

2124
## Basic cli tests
2225
def run_llama_cli(dev, opts):
@@ -25,30 +28,35 @@ def run_llama_cli(dev, opts):
2528
f'-p "what is the most popular cookie in the world?\nPlease provide a very brief bullet point summary.\nBegin your answer with **BEGIN**."'
2629
])
2730

31+
2832
@pytest.mark.dependency(depends=['test_install'])
2933
def test_llama_cli_cpu():
3034
run_llama_cli('none', '-ctk q8_0 -ctv q8_0 -fa on')
3135

36+
3237
@pytest.mark.dependency(depends=['test_install'])
3338
def test_llama_cli_gpu():
3439
run_llama_cli('GPUOpenCL', '-fa on')
3540

41+
3642
@pytest.mark.dependency(depends=['test_install'])
3743
def test_llama_cli_npu():
3844
run_llama_cli('HTP0', '-ctk q8_0 -ctv q8_0 -fa on')
3945

46+
4047
## Basic bench tests
4148
def run_llama_bench(dev):
42-
run_cmd([ 'adb', 'shell',
43-
f'{cli_pref}/llama-bench -m {model} --device {dev} -ngl 99 --batch-size 128 -t 4 -p 128 -n 32'
44-
])
49+
run_cmd(['adb', 'shell', f'{cli_pref}/llama-bench -m {model} --device {dev} -ngl 99 --batch-size 128 -t 4 -p 128 -n 32'])
50+
4551

4652
@pytest.mark.dependency(depends=['test_install'])
4753
def test_llama_bench_cpu():
4854
run_llama_bench('none')
4955

56+
5057
def test_llama_bench_gpu():
5158
run_llama_bench('GPUOpenCL')
5259

60+
5361
def test_llama_bench_npu():
5462
run_llama_bench('HTP0')

0 commit comments

Comments
 (0)