Skip to content

Commit 3da2658

Browse files
zingofacebook-github-bot
authored andcommitted
Arm backend: Change run.sh to let cmake decide number of parallel jobs (pytorch#5813)
Summary: Instead of specifying number of parallel jobs let cmake decide for it self. This make this script work better on macOS and might speed up builds as more parallel jobs are used. Pull Request resolved: pytorch#5813 Reviewed By: mergennachin Differential Revision: D63809604 Pulled By: digantdesai fbshipit-source-id: 905fde94a270cd2cacb1257857962ad507a4cbc5
1 parent b78ec1b commit 3da2658

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

examples/arm/run.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ function build_quantization_aot_lib()
119119
-Bcmake-out-aot-lib \
120120
"${et_root_dir}"
121121

122-
n=$(nproc)
123-
cmake --build cmake-out-aot-lib -j"$((n - 5))" -- quantized_ops_aot_lib
122+
cmake --build cmake-out-aot-lib --parallel -- quantized_ops_aot_lib
124123
}
125124

126125

@@ -148,8 +147,7 @@ function build_executorch() {
148147

149148
echo "[${FUNCNAME[0]}] Configured CMAKE"
150149

151-
n=$(nproc)
152-
cmake --build ${et_build_dir} -j"$((n - 5))" --target install --config Release
150+
cmake --build ${et_build_dir} --parallel --target install --config Release
153151

154152
cmake \
155153
-DCMAKE_INSTALL_PREFIX=${et_build_dir} \
@@ -159,7 +157,7 @@ function build_executorch() {
159157
-DCMAKE_TOOLCHAIN_FILE="${toolchain_cmake}" \
160158
-B"${et_build_dir}"/examples/arm \
161159
"${et_root_dir}"/examples/arm
162-
cmake --build ${et_build_dir}/examples/arm -- -j"$((n - 5))"
160+
cmake --build ${et_build_dir}/examples/arm --parallel --
163161

164162
set +x
165163

@@ -190,8 +188,7 @@ function build_executorch_runner() {
190188
-DPYTHON_EXECUTABLE=$(which python3)
191189
echo "[${FUNCNAME[0]}] Configured CMAKE"
192190

193-
n=$(nproc)
194-
cmake --build ${executor_runner_path}/cmake-out -- -j"$((n - 5))" arm_executor_runner
191+
cmake --build ${executor_runner_path}/cmake-out --parallel -- arm_executor_runner
195192
echo "[${FUNCNAME[0]}] Generated baremetal elf file:"
196193
find ${executor_runner_path}/cmake-out -name "arm_executor_runner"
197194
echo "executable_text: $(find ${executor_runner_path}/cmake-out -name arm_executor_runner -exec size {} \; | grep -v filename | awk '{print $1}') bytes"

0 commit comments

Comments
 (0)