Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tools/windows/run_unittests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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**********"
Expand Down