未验证 提交 c28bb981 编写于 作者: S Sing_chan 提交者: GitHub

set parallel_job according to CUDA memory in Windows CI unittest (#44695)

* set parallel_job according to CUDA memory

* fix bug: add whitespace between conten and [] or condition wont work
上级 ffb31540
......@@ -336,7 +336,13 @@ function run_unittest_gpu() {
if [ "$2" == "" ]; then
parallel_job=$parallel_level_base
else
parallel_job=`expr $2 \* $parallel_level_base`
# set parallel_job according to CUDA memory and suggested parallel num,
# the latter is derived in linux server with 16G CUDA memory.
cuda_memory=$(nvidia-smi --query-gpu=memory.total --format=csv | tail -1 | awk -F ' ' '{print $1}')
parallel_job=$(($2 * $cuda_memory / 16000))
if [ $parallel_job -lt 1 ]; then
parallel_job=1
fi
fi
echo "************************************************************************"
echo "********These unittests run $parallel_job job each time with 1 GPU**********"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册