areusch commented on a change in pull request #8576:
URL: https://github.com/apache/tvm/pull/8576#discussion_r745244485
##########
File path: tests/scripts/setup-pytest-env.sh
##########
@@ -32,7 +32,35 @@ export PYTHONPATH="${TVM_PATH}/python"
export TVM_PYTEST_RESULT_DIR="${TVM_PATH}/build/pytest-results"
mkdir -p "${TVM_PYTEST_RESULT_DIR}"
+if [ -n "${CI_CPUSET_NUM_CPUS-}" ]; then
+ # When the # of CPUs has been restricted (e.g. when --cpuset-cpus has been
passed to docker by
+ # docker/bash.sh), explicitly use all available CPUs. This environment
variable is set by
+ # docker/bash.sh when it sets --cpuset-cpus.
+ PYTEST_NUM_CPUS="${CI_CPUSET_NUM_CPUS}"
+else
+ # Else attempt to use $(nproc) - 1.
+ PYTEST_NUM_CPUS=$(nproc)
+ if [ -z "${PYTEST_NUM_CPUS}" ]; then
+ echo "WARNING: nproc failed; running pytest with only 1 CPU"
+ PYTEST_NUM_CPUS=1
+ elif [ ${PYTEST_NUM_CPUS} -gt 1 ]; then
+ PYTEST_NUM_CPUS=$(expr ${PYTEST_NUM_CPUS} - 1) # Don't nuke
interactive work.
+ fi
+
+ # Don't use >4 CPUs--in general, we only use 4 CPUs in testing, so we want
to retain this
Review comment:
4 just relates to how we currently allocate Jenkins executors to CI
nodes. what i really want to do is make it possible to use $(nproc) here always
(so that each node is maximally used). however, initial tests indicate that
there is a threshold after which nodes become RAM-limited.
can you clarify your second question? how would we leverage this better in
the subset?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]