Skip to content

Commit

Permalink
fix a bug where Magma binaries were failing with on K80 GPUs. More co…
Browse files Browse the repository at this point in the history
  • Loading branch information
soumith committed Nov 4, 2019
1 parent d5e3f7f commit dd7edfd
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
9 changes: 3 additions & 6 deletions conda/README.md
Expand Up @@ -41,14 +41,11 @@ export PYTORCH_BRANCH=master

```
nvidia-docker run -it --ipc=host --rm -v $(pwd):/remote soumith/conda-cuda bash
yum install -y yum-utils centos-release-scl
yum-config-manager --enable rhel-server-rhscl-7-rpms
yum install -y devtoolset-3-gcc devtoolset-3-gcc-c++ devtoolset-3-gcc-gfortran devtoolset-3-binutils
export PATH=/opt/rh/devtoolset-3/root/usr/bin:$PATH
export LD_LIBRARY_PATH=/opt/rh/devtoolset-3/root/usr/lib64:/opt/rh/devtoolset-3/root/usr/lib:$LD_LIBRARY_PATH
git clone https://github.com/pytorch/builder
cd builder/conda
conda install -y conda-build
. ./switch_cuda_version.sh 10.0
conda build magma-cuda100-2.5.0
conda build magma-cuda100-2.5.1
```

Test magma builds on K80 machine, to check against the bug https://github.com/pytorch/pytorch/issues/29096
13 changes: 11 additions & 2 deletions conda/magma-cuda100-2.5.1/cmakelists.patch
@@ -1,5 +1,5 @@
--- CMakeLists.txt 2019-08-02 14:09:54.000000000 -0700
+++ CMakeLists.txt 2019-08-02 18:00:11.818541038 -0700
--- CMakeLists.txt 2019-11-04 15:04:50.452110612 -0800
+++ CMakeLists.txt 2019-11-04 15:05:39.889521970 -0800
@@ -3,7 +3,7 @@
# ----------------------------------------
# to disable Fortran, set this to "off"
Expand Down Expand Up @@ -43,6 +43,15 @@


# ----------------------------------------
@@ -119,7 +121,7 @@
set( NV_SM "" )
set( NV_COMP "" )

- set(CUDA_SEPARABLE_COMPILATION ON)
+ set(CUDA_SEPARABLE_COMPILATION OFF)

# nvcc >= 6.5 supports -std=c++11, so propagate CXXFLAGS to NVCCFLAGS.
# Older nvcc didn't support -std=c++11, so previously we disabled propagation.
@@ -259,11 +261,18 @@
message( STATUS " compile for CUDA arch 7.5 (Turing)" )
endif()
Expand Down
15 changes: 12 additions & 3 deletions conda/magma-cuda101-2.5.1/cmakelists.patch
@@ -1,5 +1,5 @@
--- CMakeLists.txt 2019-08-02 14:09:54.000000000 -0700
+++ CMakeLists.txt 2019-08-02 18:00:11.818541038 -0700
--- CMakeLists.txt 2019-11-04 15:04:50.452110612 -0800
+++ CMakeLists.txt 2019-11-04 15:05:39.889521970 -0800
@@ -3,7 +3,7 @@
# ----------------------------------------
# to disable Fortran, set this to "off"
Expand Down Expand Up @@ -43,13 +43,22 @@


# ----------------------------------------
@@ -119,7 +121,7 @@
set( NV_SM "" )
set( NV_COMP "" )

- set(CUDA_SEPARABLE_COMPILATION ON)
+ set(CUDA_SEPARABLE_COMPILATION OFF)

# nvcc >= 6.5 supports -std=c++11, so propagate CXXFLAGS to NVCCFLAGS.
# Older nvcc didn't support -std=c++11, so previously we disabled propagation.
@@ -259,11 +261,18 @@
message( STATUS " compile for CUDA arch 7.5 (Turing)" )
endif()

+ if ( ${GPU_TARGET} MATCHES "All")
+ set( MIN_ARCH 370)
+ SET( NV_SM -gencode arch=compute_37,code=compute_37 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 )
+ SET( NV_SM -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 )
+ SET( NV_COMP "")
+ endif()
+
Expand Down
15 changes: 12 additions & 3 deletions conda/magma-cuda92-2.5.1/cmakelists.patch
@@ -1,5 +1,5 @@
--- CMakeLists.txt 2019-08-02 14:09:54.000000000 -0700
+++ CMakeLists.txt 2019-08-02 18:00:11.818541038 -0700
--- CMakeLists.txt 2019-11-04 15:04:50.452110612 -0800
+++ CMakeLists.txt 2019-11-04 15:05:39.889521970 -0800
@@ -3,7 +3,7 @@
# ----------------------------------------
# to disable Fortran, set this to "off"
Expand Down Expand Up @@ -43,13 +43,22 @@


# ----------------------------------------
@@ -119,7 +121,7 @@
set( NV_SM "" )
set( NV_COMP "" )

- set(CUDA_SEPARABLE_COMPILATION ON)
+ set(CUDA_SEPARABLE_COMPILATION OFF)

# nvcc >= 6.5 supports -std=c++11, so propagate CXXFLAGS to NVCCFLAGS.
# Older nvcc didn't support -std=c++11, so previously we disabled propagation.
@@ -259,11 +261,18 @@
message( STATUS " compile for CUDA arch 7.5 (Turing)" )
endif()

+ if ( ${GPU_TARGET} MATCHES "All")
+ set( MIN_ARCH 370)
+ SET( NV_SM -gencode arch=compute_37,code=compute_37 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 )
+ SET( NV_SM -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 )
+ SET( NV_COMP "")
+ endif()
+
Expand Down

0 comments on commit dd7edfd

Please sign in to comment.