Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,17 @@ def check_cudnn_version_and_warn(global_option: str, required_cudnn_version: int

# CUDA group norm supports from SM70
arch_flags = []
# FIXME: this needs to be done more cleanly
for arch in [70, 75, 80, 86, 90, 100, 120]:
arch_flag = f"-gencode=arch=compute_{arch},code=sm_{arch}"
arch_flags.append(arch_flag)
arch_flags.append(arch_flag)
# Gate architectures by available CUDA version to avoid unsupported targets on older toolkits
allowed_arches = [70, 75, 80]
if bare_metal_version >= Version("11.1"):
allowed_arches.append(86)
if bare_metal_version >= Version("11.8"):
allowed_arches.append(90)
if bare_metal_version >= Version("12.8"):
allowed_arches.extend([100, 120])

for arch in allowed_arches:
arch_flags.append(f"-gencode=arch=compute_{arch},code=sm_{arch}")

ext_modules.append(
CUDAExtension(
Expand Down