Skip to content

check_binary: Don't muddle for the rest of the checks #453

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

Merged
merged 1 commit into from
Jun 9, 2020
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: 5 additions & 3 deletions check_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,7 @@ if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
build_example_cpp_with_incorrect_abi simple-torch-test
fi
else
TMP_DIR=$(mktemp -d)
trap 'rm -rf ${TMP_DIR}' EXIT
pushd "${TMP_DIR}" # To attempt to not muddle results with local python path
pushd /tmp
python -c 'import torch'
python -c 'from caffe2.python import core'
popd
Expand All @@ -329,7 +327,9 @@ if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
else
if [[ "$(uname)" != 'Darwin' || "$PACKAGE_TYPE" != *wheel ]]; then
echo "Checking that MKL is available"
pushd /tmp
python -c 'import torch; exit(0 if torch.backends.mkl.is_available() else 1)'
popd
fi
fi

Expand All @@ -351,6 +351,7 @@ if [[ "$DESIRED_CUDA" != 'cpu' ]]; then
if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
build_and_run_example_cpp check-torch-cuda
else
pushd /tmp
echo "Checking that CUDA archs are setup correctly"
timeout 20 python -c 'import torch; torch.randn([3,5]).cuda()'

Expand All @@ -361,5 +362,6 @@ if [[ "$DESIRED_CUDA" != 'cpu' ]]; then

echo "Checking that CuDNN is available"
python -c 'import torch; exit(0 if torch.backends.cudnn.is_available() else 1)'
popd
fi # if libtorch
fi # if cuda