diff --git a/.github/workflows/scripts/run-tutorial-notebook.sh b/.github/workflows/scripts/run-tutorial-notebook.sh index 3ff5cce..fe5a5f6 100755 --- a/.github/workflows/scripts/run-tutorial-notebook.sh +++ b/.github/workflows/scripts/run-tutorial-notebook.sh @@ -23,6 +23,12 @@ time { echo "::endgroup::" cd "$working_directory" + +# Prevent DataLoader from freezing during training. +# https://github.com/pytorch/pytorch/issues/15808#issuecomment-1291514752 +export OMP_NUM_THREADS=1 +export MKL_NUM_THREADS=1 + # We may set a timeout (for each cell) to ensure in-progress notebooks and logs are saved, # even if the workflow hits the total 6-hour limit in GitHub Actions. if [ "$timeout" -ne 0 ]; then