-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into models/replace_se
- Loading branch information
Showing
26 changed files
with
357 additions
and
111 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,48 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
if [ "${CU_VERSION:-}" == "cpu" ] ; then | ||
exit 0 | ||
fi | ||
echo CU_VERSION is "${CU_VERSION}" | ||
echo CUDA_VERSION is "${CUDA_VERSION}" | ||
|
||
if [[ ${#CU_VERSION} -eq 5 ]]; then | ||
CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}" | ||
# Currenly, CU_VERSION and CUDA_VERSION are not consistent. | ||
# to understand this code, see https://github.com/pytorch/vision/issues/4443 | ||
version="cpu" | ||
if [[ ! -z "${CUDA_VERSION}" ]] ; then | ||
version="$CUDA_VERSION" | ||
else | ||
if [[ ${#CU_VERSION} -eq 5 ]]; then | ||
version="${CU_VERSION:2:2}.${CU_VERSION:4:1}" | ||
fi | ||
fi | ||
|
||
# It's a log to see if CU_VERSION exists, if not, we use environment CUDA_VERSION directly | ||
# in unittest_windows_gpu, there's no CU_VERSION, but CUDA_VERSION. | ||
echo "Using CUDA $CUDA_VERSION, CU_VERSION is $CU_VERSION now" | ||
# Don't use if [[ "$version" == "cpu" ]]; then exit 0 fi. | ||
# It would exit the shell. One result is cpu tests would not run if the shell exit. | ||
# Unless there's an error, Don't exit. | ||
if [[ "$version" != "cpu" ]]; then | ||
# set cuda envs | ||
export PATH="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${version}/bin:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${version}/libnvvp:$PATH" | ||
export CUDA_PATH_V${version/./_}="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${version}" | ||
export CUDA_PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${version}" | ||
|
||
version=$CUDA_VERSION | ||
if [ ! -d "$CUDA_PATH" ]; then | ||
echo "$CUDA_PATH" does not exist | ||
exit 1 | ||
fi | ||
|
||
# set cuda envs | ||
export PATH="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${version}/bin:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${version}/libnvvp:$PATH" | ||
export CUDA_PATH_V${version/./_}="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${version}" | ||
export CUDA_PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${version}" | ||
if [ ! -f "${CUDA_PATH}\include\nvjpeg.h" ]; then | ||
echo "nvjpeg does not exist" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d "$CUDA_PATH" ] | ||
then | ||
echo "$CUDA_PATH" does not exist | ||
exit 1 | ||
fi | ||
# check cuda driver version | ||
for path in '/c/Program Files/NVIDIA Corporation/NVSMI/nvidia-smi.exe' /c/Windows/System32/nvidia-smi.exe; do | ||
if [[ -x "$path" ]]; then | ||
"$path" || echo "true"; | ||
break | ||
fi | ||
done | ||
|
||
# check cuda driver version | ||
for path in '/c/Program Files/NVIDIA Corporation/NVSMI/nvidia-smi.exe' /c/Windows/System32/nvidia-smi.exe; do | ||
if [[ -x "$path" ]]; then | ||
"$path" || echo "true"; | ||
break | ||
fi | ||
done | ||
which nvcc | ||
which nvcc | ||
nvcc --version | ||
env | grep CUDA | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _ops: | ||
|
||
torchvision.ops | ||
=============== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _utils: | ||
|
||
torchvision.utils | ||
================= | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.