Skip to content

Commit

Permalink
ada lovelace (arch 8.9) support (#87436)
Browse files Browse the repository at this point in the history
changes required to be able to compile https://github.com/pytorch/vision and https://github.com/nvidia/apex for `sm_89` architecture
Pull Request resolved: #87436
Approved by: https://github.com/ngimel
  • Loading branch information
gregjhogan authored and pytorchmergebot committed Oct 24, 2022
1 parent 4105ef9 commit 71fe069
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions cmake/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,19 @@ if(NOT CUDA_VERSION VERSION_LESS "11.1")
list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.6")
set(CUDA_LIMIT_GPU_ARCHITECUTRE "8.6")

if(CUDA_VERSION VERSION_LESS "11.8")
set(CUDA_LIMIT_GPU_ARCHITECTURE "8.9")
endif()
endif()

if(NOT CUDA_VERSION VERSION_LESS "11.8")
list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Ada")
list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.9")
list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.9")

if(CUDA_VERSION VERSION_LESS "12.0")
set(CUDA_LIMIT_GPU_ARCHITECTURE "9.0")
list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.9+PTX")
endif()
endif()

Expand Down
3 changes: 2 additions & 1 deletion torch/utils/cpp_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -1729,10 +1729,11 @@ def _get_cuda_arch_flags(cflags: Optional[List[str]] = None) -> List[str]:
('Volta', '7.0+PTX'),
('Turing', '7.5+PTX'),
('Ampere', '8.0;8.6+PTX'),
('Ada', '8.9+PTX'),
])

supported_arches = ['3.5', '3.7', '5.0', '5.2', '5.3', '6.0', '6.1', '6.2',
'7.0', '7.2', '7.5', '8.0', '8.6']
'7.0', '7.2', '7.5', '8.0', '8.6', '8.9']
valid_arch_strings = supported_arches + [s + "+PTX" for s in supported_arches]

# The default is sm_30 for CUDA 9.x and 10.x
Expand Down

0 comments on commit 71fe069

Please sign in to comment.