Skip to content

Commit 884b0c1

Browse files
mansnilshinriksnaer
authored andcommitted
Arm backend: Only fetch what is used (pytorch#11853)
Additional patches are applied during download to remove projects that are not used.
1 parent aca999c commit 884b0c1

File tree

3 files changed

+113
-4
lines changed

3 files changed

+113
-4
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 03e33214c52fd98b2adf87b2ff1c01ff91eceb52 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?M=C3=A5ns=20Nilsson?= <[email protected]>
3+
Date: Fri, 13 Jun 2025 20:12:28 +0200
4+
Subject: [PATCH] Do not include tflite micro and rtos projects as they are not
5+
needed
6+
7+
---
8+
CMakeLists.txt | 4 ++--
9+
1 file changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/CMakeLists.txt b/CMakeLists.txt
12+
index c6faad8..7c205e0 100644
13+
--- a/CMakeLists.txt
14+
+++ b/CMakeLists.txt
15+
@@ -76,10 +76,10 @@ if (CORE_SOFTWARE_ACCELERATOR STREQUAL "NPU")
16+
endif()
17+
18+
# Build Tensorflow Lite Micro library
19+
-include(tflite_micro.cmake)
20+
+#include(tflite_micro.cmake)
21+
22+
# Build RTOS
23+
-add_subdirectory(rtos)
24+
+#add_subdirectory(rtos)
25+
26+
# Build EventRecorder
27+
include(event_recorder.cmake)
28+
--
29+
2.34.1
30+
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
From 31a3be0c97093dbd70777c644d47ce8a7a9f57b3 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?M=C3=A5ns=20Nilsson?= <[email protected]>
3+
Date: Fri, 13 Jun 2025 18:25:37 +0200
4+
Subject: [PATCH] Remove unused projects from 25.05 manifest
5+
6+
---
7+
25.05.json | 42 ------------------------------------------
8+
1 file changed, 42 deletions(-)
9+
10+
diff --git a/25.05.json b/25.05.json
11+
index 6a2697a..d248548 100644
12+
--- a/25.05.json
13+
+++ b/25.05.json
14+
@@ -38,48 +38,6 @@
15+
"path": "core_software/cmsis-view",
16+
"fetchurl": "https://github.com/ARM-software/CMSIS-View.git",
17+
"revision": "486ca2726d4a5de4895c9d3c273781d141b4a5b3"
18+
- },
19+
- {
20+
- "path": "core_software/openamp/libmetal",
21+
- "fetchurl": "https://github.com/OpenAMP/libmetal",
22+
- "revision": "36f87f9335f5afc3ce3a56c1069346df591094e1"
23+
- },
24+
- {
25+
- "path": "core_software/openamp/openamp",
26+
- "fetchurl": "https://github.com/OpenAMP/open-amp",
27+
- "revision": "3737f8b18ad24a3b091a11cc6ea320d8b0576da5"
28+
- },
29+
- {
30+
- "path": "core_software/rtos/freertos/freertos_kernel",
31+
- "fetchurl": "https://github.com/FreeRTOS/FreeRTOS-Kernel.git",
32+
- "revision": "2615dcde13d953dbe60ae1ee0cf9312458984c3a"
33+
- },
34+
- {
35+
- "path": "core_software/rtos/threadx",
36+
- "fetchurl": "https://github.com/eclipse-threadx/threadx",
37+
- "revision": "7ad78c40e9702917264a9b722890110fdb909ebc"
38+
- },
39+
- {
40+
- "path": "core_software/tflite_micro",
41+
- "fetchurl": "https://github.com/tensorflow/tflite-micro",
42+
- "revision": "9d35a74b03fa313026982abb4d2c4ffe29de88bc"
43+
- },
44+
- {
45+
- "path": "linux_driver_stack",
46+
- "fetchurl": "https://git.gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u-linux-driver-stack.git",
47+
- "pushurl": "ssh://[email protected]/artificial-intelligence/ethos-u/ethos-u-linux-driver-stack.git",
48+
- "revision": "25.05"
49+
- },
50+
- {
51+
- "path": "linux_driver_stack/thirdparty/tensorflow",
52+
- "fetchurl": "https://github.com/tensorflow/tensorflow.git",
53+
- "revision": "v2.18.1"
54+
- },
55+
- {
56+
- "path": "vela",
57+
- "fetchurl": "https://git.gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u-vela.git",
58+
- "pushurl": "ssh://[email protected]/artificial-intelligence/ethos-u/ethos-u-vela.git",
59+
- "revision": "4.3.0"
60+
}
61+
]
62+
}
63+
--
64+
2.34.1
65+

