Skip to content

Commit

Permalink
Merge pull request #325 from chainer-ci/bp-322-v11-cuda12x
Browse files Browse the repository at this point in the history
[backport] Support CUDA 12.0
  • Loading branch information
kmaehashi authored Jan 18, 2023
2 parents 11092b8 + ad17849 commit d4b62bb
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 204 deletions.
4 changes: 2 additions & 2 deletions .pfnci/build_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ submit_job() {
submit_job cupy-wheel-linux ".pfnci/wheel-linux/main.sh sdist 3.7 ${BRANCH} ${JOB_GROUP}"

# wheels (Linux)
for CUDA in 10.2 11.0 11.1 11.x; do
for CUDA in 10.2 11.0 11.1 11.x 12.x; do
submit_job cupy-wheel-linux ".pfnci/wheel-linux/main.sh ${CUDA} 3.7,3.8,3.9,3.10,3.11 ${BRANCH} ${JOB_GROUP}"
done

# wheels (Windows)
for CUDA in 10.2 11.0 11.1 11.x; do
for CUDA in 10.2 11.0 11.1 11.x 12.x; do
for PYTHON in 3.7 3.8 3.9 3.10 3.11; do
submit_job cupy-wheel-win ".pfnci\\wheel-windows\\main.bat ${CUDA} ${PYTHON} ${BRANCH} ${JOB_GROUP}"
done
Expand Down
4 changes: 2 additions & 2 deletions .pfnci/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ configs {
time_limit {
seconds: 10800
}
command: ".pfnci/wheel-linux/main.sh 11.x 3.7"
command: ".pfnci/wheel-linux/main.sh 12.x 3.7"
}
}
configs {
Expand Down Expand Up @@ -56,7 +56,7 @@ configs {
time_limit {
seconds: 10800
}
command: ".pfnci\\wheel-windows\\main.bat 11.x 3.11"
command: ".pfnci\\wheel-windows\\main.bat 12.x 3.11"
}
}
configs {
Expand Down
49 changes: 35 additions & 14 deletions .pfnci/wheel-windows/_flexci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,7 @@ function ActivatePython($version) {
}

function ActivateCUDA($version) {
if ($version -eq "8.0") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V8_0
} elseif ($version -eq "9.0") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V9_0
} elseif ($version -eq "9.1") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V9_1
} elseif ($version -eq "9.2") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V9_2
} elseif ($version -eq "10.0") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V10_0
} elseif ($version -eq "10.1") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V10_1
} elseif ($version -eq "10.2") {
if ($version -eq "10.2") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V10_2
} elseif ($version -eq "11.0") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V11_0
Expand All @@ -54,10 +42,43 @@ function ActivateCUDA($version) {
$Env:CUDA_PATH = $Env:CUDA_PATH_V11_8
} elseif ($version -eq "11.x") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V11_8
} elseif ($version -eq "12.0") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V12_0
} elseif ($version -eq "12.x") {
$Env:CUDA_PATH = $Env:CUDA_PATH_V12_0
} else {
throw "Unsupported CUDA version: $version"
}
$Env:PATH = "$Env:CUDA_PATH\bin;$Env:ProgramFiles\NVIDIA Corporation\NvToolsExt\bin\x64;" + $Env:PATH
$Env:PATH = "$Env:CUDA_PATH\bin;" + $Env:PATH
}

function ActivateCuDNN($cudnn_version, $cuda_version) {
if ($cudnn_version -eq "8.6") {
$cudnn = "v8.6.0"
} else {
throw "Unsupported cuDNN version: $cudnn_version"
}

if ($cuda_version -eq "10.2") {
$cuda = "10"
} elseif ($cuda_version.startswith("11.")) {
$cuda = "11"
} else {
throw "Unsupported CUDA version: $cuda_version"
}

$base = "C:\Development\cuDNN\$cudnn\cuda$cuda"
$Env:CL = "-I$base\include " + $Env:CL
$Env:LINK = "/LIBPATH:$base\lib\x64 " + $Env:LINK
$Env:PATH = "$base\bin;" + $Env:PATH
}

function ActivateNVTX1() {
$base = "C:\Development\NvToolsExt"
$Env:NVTOOLSEXT_PATH = "C:\Development\NvToolsExt"
$Env:CL = "-I$base\include " + $Env:CL
$Env:LINK = "/LIBPATH:$base\lib\x64 " + $Env:LINK
$Env:PATH = "$base\bin\x64;" + $Env:PATH
}

