Skip to content

Commit 69b0f4d

Browse files
committed
Update on "Structured kernels generate Meta registrations"
If you port kernels to be structured, you get Meta kernels automatically generated for you. This is one payoff of structured kernels. Code generation was mercifully really simple, although at risk of "swiss cheese" syndrome: there's two new conditionals in the codegen to tweak behavior when generating for meta keys. It's not too bad right now but there's a risk of things getting out of hand. One way to rationalize the logic here would be to transmit "TensorMeta-ness" inside the TensorOptions (so tensor_from_meta can deal with it); then the "Meta" kernel magic would literally just be generating empty out_impls to call after all the scaffolding is done. But I didn't do this because it seemed like it would be more annoying short term. Also had to teach resize_ to work on meta tensors, since we use them to implement the out kernels. Signed-off-by: Edward Z. Yang <[email protected]> Differential Revision: [D25056640](https://our.internmc.facebook.com/intern/diff/D25056640) [ghstack-poisoned]
2 parents 32d61df + ad283b6 commit 69b0f4d

File tree

188 files changed

+3877
-1661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+3877
-1661
lines changed

.circleci/cimodel/data/pytorch_build_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
]),
9494
]),
9595
("rocm", [
96-
("3.7", [
96+
("3.9", [
9797
("3.6", [
9898
('build_only', [XImportant(True)]),
9999
]),

.circleci/cimodel/data/simple/docker_definitions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"pytorch-linux-xenial-py3.6-gcc5.4", # this one is used in doc builds
3030
"pytorch-linux-xenial-py3.6-gcc7.2",
3131
"pytorch-linux-xenial-py3.6-gcc7",
32-
"pytorch-linux-bionic-rocm3.7-py3.6",
3332
"pytorch-linux-bionic-rocm3.8-py3.6",
3433
"pytorch-linux-bionic-rocm3.9-py3.6",
3534
]

.circleci/cimodel/data/windows_build_definitions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ def TruePred(_):
131131
WindowsJob(None, _VC2019, CudaVersion(10, 1)),
132132
WindowsJob(1, _VC2019, CudaVersion(10, 1)),
133133
WindowsJob(2, _VC2019, CudaVersion(10, 1)),
134-
# VS2019 CUDA-11.0
135-
WindowsJob(None, _VC2019, CudaVersion(11, 0)),
136-
WindowsJob(1, _VC2019, CudaVersion(11, 0), master_only_pred=TruePred),
137-
WindowsJob(2, _VC2019, CudaVersion(11, 0), master_only_pred=TruePred),
134+
# VS2019 CUDA-11.1
135+
WindowsJob(None, _VC2019, CudaVersion(11, 1)),
136+
WindowsJob(1, _VC2019, CudaVersion(11, 1), master_only_pred=TruePred),
137+
WindowsJob(2, _VC2019, CudaVersion(11, 1), master_only_pred=TruePred),
138138
# VS2019 CPU-only
139139
WindowsJob(None, _VC2019, None),
140140
WindowsJob(1, _VC2019, None, master_only_pred=TruePred),

.circleci/config.yml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,8 @@ jobs:
453453
no_output_timeout: "1h"
454454
command: |
455455
set -e
456-
# TODO: Remove this after we figure out why rocm tests are failing
457-
if [[ "${DOCKER_IMAGE}" == *rocm3.5* ]]; then
458-
export DOCKER_TAG="ab1632df-fa59-40e6-8c23-98e004f61148"
459-
fi
460-
if [[ "${DOCKER_IMAGE}" == *rocm3.7* ]]; then
461-
export DOCKER_TAG="1045c7b891104cb4fd23399eab413b6213e48aeb"
456+
if [[ "${DOCKER_IMAGE}" == *rocm3.9* ]]; then
457+
export DOCKER_TAG="f3d89a32912f62815e4feaeed47e564e887dffd6"
462458
fi
463459
if [[ ${BUILD_ENVIRONMENT} == *"pure_torch"* ]]; then
464460
echo 'BUILD_CAFFE2=OFF' >> "${BASH_ENV}"
@@ -538,12 +534,8 @@ jobs:
538534
command: |
539535
set -e
540536
export PYTHONUNBUFFERED=1
541-
# TODO: Remove this after we figure out why rocm tests are failing
542-
if [[ "${DOCKER_IMAGE}" == *rocm3.5* ]]; then
543-
export DOCKER_TAG="ab1632df-fa59-40e6-8c23-98e004f61148"
544-
fi
545-
if [[ "${DOCKER_IMAGE}" == *rocm3.7* ]]; then
546-
export DOCKER_TAG="1045c7b891104cb4fd23399eab413b6213e48aeb"
537+
if [[ "${DOCKER_IMAGE}" == *rocm3.9* ]]; then
538+
export DOCKER_TAG="f3d89a32912f62815e4feaeed47e564e887dffd6"
547539
fi
548540
# See Note [Special build images]
549541
output_image=${DOCKER_IMAGE}:${DOCKER_TAG}-${CIRCLE_SHA1}
@@ -774,9 +766,6 @@ jobs:
774766
if [[ "${CUDA_VERSION}" != "10" || "${JOB_EXECUTOR}" != "windows-with-nvidia-gpu" ]]; then
775767
.circleci/scripts/windows_cuda_install.sh
776768
fi
777-
if [[ "${CUDA_VERSION}" != "10" && "${JOB_EXECUTOR}" == "windows-with-nvidia-gpu" ]]; then
778-
.circleci/scripts/driver_update.bat
779-
fi
780769
fi
781770
- run:
782771
name: Install Cudnn
@@ -7283,9 +7272,6 @@ workflows:
72837272
- docker_build_job:
72847273
name: "docker-pytorch-linux-xenial-py3.6-gcc7"
72857274
image_name: "pytorch-linux-xenial-py3.6-gcc7"
7286-
- docker_build_job:
7287-
name: "docker-pytorch-linux-bionic-rocm3.7-py3.6"
7288-
image_name: "pytorch-linux-bionic-rocm3.7-py3.6"
72897275
- docker_build_job:
72907276
name: "docker-pytorch-linux-bionic-rocm3.8-py3.6"
72917277
image_name: "pytorch-linux-bionic-rocm3.8-py3.6"
@@ -7716,11 +7702,11 @@ workflows:
77167702
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-bionic-py3.8-gcc9"
77177703
resource_class: large
77187704
- pytorch_linux_build:
7719-
name: pytorch_linux_bionic_rocm3_7_py3_6_build
7705+
name: pytorch_linux_bionic_rocm3_9_py3_6_build
77207706
requires:
7721-
- "docker-pytorch-linux-bionic-rocm3.7-py3.6"
7722-
build_environment: "pytorch-linux-bionic-rocm3.7-py3.6-build"
7723-
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-bionic-rocm3.7-py3.6"
7707+
- "docker-pytorch-linux-bionic-rocm3.9-py3.6"
7708+
build_environment: "pytorch-linux-bionic-rocm3.9-py3.6-build"
7709+
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-bionic-rocm3.9-py3.6"
77247710
resource_class: xlarge
77257711
- pytorch_macos_10_13_py3_build:
77267712
name: pytorch_macos_10_13_py3_build
@@ -8127,7 +8113,7 @@ workflows:
81278113
- pytorch_windows_build:
81288114
build_environment: pytorch-win-vs2019-cuda11-cudnn8-py3
81298115
cuda_version: "11"
8130-
name: pytorch_windows_vs2019_py36_cuda11.0_build
8116+
name: pytorch_windows_vs2019_py36_cuda11.1_build
81318117
python_version: "3.6"
81328118
use_cuda: "1"
81338119
vc_product: Community
@@ -8143,10 +8129,10 @@ workflows:
81438129
- master
81448130
- /ci-all\/.*/
81458131
- /release\/.*/
8146-
name: pytorch_windows_vs2019_py36_cuda11.0_test1
8132+
name: pytorch_windows_vs2019_py36_cuda11.1_test1
81478133
python_version: "3.6"
81488134
requires:
8149-
- pytorch_windows_vs2019_py36_cuda11.0_build
8135+
- pytorch_windows_vs2019_py36_cuda11.1_build
81508136
test_name: pytorch-windows-test1
81518137
use_cuda: "1"
81528138
vc_product: Community
@@ -8162,10 +8148,10 @@ workflows:
81628148
- master
81638149
- /ci-all\/.*/
81648150
- /release\/.*/
8165-
name: pytorch_windows_vs2019_py36_cuda11.0_test2
8151+
name: pytorch_windows_vs2019_py36_cuda11.1_test2
81668152
python_version: "3.6"
81678153
requires:
8168-
- pytorch_windows_vs2019_py36_cuda11.0_build
8154+
- pytorch_windows_vs2019_py36_cuda11.1_build
81698155
test_name: pytorch-windows-test2
81708156
use_cuda: "1"
81718157
vc_product: Community

.circleci/docker/build.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,6 @@ case "$image" in
274274
VISION=yes
275275
KATEX=yes
276276
;;
277-
pytorch-linux-bionic-rocm3.7-py3.6)
278-
ANACONDA_PYTHON_VERSION=3.6
279-
PROTOBUF=yes
280-
DB=yes
281-
VISION=yes
282-
ROCM_VERSION=3.7
283-
;;
284277
pytorch-linux-bionic-rocm3.8-py3.6)
285278
ANACONDA_PYTHON_VERSION=3.6
286279
PROTOBUF=yes
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
set "DRIVER_DOWNLOAD_LINK=https://s3.amazonaws.com/ossci-windows/451.82-tesla-desktop-winserver-2019-2016-international.exe"
2-
curl --retry 3 -kL %DRIVER_DOWNLOAD_LINK% --output 451.82-tesla-desktop-winserver-2019-2016-international.exe
1+
set "DRIVER_DOWNLOAD_LINK=https://s3.amazonaws.com/ossci-windows/452.39-data-center-tesla-desktop-win10-64bit-international.exe"
2+
curl --retry 3 -kL %DRIVER_DOWNLOAD_LINK% --output 452.39-data-center-tesla-desktop-win10-64bit-international.exe
33
if errorlevel 1 exit /b 1
44

5-
start /wait 451.82-tesla-desktop-winserver-2019-2016-international.exe -s -noreboot
5+
start /wait 452.39-data-center-tesla-desktop-win10-64bit-international.exe -s -noreboot
66
if errorlevel 1 exit /b 1
77

8-
del 451.82-tesla-desktop-winserver-2019-2016-international.exe || ver > NUL
8+
del 452.39-data-center-tesla-desktop-win10-64bit-international.exe || ver > NUL

.circleci/scripts/windows_cuda_install.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@ if [[ "$CUDA_VERSION" == "10" ]]; then
77
msbuild_project_dir="CUDAVisualStudioIntegration/extras/visual_studio_integration/MSBuildExtensions"
88
cuda_install_packages="nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 cublas_10.1 cublas_dev_10.1 cudart_10.1 cufft_10.1 cufft_dev_10.1 curand_10.1 curand_dev_10.1 cusolver_10.1 cusolver_dev_10.1 cusparse_10.1 cusparse_dev_10.1 nvgraph_10.1 nvgraph_dev_10.1 npp_10.1 npp_dev_10.1 nvrtc_10.1 nvrtc_dev_10.1 nvml_dev_10.1"
99
elif [[ "$CUDA_VERSION" == "11" ]]; then
10-
cuda_complete_version="11.0"
11-
cuda_installer_name="cuda_11.0.2_451.48_win10"
10+
cuda_complete_version="11.1"
11+
cuda_installer_name="cuda_11.1.0_456.43_win10"
1212
msbuild_project_dir="visual_studio_integration/CUDAVisualStudioIntegration/extras/visual_studio_integration/MSBuildExtensions"
13-
cuda_install_packages="nvcc_11.0 cuobjdump_11.0 nvprune_11.0 nvprof_11.0 cupti_11.0 cublas_11.0 cublas_dev_11.0 cudart_11.0 cufft_11.0 cufft_dev_11.0 curand_11.0 curand_dev_11.0 cusolver_11.0 cusolver_dev_11.0 cusparse_11.0 cusparse_dev_11.0 npp_11.0 npp_dev_11.0 nvrtc_11.0 nvrtc_dev_11.0 nvml_dev_11.0"
13+
cuda_install_packages="nvcc_11.1 cuobjdump_11.1 nvprune_11.1 nvprof_11.1 cupti_11.1 cublas_11.1 cublas_dev_11.1 cudart_11.1 cufft_11.1 cufft_dev_11.1 curand_11.1 curand_dev_11.1 cusolver_11.1 cusolver_dev_11.1 cusparse_11.1 cusparse_dev_11.1 npp_11.1 npp_dev_11.1 nvrtc_11.1 nvrtc_dev_11.1 nvml_dev_11.1"
1414
else
1515
echo "CUDA_VERSION $CUDA_VERSION is not supported yet"
1616
exit 1
1717
fi
1818

19+
if [[ "${CUDA_VERSION}" != "10" && "${JOB_EXECUTOR}" == "windows-with-nvidia-gpu" ]]; then
20+
cuda_install_packages="${cuda_install_packages} Display.Driver"
21+
fi
22+
1923
cuda_installer_link="https://ossci-windows.s3.amazonaws.com/${cuda_installer_name}.exe"
2024

2125
curl --retry 3 -kLO $cuda_installer_link

.circleci/scripts/windows_cudnn_install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ if [[ "$CUDA_VERSION" == "10" ]]; then
55
cuda_complete_version="10.1"
66
cudnn_installer_name="cudnn-10.1-windows10-x64-v7.6.4.38"
77
elif [[ "$CUDA_VERSION" == "11" ]]; then
8-
cuda_complete_version="11.0"
9-
cudnn_installer_name="cudnn-11.0-windows-x64-v8.0.4.30"
8+
cuda_complete_version="11.1"
9+
cudnn_installer_name="cudnn-11.1-windows-x64-v8.0.5.39"
1010
else
1111
echo "CUDNN for CUDA_VERSION $CUDA_VERSION is not supported yet"
1212
exit 1

.circleci/verbatim-sources/job-specs/pytorch-job-specs.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@ jobs:
1515
no_output_timeout: "1h"
1616
command: |
1717
set -e
18-
# TODO: Remove this after we figure out why rocm tests are failing
19-
if [[ "${DOCKER_IMAGE}" == *rocm3.5* ]]; then
20-
export DOCKER_TAG="ab1632df-fa59-40e6-8c23-98e004f61148"
21-
fi
22-
if [[ "${DOCKER_IMAGE}" == *rocm3.7* ]]; then
23-
export DOCKER_TAG="1045c7b891104cb4fd23399eab413b6213e48aeb"
18+
if [[ "${DOCKER_IMAGE}" == *rocm3.9* ]]; then
19+
export DOCKER_TAG="f3d89a32912f62815e4feaeed47e564e887dffd6"
2420
fi
2521
if [[ ${BUILD_ENVIRONMENT} == *"pure_torch"* ]]; then
2622
echo 'BUILD_CAFFE2=OFF' >> "${BASH_ENV}"
@@ -100,12 +96,8 @@ jobs:
10096
command: |
10197
set -e
10298
export PYTHONUNBUFFERED=1
103-
# TODO: Remove this after we figure out why rocm tests are failing
104-
if [[ "${DOCKER_IMAGE}" == *rocm3.5* ]]; then
105-
export DOCKER_TAG="ab1632df-fa59-40e6-8c23-98e004f61148"
106-
fi
107-
if [[ "${DOCKER_IMAGE}" == *rocm3.7* ]]; then
108-
export DOCKER_TAG="1045c7b891104cb4fd23399eab413b6213e48aeb"
99+
if [[ "${DOCKER_IMAGE}" == *rocm3.9* ]]; then
100+
export DOCKER_TAG="f3d89a32912f62815e4feaeed47e564e887dffd6"
109101
fi
110102
# See Note [Special build images]
111103
output_image=${DOCKER_IMAGE}:${DOCKER_TAG}-${CIRCLE_SHA1}
@@ -336,9 +328,6 @@ jobs:
336328
if [[ "${CUDA_VERSION}" != "10" || "${JOB_EXECUTOR}" != "windows-with-nvidia-gpu" ]]; then
337329
.circleci/scripts/windows_cuda_install.sh
338330
fi
339-
if [[ "${CUDA_VERSION}" != "10" && "${JOB_EXECUTOR}" == "windows-with-nvidia-gpu" ]]; then
340-
.circleci/scripts/driver_update.bat
341-
fi
342331
fi
343332
- run:
344333
name: Install Cudnn

.jenkins/pytorch/common.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,18 @@ fi
129129
if [[ "$BUILD_ENVIRONMENT" == *pytorch-xla-linux-bionic* ]] || \
130130
[[ "$BUILD_ENVIRONMENT" == *pytorch-linux-xenial-cuda9-cudnn7-py2* ]] || \
131131
[[ "$BUILD_ENVIRONMENT" == *pytorch-linux-xenial-cuda10.1-cudnn7-py3* ]] || \
132+
[[ "$BUILD_ENVIRONMENT" == *pytorch-*centos* ]] || \
132133
[[ "$BUILD_ENVIRONMENT" == *pytorch-linux-bionic* ]]; then
133134
if ! which conda; then
134135
echo "Expected ${BUILD_ENVIRONMENT} to use conda, but 'which conda' returns empty"
135136
exit 1
136137
else
137138
conda install -q -y cmake
138139
fi
140+
if [[ "$BUILD_ENVIRONMENT" == *pytorch-*centos* ]]; then
141+
# cmake3 package will conflict with conda cmake
142+
sudo yum -y remove cmake3 || true
143+
fi
139144
fi
140145
141146
retry () {

0 commit comments

Comments
 (0)