-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MIOpen 5.2.3 #5630
Merged
Merged
Add MIOpen 5.2.3 #5630
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e81e79f
t
pxl-th 03b3427
Partial fix for MIOpen
pxl-th 9eb0f08
Remove logs
pxl-th 3f2f983
Completely fix MIOpen build
pxl-th b94d917
Revert boost
pxl-th 8045eef
Add half to products
pxl-th 931d4a2
Specify compat
pxl-th File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Pkg | ||
using BinaryBuilder | ||
|
||
include("../common.jl") | ||
|
||
build_tarballs( | ||
ARGS, configure_build(v"5.2.3")...; | ||
preferred_gcc_version=v"7", preferred_llvm_version=v"9") |
18 changes: 18 additions & 0 deletions
18
M/MIOpen/[email protected]/bundled/patches/boost-fix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/include/miopen/config.h.in b/include/miopen/config.h.in | ||
index 1849b4344..d0c6f2a9b 100644 | ||
--- a/include/miopen/config.h.in | ||
+++ b/include/miopen/config.h.in | ||
@@ -117,4 +117,13 @@ | ||
((HIP_PACKAGE_VERSION_MAJOR * 1000ULL + HIP_PACKAGE_VERSION_MINOR) * 1000000 + \ | ||
HIP_PACKAGE_VERSION_PATCH) | ||
|
||
+/// WORKAROUND_BOOST_ISSUE_392 | ||
+/// Workaround for https://github.com/boostorg/config/issues/392#issuecomment-1109889533 | ||
+/// See also https://github.com/ROCmSoftwarePlatform/MIOpen/pull/1490#issuecomment-1109928102, | ||
+/// https://github.com/ROCmSoftwarePlatform/MIOpen/pull/1543 | ||
+/// TODO: Remove the W/A as soon we switch to the properly fixed boost. | ||
+#if MIOPEN_BACKEND_HIP | ||
+#include <hip/hip_version.h> | ||
+#endif | ||
+ | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
const NAME = "MIOpen" | ||
|
||
const ROCM_GIT = "https://github.com/ROCmSoftwarePlatform/MIOpen/" | ||
const GIT_TAGS = Dict( | ||
v"5.2.3" => "28747847446955b3bab24f7fc65c1a6b863a12f12ad3a35e0312072482d38122", | ||
) | ||
|
||
const ROCM_PLATFORMS = [ | ||
Platform("x86_64", "linux"; libc="glibc", cxxstring_abi="cxx11"), | ||
# TODO add, when rocBLAS 5.2.3+ is built for musl | ||
# Platform("x86_64", "linux"; libc="musl", cxxstring_abi="cxx11"), | ||
] | ||
const PRODUCTS = [ | ||
LibraryProduct(["libMIOpen"], :libMIOpen, ["lib"]), | ||
FileProduct("include/half.hpp", :libhalf), | ||
] | ||
|
||
function configure_build(version) | ||
buildscript = raw""" | ||
mv ${WORKSPACE}/srcdir/half/include/half.hpp ${prefix}/include | ||
export HALF_INCLUDE_DIR=${prefix}/include | ||
|
||
mv ${WORKSPACE}/srcdir/rocm-clang* ${prefix}/llvm/bin | ||
|
||
cd ${WORKSPACE}/srcdir/MIOpen*/ | ||
atomic_patch -p1 ${WORKSPACE}/srcdir/patches/boost-fix.patch | ||
mkdir build | ||
|
||
export AMDGPU_TARGETS="gfx900;gfx906;gfx90a;gfx1010;gfx1012;gfx1030" | ||
export ROCM_PATH=${prefix} | ||
|
||
export HIP_PATH=${prefix}/hip | ||
export HIP_PLATFORM=amd | ||
export HIP_RUNTIME=rocclr | ||
export HIP_COMPILER=clang | ||
|
||
CXXFLAGS="${CXXFLAGS} -I${prefix}/include/rocblas" \ | ||
cmake -S . -B build \ | ||
-DCMAKE_CXX_COMPILER=${prefix}/llvm/bin/rocm-clang++ \ | ||
-DCMAKE_INSTALL_PREFIX=${prefix} \ | ||
-DCMAKE_PREFIX_PATH=${prefix} \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DROCM_PATH=${ROCM_PATH} \ | ||
-DAMDGPU_TARGETS=${AMDGPU_TARGETS} \ | ||
-DBoost_USE_STATIC_LIBS=OFF \ | ||
-DMIOPEN_BACKEND=HIP \ | ||
-DMIOPEN_USE_MLIR=OFF \ | ||
-DHALF_INCLUDE_DIR=${HALF_INCLUDE_DIR} | ||
|
||
make -j${nproc} -C build install | ||
|
||
install_license ${WORKSPACE}/srcdir/MIOpen*/LICENSE.txt | ||
""" | ||
|
||
sources = [ | ||
ArchiveSource( | ||
ROCM_GIT * "archive/rocm-$(version).tar.gz", GIT_TAGS[version]), | ||
ArchiveSource( | ||
"https://downloads.sourceforge.net/project/half/half/2.1.0/half-2.1.0.zip", | ||
"ad1788afe0300fa2b02b0d1df128d857f021f92ccf7c8bddd07812685fa07a25"; | ||
unpack_target="half"), | ||
DirectorySource("./bundled"), | ||
DirectorySource("../scripts"), | ||
] | ||
dependencies = [ | ||
BuildDependency(PackageSpec(; name="ROCmLLVM_jll", version)), | ||
BuildDependency(PackageSpec(; name="rocm_cmake_jll", version)), | ||
Dependency("HIP_jll", version), | ||
Dependency("rocBLAS_jll", version), | ||
Dependency("Zlib_jll"), | ||
Dependency("SQLite_jll"), | ||
Dependency("boost_jll", v"1.79.0"), | ||
] | ||
NAME, version, sources, buildscript, ROCM_PLATFORMS, PRODUCTS, dependencies | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
ARGS=( "$@" ) | ||
PRE_FLAGS=() | ||
POST_FLAGS=() | ||
|
||
PRE_FLAGS+=( -target ${target} ) | ||
PRE_FLAGS+=( --sysroot=/opt/${target}/${target}/sys-root ) | ||
PRE_FLAGS+=( --gcc-toolchain=/opt/${target} ) | ||
|
||
if [[ " ${ARGS[@]} " != *' -x assembler '* ]]; then | ||
PRE_FLAGS+=( -march=x86-64 ) | ||
PRE_FLAGS+=( -mtune=generic ) | ||
fi | ||
|
||
COMPILE_BASE_DIR=/opt/${target}/${target} | ||
COMPILE_CPP_DIR=${COMPILE_BASE_DIR}/include/c++/* | ||
|
||
if [[ " ${ARGS[@]} " != *' -c '* ]] && [[ " ${ARGS[@]} " != *' -E '* ]] && [[ " ${ARGS[@]} " != *' -M '* ]] && [[ " ${ARGS[@]} " != *' -fsyntax-only '* ]]; then | ||
POST_FLAGS+=( -rtlib=libgcc ) | ||
POST_FLAGS+=( -stdlib=libstdc++ ) | ||
POST_FLAGS+=( -fuse-ld=lld ) | ||
fi | ||
|
||
COMPILE_BASE_DIR=/opt/${target}/${target} | ||
LINK_GCC_DIR=/opt/${target}/lib/gcc/${target}/* | ||
# Need `-isystem` to be in post flags, for `#include_next` to work. | ||
POST_FLAGS+=(-isystem ${COMPILE_CPP_DIR} -isystem ${COMPILE_CPP_DIR}/${target}) | ||
POST_FLAGS+=(-B ${LINK_GCC_DIR} -L ${LINK_GCC_DIR} -L ${COMPILE_BASE_DIR}/lib64) | ||
|
||
if [[ " ${ARGS[@]} " == *"-march="* ]]; then | ||
echo "BinaryBuilder: Cannot force an architecture via -march" >&2 | ||
exit 1 | ||
fi | ||
|
||
if [ ${USE_CCACHE} == "true" ]; then | ||
CCACHE="ccache" | ||
fi | ||
|
||
${CCACHE} ${prefix}/llvm/bin/clang++ "${PRE_FLAGS[@]}" "${ARGS[@]}" "${POST_FLAGS[@]}" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3024.
Besides the specific case of boost, as a general remark, if you need a specific version of a dependency for building a package, that's a good indication that you should reflect that requirement in the compat bound. I see very little need to specify the build version without the compat, which applies also to the other dependencies above