examples/arm/executor_runner/CMakeLists.txt

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ if(FETCH_ETHOS_U_CONTENT)
5252
file(MAKE_DIRECTORY ${ETHOS_SDK_PATH}/../ethos_u)
5353

5454
include(FetchContent)
55-
set(ethos_u_base_rev "25.02")
55+
set(ethos_u_base_tag "25.05")
5656
FetchContent_Declare(
5757
ethos_u
5858
GIT_REPOSITORY https://git.gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u.git
59-
GIT_TAG ${ethos_u_base_rev}
59+
GIT_TAG ${ethos_u_base_tag}
6060
SOURCE_DIR ${ETHOS_SDK_PATH}
6161
BINARY_DIR ${ETHOS_SDK_PATH}
6262
SUBBUILD_DIR ${ETHOS_SDK_PATH}/../ethos_u-subbuild
@@ -65,17 +65,31 @@ if(FETCH_ETHOS_U_CONTENT)
6565

6666
FetchContent_MakeAvailable(ethos_u)
6767

68+
# Patch manifest to remove unused projects.
69+
set(patch_dir "${ET_DIR_PATH}/examples/arm/ethos-u-setup")
70+
set(ethos_u_base_rev "24950bd4381b6c51db0349a229f8ba86b8e1093f")
71+
execute_process(COMMAND bash -c "pwd && source backends/arm/scripts/utils.sh && patch_repo ${ETHOS_SDK_PATH} ${ethos_u_base_rev} ${patch_dir}"
72+
WORKING_DIRECTORY ${ET_DIR_PATH}
73+
COMMAND_ECHO STDOUT
74+
)
75+
6876
# Get ethos_u externals only if core_platform folder does not already exist.
6977
if(NOT EXISTS "${ETHOS_SDK_PATH}/core_platform")
70-
execute_process(COMMAND ${PYTHON_EXECUTABLE} fetch_externals.py -c ${ethos_u_base_rev}.json fetch
78+
execute_process(COMMAND ${PYTHON_EXECUTABLE} fetch_externals.py -c ${ethos_u_base_tag}.json fetch
7179
WORKING_DIRECTORY ${ETHOS_SDK_PATH}
7280
COMMAND_ECHO STDOUT
7381
)
7482
endif()
7583

84+
# Patch core_software to remove unused projects.
85+
set(core_software_base_rev "55904c3da73c876c6d6c58290938ae217a8b94bd")
86+
execute_process(COMMAND bash -c "pwd && source backends/arm/scripts/utils.sh && patch_repo ${ETHOS_SDK_PATH}/core_software ${core_software_base_rev} ${patch_dir}"
87+
WORKING_DIRECTORY ${ET_DIR_PATH}
88+
COMMAND_ECHO STDOUT
89+
)
90+
7691
# Always patch the core_platform repo since this is fast enough.
7792
set(core_platform_base_rev "1916a9c984819c35b19c9e5c4c80d47e4e866420")
78-
set(patch_dir "${ET_DIR_PATH}/examples/arm/ethos-u-setup")
7993
execute_process(COMMAND bash -c "pwd && source backends/arm/scripts/utils.sh && patch_repo ${ETHOS_SDK_PATH}/core_platform ${core_platform_base_rev} ${patch_dir}"
8094
WORKING_DIRECTORY ${ET_DIR_PATH}
8195
COMMAND_ECHO STDOUT

0 commit comments

Comments
 (0)