Skip to content

Commit 87693b5

Browse files
jithunnair-amdpytorchmergebot
authored andcommitted
[ROCm] Use AOTriton as a dynamic library (pytorch#129094)
This PR enables using AOTriton as a shared library dependency instead of a static one. Resolves the issue of linker errors when trying to build PyTorch for a lot of (>7 or so) gfx archs due to huge size of aotriton static library. Pull Request resolved: pytorch#129094 Approved by: https://github.com/malfet
1 parent 8c2c3a0 commit 87693b5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.ci/docker/aotriton_version.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
0.6b
22
manylinux_2_17
3-
rocm6
4-
04b5df8c8123f90cba3ede7e971e6fbc6040d506
5-
3db6ecbc915893ff967abd6e1b43bd5f54949868873be60dc802086c3863e648
3+
rocm6.1
4+
7f07e8a1cb1f99627eb6d77f5c0e9295c775f3c7
5+
77c29fa3f3b614e187d7213d745e989a92708cee2bc6020419ab49019af399d1

.ci/docker/common/install_aotriton.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ TARBALL='aotriton.tar.bz2'
99
read -d "\n" VER MANYLINUX ROCMBASE PINNED_COMMIT SHA256 < aotriton_version.txt || true
1010
ARCH=$(uname -m)
1111
AOTRITON_INSTALL_PREFIX="$1"
12-
AOTRITON_URL="https://github.com/ROCm/aotriton/releases/download/${VER}/aotriton-${VER}-${MANYLINUX}_${ARCH}-${ROCMBASE}.tar.bz2"
12+
AOTRITON_URL="https://github.com/ROCm/aotriton/releases/download/${VER}/aotriton-${VER}-${MANYLINUX}_${ARCH}-${ROCMBASE}-shared.tar.bz2"
1313

1414
cd "${AOTRITON_INSTALL_PREFIX}"
1515
# Must use -L to follow redirects

cmake/External/aotriton.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ if(NOT __AOTRITON_INCLUDED)
2222
-DAOTRITON_COMPRESS_KERNEL=OFF
2323
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
2424
-DAOTRITON_NO_PYTHON=ON
25-
-DAOTRITON_NO_SHARED=ON
25+
-DAOTRITON_NO_SHARED=OFF
2626
# CONFIGURE_COMMAND ""
2727
BUILD_COMMAND "" # No build, install command will repeat the build process due to problems in the build system.
28-
BUILD_BYPRODUCTS "${__AOTRITON_INSTALL_DIR}/lib/libaotriton_v2.a"
28+
BUILD_BYPRODUCTS "${__AOTRITON_INSTALL_DIR}/lib/libaotriton_v2.so"
2929
USES_TERMINAL_DOWNLOAD TRUE
3030
USES_TERMINAL_CONFIGURE TRUE
3131
USES_TERMINAL_BUILD TRUE
@@ -35,7 +35,7 @@ if(NOT __AOTRITON_INCLUDED)
3535
add_dependencies(__caffe2_aotriton aotriton_external)
3636
message(STATUS "Using AOTriton compiled from source directory ${__AOTRITON_SOURCE_DIR}")
3737
endif()
38-
target_link_libraries(__caffe2_aotriton INTERFACE ${__AOTRITON_INSTALL_DIR}/lib/libaotriton_v2.a)
38+
target_link_libraries(__caffe2_aotriton INTERFACE ${__AOTRITON_INSTALL_DIR}/lib/libaotriton_v2.so)
3939
target_include_directories(__caffe2_aotriton INTERFACE ${__AOTRITON_INSTALL_DIR}/include)
4040
set(AOTRITON_FOUND TRUE)
4141
endif() # __AOTRITON_INCLUDED

0 commit comments

Comments
 (0)