Skip to content

Commit b8e77a4

Browse files
malfetzasdfgbnm
andauthored
Add CUDA11 build and test (pytorch#40452) (pytorch#41543)
Summary: Pull Request resolved: pytorch#40452 Differential Revision: D22316007 Pulled By: malfet fbshipit-source-id: 94f4b4ba2a46ff3d3042ba842a615f8392cdc350 Co-authored-by: Gao, Xiang <[email protected]>
1 parent 4081fdd commit b8e77a4

File tree

5 files changed

+73
-8
lines changed

5 files changed

+73
-8
lines changed

.circleci/cimodel/data/pytorch_build_data.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
("libtorch", [XImportant(True)])
3737
]),
3838
]),
39+
("11.0", [
40+
X("3.8"),
41+
("3.8", [
42+
("libtorch", [X(True)])
43+
]),
44+
]),
3945
]),
4046
]),
4147
("bionic", [

.circleci/cimodel/data/pytorch_build_definitions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def get_parms(self, for_docker):
4949

5050
cuda_parms = []
5151
if self.cuda_version:
52-
cuda_parms.extend(["cuda" + self.cuda_version, "cudnn7"])
52+
cudnn = "cudnn8" if self.cuda_version.startswith("11.") else "cudnn7"
53+
cuda_parms.extend(["cuda" + self.cuda_version, cudnn])
5354
result = leading + ["linux", self.distro] + cuda_parms + self.parms
5455
if not for_docker and self.parms_list_ignored_for_docker_image is not None:
5556
result = result + self.parms_list_ignored_for_docker_image
@@ -222,8 +223,7 @@ def instantiate_configs():
222223
python_version = fc.find_prop("pyver")
223224
parms_list[0] = fc.find_prop("abbreviated_pyver")
224225

225-
if cuda_version in ["9.2", "10", "10.1", "10.2"]:
226-
# TODO The gcc version is orthogonal to CUDA version?
226+
if cuda_version:
227227
cuda_gcc_version = fc.find_prop("cuda_gcc_override") or "gcc7"
228228
parms_list.append(cuda_gcc_version)
229229

.circleci/config.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7396,6 +7396,54 @@ workflows:
73967396
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7:209062ef-ab58-422a-b295-36c4eed6e906"
73977397
use_cuda_docker_runtime: "1"
73987398
resource_class: gpu.medium
7399+
- pytorch_linux_build:
7400+
name: pytorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_build
7401+
filters:
7402+
branches:
7403+
only:
7404+
- master
7405+
- /ci-all\/.*/
7406+
- /release\/.*/
7407+
build_environment: "pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7-build"
7408+
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7:209062ef-ab58-422a-b295-36c4eed6e906"
7409+
- pytorch_linux_test:
7410+
name: pytorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_test
7411+
requires:
7412+
- pytorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_build
7413+
filters:
7414+
branches:
7415+
only:
7416+
- master
7417+
- /ci-all\/.*/
7418+
- /release\/.*/
7419+
build_environment: "pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7-test"
7420+
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7:209062ef-ab58-422a-b295-36c4eed6e906"
7421+
use_cuda_docker_runtime: "1"
7422+
resource_class: gpu.medium
7423+
- pytorch_linux_build:
7424+
name: pytorch_libtorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_build
7425+
filters:
7426+
branches:
7427+
only:
7428+
- master
7429+
- /ci-all\/.*/
7430+
- /release\/.*/
7431+
build_environment: "pytorch-libtorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7-build"
7432+
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7:209062ef-ab58-422a-b295-36c4eed6e906"
7433+
- pytorch_linux_test:
7434+
name: pytorch_libtorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_test
7435+
requires:
7436+
- pytorch_libtorch_linux_xenial_cuda11_0_cudnn8_py3_gcc7_build
7437+
filters:
7438+
branches:
7439+
only:
7440+
- master
7441+
- /ci-all\/.*/
7442+
- /release\/.*/
7443+
build_environment: "pytorch-libtorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7-test"
7444+
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda11.0-cudnn8-py3-gcc7:209062ef-ab58-422a-b295-36c4eed6e906"
7445+
use_cuda_docker_runtime: "1"
7446+
resource_class: gpu.medium
73997447
- pytorch_linux_build:
74007448
name: pytorch_linux_bionic_py3_6_clang9_build
74017449
build_environment: "pytorch-linux-bionic-py3.6-clang9-build"

aten/src/ATen/cudnn/Handle.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ void destroyCuDNNHandle(cudnnHandle_t handle) {
1616
// happens in fbcode setting. @colesbury and I decided to not destroy
1717
// the handle as a workaround.
1818
// - @soumith
19-
#ifdef NO_CUDNN_DESTROY_HANDLE
20-
#else
21-
cudnnDestroy(handle);
22-
#endif
19+
//
20+
// Further note: this is now disabled globally, because we are seeing
21+
// the same issue as mentioned above in CUDA 11 CI.
22+
// - @zasdfgbnm
23+
//
24+
// #ifdef NO_CUDNN_DESTROY_HANDLE
25+
// #else
26+
// cudnnDestroy(handle);
27+
// #endif
2328
}
2429

2530
using CudnnPoolType = at::cuda::DeviceThreadHandlePool<cudnnHandle_t, createCuDNNHandle, destroyCuDNNHandle>;

c10/cuda/CUDAStream.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,16 @@ class C10_CUDA_API CUDAStream {
155155

156156
static std::tuple<int, int> priority_range() {
157157
#ifndef __HIP_PLATFORM_HCC__
158+
// Note: this returns the range of priority **supported by PyTorch**, not
159+
// the range of priority **supported by CUDA**. The former is a subset of
160+
// the latter. Curently PyTorch only supports 0 and -1, which are "low" and
161+
// "high" priority.
158162
int least_priority, greatest_priority;
159163
C10_CUDA_CHECK(
160164
cudaDeviceGetStreamPriorityRange(&least_priority, &greatest_priority));
161-
return std::make_tuple(least_priority, greatest_priority);
165+
TORCH_INTERNAL_ASSERT(least_priority >= 0, "Unexpected CUDA stream priority range");
166+
TORCH_INTERNAL_ASSERT(greatest_priority <= -1, "Unexpected CUDA stream priority range");
167+
return std::make_tuple(0, -1);
162168
#else
163169
AT_ERROR("cuDeviceGetStreamPriorityRange with HIP is not supported");
164170
#endif

0 commit comments

Comments
 (0)