Skip to content

Commit e97a900

Browse files
authored
RHEL Pytorch Backend SBSA (#139)
1 parent a520106 commit e97a900

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,17 @@ find_package(Python3 REQUIRED COMPONENTS Development.Module)
8888

8989
set(RHEL_BUILD OFF)
9090
set(LIB_DIR "lib")
91+
set(LIBTORCH_LIBS_PATH "/usr/local/lib")
9192
set(PY_INSTALL_PATH "/usr/local/lib/python3.10/dist-packages")
9293
if(LINUX)
9394
file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE")
9495
if(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
9596
set(RHEL_BUILD ON)
9697
set(LIB_DIR "lib64")
9798
set(PY_INSTALL_PATH "/opt/_internal/cpython-3.10.13/lib/python3.10/site-packages")
99+
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
100+
set(LIBTORCH_LIBS_PATH "/opt/_internal/cpython-3.10.13/lib")
101+
endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
98102
endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
99103
endif(LINUX)
100104

@@ -232,7 +236,7 @@ if (${TRITON_PYTORCH_DOCKER_BUILD})
232236
COMMAND docker pull ${TRITON_PYTORCH_DOCKER_IMAGE}
233237
COMMAND docker rm pytorch_backend_ptlib || echo "error ignored..." || true
234238
COMMAND docker create --name pytorch_backend_ptlib ${TRITON_PYTORCH_DOCKER_IMAGE}
235-
COMMAND /bin/sh -c "for i in ${LIBTORCH_LIBS_STR} ; do echo copying $i && docker cp -L pytorch_backend_ptlib:$<IF:$<BOOL:${RHEL_BUILD}>,/opt/_internal/cpython-3.10.13/lib/$i,/usr/local/lib/$i> $i ; done"
239+
COMMAND /bin/sh -c "for i in ${LIBTORCH_LIBS_STR} ; do echo copying $i && docker cp -L pytorch_backend_ptlib:${LIBTORCH_LIBS_PATH}/$i $i ; done"
236240
COMMAND docker cp pytorch_backend_ptlib:${PY_INSTALL_PATH}/torch/lib/libc10.so libc10.so
237241
COMMAND docker cp pytorch_backend_ptlib:${PY_INSTALL_PATH}/torch/lib/libc10_cuda.so libc10_cuda.so
238242
COMMAND docker cp pytorch_backend_ptlib:${PY_INSTALL_PATH}/torch/lib/libtorch.so libtorch.so

0 commit comments

Comments
 (0)