From f83abedb3e9d0a262a02808b48bd7e6a955a251d Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Tue, 4 Nov 2025 23:55:27 +0100 Subject: [PATCH 1/2] torch: reduce parallel build process --- torch-build-env.file | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/torch-build-env.file b/torch-build-env.file index 3ade2d331c8..0c6a5a41621 100644 --- a/torch-build-env.file +++ b/torch-build-env.file @@ -18,7 +18,11 @@ fi export USE_CUDNN=OFF %endif -export MAX_JOBS=%compiling_processes +MEM_GB=$(/usr/bin/free -g | awk '/^Mem:/{print $2}') +MAX_JOBS=$(( MEM_GB / 4 )) +if [ $MAX_JOBS -gt %{compiling_processes} ] ; then MAX_JOBS=%{compiling_processes}; fi +if [ $MAX_JOBS -lt 1 ]; then MAX_JOBS=1; fi +export MAX_JOBS export GCC_ROOT=${GCC_ROOT} export LibLZMA_ROOT=${XZ_ROOT} export USE_SYSTEM_PSIMD=ON From f8037ac456e4c25b8dd1ba5f1193d3eb6a380a20 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Wed, 5 Nov 2025 00:04:40 +0100 Subject: [PATCH 2/2] remobe duplicate env setup --- torch-build-env.file | 3 --- 1 file changed, 3 deletions(-) diff --git a/torch-build-env.file b/torch-build-env.file index 0c6a5a41621..90b9b1cf3d4 100644 --- a/torch-build-env.file +++ b/torch-build-env.file @@ -29,7 +29,6 @@ export USE_SYSTEM_PSIMD=ON export PSIMD_SOURCE_DIR=${PSIMD_ROOT} export BUILD_CUSTOM_PROTOBUF=OFF export USE_SYSTEM_EIGEN_INSTALL=ON -export USE_SYSTEM_PSIMD=ON export USE_SYSTEM_FXDIV=ON export USE_SYSTEM_PYBIND11=ON export PYBIND11_SYSPATH=${PY3_PYBIND11_ROOT} @@ -54,9 +53,7 @@ export USE_NUMA=ON export NUMA_ROOT_DIR=${NUMACTL_ROOT} export USE_NUMPY=OFF export USE_OPENMP=ON -export USE_QNNPACK=OFF export USE_VALGRIND=OFF -export USE_XNNPACK=OFF export USE_MKLDNN=OFF export USE_DISTRIBUTED=OFF export USE_MPI=ON