Skip to content

Commit 2d87181

Browse files
jomayeritjruwaseloadams
authored andcommitted
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 64f1889 commit 2d87181

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

op_builder/async_io.py

Lines changed: 5 additions & 2 deletions
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)