Skip to content

Commit 4c90a53

Browse files
authored
Arm backend: Update MLSDK setup (#14260)
Pins MLSDK manifest to a snapshot tag. cc @digantdesai @freddan80 @per @zingo @oscarandersson8218
1 parent f82d94b commit 4c90a53

File tree

2 files changed

+24
-42
lines changed

2 files changed

+24
-42
lines changed

backends/arm/scripts/mlsdk_utils.sh

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,17 @@
77
set -euo pipefail
88

99
mlsdk_manifest_url="https://github.com/arm/ai-ml-sdk-manifest.git"
10+
mlsdk_manifest_tag="dev-snapshot-2025-09-12"
1011

1112
script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
1213

1314
source ${script_dir}/utils.sh
1415

15-
usage() { echo "Usage: $0 [-u <mlsdk-manifest-url>]" 1>&2; exit 1; }
16-
17-
while getopts ":u:" opt; do
18-
case "${opt}" in
19-
u)
20-
mlsdk_manifest_url=${OPTARG}
21-
;;
22-
*)
23-
usage
24-
;;
25-
esac
26-
done
27-
2816
function download_ai_mlsdk_manifest() {
29-
local _dada_dir="$1"
17+
local _manifest_dir="$1"
3018

31-
if [[ -z "${_dada_dir}" ]]; then
32-
echo "Error: _dada_dir parameter missing?"
19+
if [[ -z "${_manifest_dir}" ]]; then
20+
echo "Error: _manifest_dir parameter missing?"
3321
return 1
3422
fi
3523

@@ -38,20 +26,25 @@ function download_ai_mlsdk_manifest() {
3826
return 1
3927
fi
4028

41-
if [[ ! -d "${_dada_dir}" ]]; then
42-
mkdir -p "$_dada_dir"
43-
pushd "$_dada_dir" || exit 1
29+
if [[ ! -d "${_manifest_dir}" ]]; then
30+
mkdir -p "$_manifest_dir"
31+
pushd "$_manifest_dir" || exit 1
4432

4533
curl https://storage.googleapis.com/git-repo-downloads/repo > repo
4634
chmod u+x repo
47-
./repo init --no-repo-verify --depth=1 --manifest-url ${mlsdk_manifest_url} -g model-converter,emulation-layer,vgf-library
48-
./repo sync
35+
./repo init \
36+
--depth=1 \
37+
--no-repo-verify \
38+
--manifest-url ${mlsdk_manifest_url} \
39+
--manifest-branch ${mlsdk_manifest_tag} \
40+
-g model-converter,emulation-layer,vgf-library
41+
./repo sync -j$(nproc)
4942

5043
popd
5144
fi
5245
}
5346

54-
function setup_model_converter() {
47+
function setup_mlsdk() {
5548
local work_dir="$1"
5649
local manifest_dir="$2"
5750
local enable_model_converter="$3"
@@ -147,6 +140,3 @@ function setup_path_emulation_layer() {
147140
prepend_env_in_setup_path VK_INSTANCE_LAYERS VK_LAYER_ML_Graph_Emulation
148141
prepend_env_in_setup_path VK_LAYER_PATH "${model_emulation_layer_path}/deploy/share/vulkan/explicit_layer.d"
149142
}
150-
151-
#setup_model_converter() $1
152-
# `"$manifest_dir"'

examples/arm/setup.sh

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ enable_model_converter=0 # model-converter tool for VGF output
2626
enable_vgf_lib=0 # vgf reader - runtime backend dependency
2727
enable_emulation_layer=0 # Vulkan layer driver - emulates Vulkan ML extensions
2828
enable_vulkan_sdk=0 # Download and export Vulkan SDK required by emulation layer
29-
mlsdk_manifest_url="https://github.com/arm/ai-ml-sdk-manifest.git"
3029

3130
# Figure out if setup.sh was called or sourced and save it into "is_script_sourced"
3231
(return 0 2>/dev/null) && is_script_sourced=1 || is_script_sourced=0
@@ -145,17 +144,6 @@ function check_options() {
145144
enable_vulkan_sdk=1
146145
shift
147146
;;
148-
--mlsdk-manifest-url)
149-
# Ensure that there is a url provided.
150-
if [[ -n "$2" && "${2:0:1}" != "-" ]]; then
151-
mlsdk_manifest_url="$2"
152-
shift 2
153-
else
154-
echo "Error: --mlsdk-manifest-url requires a URL argument."
155-
print_usage "$@"
156-
exit 1
157-
fi
158-
;;
159147
--setup-test-dependency)
160148
echo "Installing test dependency..."
161149
source $et_dir/backends/arm/scripts/install_models_for_test.sh
@@ -251,8 +239,6 @@ if [[ $is_script_sourced -eq 0 ]]; then
251239
echo "enable-emulation-layer=${enable_emulation_layer}"
252240
echo "enable-vulkan-sdk=${enable_vulkan_sdk}"
253241
echo "enable-vela=${enable_vela}"
254-
echo "mlsdk-manifest-url=${mlsdk_manifest_url}"
255-
256242

257243
# Setup toolchain
258244
if [[ "${enable_baremetal_toolchain}" -eq 1 ]]; then
@@ -276,15 +262,21 @@ if [[ $is_script_sourced -eq 0 ]]; then
276262
if [[ "${enable_model_converter}" -eq 1 || \
277263
"${enable_vgf_lib}" -eq 1 || \
278264
"${enable_emulation_layer}" -eq 1 ]]; then
279-
source $et_dir/backends/arm/scripts/mlsdk_utils.sh -u "${mlsdk_manifest_url}"
280-
setup_model_converter ${root_dir} ${mlsdk_manifest_dir} ${enable_model_converter} ${enable_vgf_lib} ${enable_emulation_layer}
265+
source $et_dir/backends/arm/scripts/mlsdk_utils.sh
266+
setup_mlsdk ${root_dir} \
267+
${mlsdk_manifest_dir} \
268+
${enable_model_converter} \
269+
${enable_vgf_lib} \
270+
${enable_emulation_layer}
281271
fi
282272

283273
# Create the setup_path.sh used to create the PATH variable for shell
284274
create_setup_path
285275

286276
# Setup the tosa_reference_model and dependencies
287-
CMAKE_POLICY_VERSION_MINIMUM=3.5 BUILD_PYBIND=1 pip install --no-dependencies -r $et_dir/backends/arm/requirements-arm-tosa.txt
277+
CMAKE_POLICY_VERSION_MINIMUM=3.5 \
278+
BUILD_PYBIND=1 \
279+
pip install --no-dependencies -r $et_dir/backends/arm/requirements-arm-tosa.txt
288280

289281
if [[ "${enable_vela}" -eq 1 ]]; then
290282
setup_ethos_u_tools

0 commit comments

Comments
 (0)