Skip to content

Commit 14b3cce

Browse files
jomayeritjruwaseloadams
authored
AIO on ROCM (deepspeedai#7023)
Adding compile support for AIO library on AMD GPUs. --------- Co-authored-by: Olatunji Ruwase <olruwase@microsoft.com> Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
1 parent e637677 commit 14b3cce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

op_builder/async_io.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ def extra_ldflags(self):
6565

6666
import torch.utils.cpp_extension
6767
CUDA_HOME = torch.utils.cpp_extension.CUDA_HOME
68-
CUDA_LIB64 = os.path.join(CUDA_HOME, "lib64")
69-
ldflags = [f'-L{CUDA_HOME}', f'-L{CUDA_LIB64}', '-laio', '-lcuda', '-lcudart']
68+
if CUDA_HOME is None:
69+
ldflags = ['-laio'] # the ROCM case
70+
else:
71+
CUDA_LIB64 = os.path.join(CUDA_HOME, "lib64")
72+
ldflags = [f'-L{CUDA_HOME}', f'-L{CUDA_LIB64}', '-laio', '-lcuda', '-lcudart']
7073
return ldflags
7174

7275
def check_for_libaio_pkg(self):

0 commit comments

Comments
 (0)