Skip to content

Commit 799f8db

Browse files
ethanwee1jithunnair-amd
authored andcommitted
[rocm6.4_internal_testing] Enable wheels (#1884) (#1907)
* Use triton commit same as that used for release/2.6 branch since both are triton version 3.2.0, so assuming they're compatible. Relates to: https://github.com/ROCm/rocAutomation/pull/660/files https://github.com/ROCm/builder/pull/70/files Validation http://ml-ci-internal.amd.com:8080/job/pytorch/job/manylinux_rocm_wheels/568/ --------- Co-authored-by: Jithun Nair <[email protected]> Co-authored-by: Jithun Nair <[email protected]> (cherry picked from commit 14c1417) (cherry picked from commit c20a8f8)
1 parent 9b4ad7d commit 799f8db

File tree

3 files changed

+5
-48
lines changed

3 files changed

+5
-48
lines changed

.circleci/scripts/binary_populate_env.sh

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -69,48 +69,6 @@ fi
6969

7070
export PYTORCH_BUILD_NUMBER=1
7171

72-
# Set triton version as part of PYTORCH_EXTRA_INSTALL_REQUIREMENTS
73-
TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_version.txt)
74-
TRITON_CONSTRAINT="platform_system == 'Linux'"
75-
76-
if [[ "$PACKAGE_TYPE" =~ .*wheel.* && -n "${PYTORCH_EXTRA_INSTALL_REQUIREMENTS:-}" && ! "$PYTORCH_BUILD_VERSION" =~ .*xpu.* ]]; then
77-
TRITON_REQUIREMENT="triton==${TRITON_VERSION}; ${TRITON_CONSTRAINT}"
78-
if [[ -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*dev.* ]]; then
79-
TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt)
80-
TRITON_REQUIREMENT="pytorch-triton==${TRITON_VERSION}+git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
81-
fi
82-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${TRITON_REQUIREMENT}"
83-
fi
84-
85-
# Set triton via PYTORCH_EXTRA_INSTALL_REQUIREMENTS for triton rocm package
86-
if [[ "$PACKAGE_TYPE" =~ .*wheel.* && -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*rocm.* && $(uname) == "Linux" ]]; then
87-
TRITON_REQUIREMENT="triton==${TRITON_VERSION}; ${TRITON_CONSTRAINT}"
88-
if [[ -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*dev.* ]]; then
89-
TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton.txt)
90-
TRITON_REQUIREMENT="triton==${TRITON_VERSION}+git${TRITON_SHORTHASH}; ${TRITON_CONSTRAINT}"
91-
fi
92-
if [[ -z "${PYTORCH_EXTRA_INSTALL_REQUIREMENTS:-}" ]]; then
93-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${TRITON_REQUIREMENT}"
94-
else
95-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${TRITON_REQUIREMENT}"
96-
fi
97-
fi
98-
99-
# Set triton via PYTORCH_EXTRA_INSTALL_REQUIREMENTS for triton xpu package
100-
if [[ "$PACKAGE_TYPE" =~ .*wheel.* && -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*xpu.* ]]; then
101-
TRITON_VERSION=$(cat $PYTORCH_ROOT/.ci/docker/triton_xpu_version.txt)
102-
TRITON_REQUIREMENT="pytorch-triton-xpu==${TRITON_VERSION}"
103-
if [[ -n "$PYTORCH_BUILD_VERSION" && "$PYTORCH_BUILD_VERSION" =~ .*dev.* ]]; then
104-
TRITON_SHORTHASH=$(cut -c1-8 $PYTORCH_ROOT/.ci/docker/ci_commit_pins/triton-xpu.txt)
105-
TRITON_REQUIREMENT="pytorch-triton-xpu==${TRITON_VERSION}+git${TRITON_SHORTHASH}"
106-
fi
107-
if [[ -z "${PYTORCH_EXTRA_INSTALL_REQUIREMENTS:-}" ]]; then
108-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${TRITON_REQUIREMENT}"
109-
else
110-
export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="${PYTORCH_EXTRA_INSTALL_REQUIREMENTS} | ${TRITON_REQUIREMENT}"
111-
fi
112-
fi
113-
11472
USE_GLOO_WITH_OPENSSL="ON"
11573
if [[ "$GPU_ARCH_TYPE" =~ .*aarch64.* ]]; then
11674
USE_GLOO_WITH_OPENSSL="OFF"

.github/scripts/build_triton_wheel.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def build_triton(
9696
# Nightly binaries include the triton commit hash, i.e. 2.1.0+e6216047b8
9797
# while release build should only include the version, i.e. 2.1.0
9898
rocm_version = get_rocm_version()
99-
version_suffix = f"+rocm{rocm_version}_{commit_hash[:10]}"
99+
version_suffix = f"+rocm{rocm_version}.git{commit_hash[:8]}"
100100
version += version_suffix
101101

102102
with TemporaryDirectory() as tmpdir:
@@ -124,6 +124,7 @@ def build_triton(
124124

125125
# change built wheel name and version
126126
env["TRITON_WHEEL_NAME"] = triton_pkg_name
127+
env["TRITON_WHEEL_VERSION_SUFFIX"] = version_suffix
127128
if with_clang_ldd:
128129
env["TRITON_BUILD_WITH_CLANG_LLD"] = "1"
129130

@@ -139,8 +140,6 @@ def build_triton(
139140
cwd=triton_basedir,
140141
shell=True,
141142
)
142-
cur_rocm_ver = get_rocm_version()
143-
check_call(["scripts/amd/setup_rocm_libs.sh", cur_rocm_ver], cwd=triton_basedir)
144143
print("ROCm libraries setup for triton installation...")
145144

146145
# old triton versions have setup.py in the python/ dir,

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ set(CMAKE_C_STANDARD
5656
# ---[ Utils
5757
include(cmake/public/utils.cmake)
5858

59-
# --- [ Check that minimal gcc version is 9.3+
60-
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.3)
59+
# --- [ Check that minimal gcc version is 9.2+
60+
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.2)
6161
message(
6262
FATAL_ERROR
63-
"GCC-9.3 or newer is required to compile PyTorch, but found ${CMAKE_CXX_COMPILER_VERSION}"
63+
"GCC-9.2 or newer is required to compile PyTorch, but found ${CMAKE_CXX_COMPILER_VERSION}"
6464
)
6565
endif()
6666

0 commit comments

Comments
 (0)