function IsPullRequestTest() {
Expand Down
15 changes: 7 additions & 8 deletions .pfnci/wheel-windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,10 @@ function UninstallCuTENSOR($cuda_path) {
}
}

# Uninstall existing cuDNN for the default CUDA
$cuda_path = $Env:CUDA_PATH
UninstallCuDNN $cuda_path

# Activate target CUDA and uninstall existing cuDNN for the target CUDA
ActivateCUDA $cuda
ActivateNVTX1
$cuda_path = $Env:CUDA_PATH
UninstallCuDNN $cuda_path

# Note: cuTENSOR is not installed by default, so no need to remove it.

# Activate target Python
ActivatePython $python
Expand Down Expand Up @@ -98,7 +92,12 @@ Copy-Item -Path "dll_x64\zlibwapi.dll" -Destination "C:\Windows\System32"

# Verify
echo ">> Starting verification..."
RunOrDie python ./dist.py --action verify --target wheel-win --python $python --cuda $cuda --dist $wheel_file --test release-tests/common --test release-tests/cudnn --test release-tests/pkg_wheel
if ($cuda -eq "12.x") {
# TODO(kmaehashi): cuDNN for CUDA 12 not available yet
RunOrDie python ./dist.py --action verify --target wheel-win --python $python --cuda $cuda --dist $wheel_file --test release-tests/common --test release-tests/pkg_wheel
} else {
RunOrDie python ./dist.py --action verify --target wheel-win --python $python --cuda $cuda --dist $wheel_file --test release-tests/common --test release-tests/cudnn --test release-tests/pkg_wheel
}

# Show build configuration in CuPy
echo ">> Build configuration"
Expand Down
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ case ${CUDA} in
# CUDA Jetson (wheel)
VERIFY_ARGS="${VERIFY_ARGS} --test release-tests/sparse --test release-tests/cudnn"
;;
12.x )
# CUDA 12.0 (wheel) -- cuDNN not available yet
VERIFY_ARGS="${VERIFY_ARGS} --test release-tests/sparse --test release-tests/nccl --test release-tests/pkg_wheel"
;;
rocm-* )
# ROCm (wheel)
VERIFY_ARGS="${VERIFY_ARGS}"
Expand Down
10 changes: 10 additions & 0 deletions builder/base/cuda-runfile/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ case ${CUDA} in
BASE_IMAGE="oraclelinux:8"
IMAGE_SUFFIX="el8"
;;
12.0 )
CUDA_VERSION="12.0.0"
CUDA_INSTALLER_URL="https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda_12.0.0_525.60.13_linux.run"
;;
12.0-aarch64 )
CUDA_VERSION="12.0.0"
CUDA_INSTALLER_URL="https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda_12.0.0_525.60.13_linux_sbsa.run"
BASE_IMAGE="oraclelinux:8"
IMAGE_SUFFIX="el8"
;;
* )
echo "Unknown CUDA version: ${CUDA}"
exit 1
Expand Down
3 changes: 3 additions & 0 deletions check_release_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
('cupy-cuda110', _v11_cuda_matrix),
('cupy-cuda111', _v11_cuda_matrix),
('cupy-cuda11x', _v11_cuda_matrix),
('cupy-cuda12x', _v11_cuda_matrix),
('cupy-rocm-4-3', _v11_rocm_matrix),
('cupy-rocm-5-0', _v11_rocm_matrix),
],
Expand All @@ -55,6 +56,7 @@
('cupy-cuda110', _v12_cuda_matrix),
('cupy-cuda111', _v12_cuda_matrix),
('cupy-cuda11x', _v12_cuda_matrix + _v12_aarch64_matrix),
('cupy-cuda12x', _v12_cuda_matrix + _v12_aarch64_matrix),
('cupy-rocm-4-3', _v12_rocm_matrix),
('cupy-rocm-5-0', _v12_rocm_matrix),
],
Expand All @@ -64,6 +66,7 @@
('cupy-cuda110', _v11_cuda_matrix),
('cupy-cuda111', _v11_cuda_matrix),
('cupy-cuda11x', _v11_cuda_matrix + _v11_aarch64_matrix),
('cupy-cuda12x', _v11_cuda_matrix + _v11_aarch64_matrix),
('cupy-rocm-4-3', _v11_rocm_matrix),
('cupy-rocm-5-0', _v11_rocm_matrix),
],
Expand Down
Loading

0 comments on commit d4b62bb

Please sign in to comment.