Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion backends/arm/test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import logging
import os
import platform
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -57,11 +58,17 @@ def pytest_collection_modifyitems(config, items):


def load_libquantized_ops_aot_lib():
so_ext = {
"Darwin": "dylib",
"Linux": "so",
"Windows": "dll",
}.get(platform.system(), None)

find_lib_cmd = [
"find",
"cmake-out-aot-lib",
"-name",
"libquantized_ops_aot_lib.so",
f"libquantized_ops_aot_lib.{so_ext}",
]
res = subprocess.run(find_lib_cmd, capture_output=True)
if res.returncode == 0:
Expand Down
3 changes: 2 additions & 1 deletion examples/arm/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ function generate_pte_file() {
pte_file=$(realpath ${output_folder}/${model_filename})
rm -f "${pte_file}"

SO_EXT=$(python3 -c 'import platform; print({"Darwin": "dylib", "Linux": "so", "Windows": "dll"}.get(platform.system(), None))')
# We are using the aot_lib from build_quantization_aot_lib below
SO_LIB=$(find cmake-out-aot-lib -name libquantized_ops_aot_lib.so)
SO_LIB=$(find cmake-out-aot-lib -name libquantized_ops_aot_lib.${SO_EXT})

python3 -m examples.arm.aot_arm_compiler --model_name="${model}" --target=${target} ${model_compiler_flags} --output ${output_folder} --so_library="$SO_LIB" 1>&2
[[ -f ${pte_file} ]] || { >&2 echo "Failed to generate a pte file - ${pte_file}"; exit 1; }
Expand Down
2 changes: 2 additions & 0 deletions examples/arm/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ root_dir=$(realpath ${root_dir})
function setup_fvp() {
if [[ "${OS}" != "Linux" ]]; then
echo "[${FUNCNAME[0]}] Warning: FVP only supported with Linux OS, skipping FVP setup..."
echo "[${FUNCNAME[0]}] Warning: For MacOS, using https://github.com/Arm-Examples/FVPs-on-Mac is recommended."
echo "[${FUNCNAME[0]}] Warning: Follow the instructions and make sure the path is set correctly."
return 1
fi

Expand Down
Loading