migraphx: add v6.0.0 & v6.0.2 (#42918)

* Updates for migraphx 6.0.0 & 6.0.2
* Style check error and audit check error fix
* Adding patch for half-include-directory
* The parameter GPU_TARGETS is used from 5.7 in migraphx
* Adding rocmlir dependency in migraphx and 6.0 updates in rocmlir
* Applying upcoming changes to make CK JIT optional and enable
  compilation on Windows in order to build without ck dependency
This commit is contained in:
renjithravindrankannath 2024-03-05 15:16:31 -08:00 committed by GitHub
parent 5ca0dcecb2
commit 00d3066b97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 48 additions and 6 deletions

View file

@ -81,6 +81,8 @@ def cmake_args(self):
args.append(self.define_from_variant("GPU_TARGETS", "amdgpu_target")) args.append(self.define_from_variant("GPU_TARGETS", "amdgpu_target"))
if self.spec.satisfies("@5.6.0:"): if self.spec.satisfies("@5.6.0:"):
args.append(self.define("INSTANCES_ONLY", "ON")) args.append(self.define("INSTANCES_ONLY", "ON"))
args.append(self.define("CK_BUILD_JIT_LIB", "ON"))
args.append(self.define("CMAKE_POSITION_INDEPENDENT_CODE", "ON"))
if self.spec.satisfies("@:5.7"): if self.spec.satisfies("@:5.7"):
args.append(self.define("CMAKE_CXX_FLAGS", "-O3")) args.append(self.define("CMAKE_CXX_FLAGS", "-O3"))
return args return args

View file

@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a76fb11..0f589d0 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,8 @@ else()
option(MIGRAPHX_ENABLE_PYTHON "Enable python bindings" ON)
endif()
-find_path(HALF_INCLUDE_DIR half.hpp PATH_SUFFIXES half)
+find_path(HALF_INCLUDE_DIR half.hpp)
+
if (NOT HALF_INCLUDE_DIR)
message(FATAL_ERROR "Could not find half.hpp - Please check that the install path of half.hpp has been added to CMAKE_PREFIX_PATH")
else()
@@ -278,7 +279,7 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()
add_subdirectory(tools)
-
+target_include_directories(migraphx PUBLIC "${NLOHMANN_JSON_INCLUDE} ${HALF_INCLUDE_DIR}")
set(DEST_DIR ${CMAKE_BINARY_DIR})
file(GLOB backend_files ${CMAKE_SOURCE_DIR}/src/py/backend/*.py)
file(MAKE_DIRECTORY ${DEST_DIR}/lib/onnx_migraphx)

View file

@ -45,8 +45,20 @@ class Migraphx(CMakePackage):
patch("0002-restrict-python-2.7-usage.patch", when="@:5.1") patch("0002-restrict-python-2.7-usage.patch", when="@:5.1")
patch("0003-restrict-python-2.7-usage.patch", when="@5.2.0:5.4") patch("0003-restrict-python-2.7-usage.patch", when="@5.2.0:5.4")
patch("0004-restrict-python2.7-usage-for-5.5.0.patch", when="@5.5.0") patch("0004-restrict-python2.7-usage-for-5.5.0.patch", when="@5.5.0")
patch("0005-Adding-half-include-directory-path-migraphx.patch", when="@5.6.0:") patch("0005-Adding-half-include-directory-path-migraphx.patch", when="@5.6.0:5.7")
patch("0006-add-option-to-turn-off-ck.patch", when="@5.7") patch("0006-add-option-to-turn-off-ck.patch", when="@5.7")
patch(
"https://github.com/ROCm/AMDMIGraphX/commit/728bea3489c97c9e1ddda0a0ae527ffd2d70cb97.patch?full_index=1",
sha256="3a8afd32208aa4f59fb31f898d243287771ebd409c7af7a4a785c586081e3711",
when="@6.0:",
)
patch(
"https://github.com/ROCm/AMDMIGraphX/commit/624f8ef549522f64fdddad7f49a2afe1890b0b79.patch?full_index=1",
sha256="410d0fd49f5f65089cd4f540c530c85896708b4fd94c67d15c2c279158aea85d",
when="@6.0:",
)
patch("0003-add-half-include-directory-migraphx-6.0.patch", when="@6.0:")
depends_on("cmake@3.5:", type="build") depends_on("cmake@3.5:", type="build")
depends_on("protobuf", type="link") depends_on("protobuf", type="link")
@ -85,8 +97,8 @@ class Migraphx(CMakePackage):
depends_on(f"rocblas@{ver}", when=f"@{ver}") depends_on(f"rocblas@{ver}", when=f"@{ver}")
depends_on(f"miopen-hip@{ver}", when=f"@{ver}") depends_on(f"miopen-hip@{ver}", when=f"@{ver}")
for ver in ["5.7.0", "5.7.1", "6.0.0", "6.0.2"]: for ver in ["6.0.0", "6.0.2"]:
depends_on(f"composable-kernel@{ver}", when=f"@{ver}") depends_on(f"rocmlir@{ver}", when=f"@{ver}")
@property @property
def cmake_python_hints(self): def cmake_python_hints(self):
@ -119,8 +131,11 @@ def cmake_args(self):
if "@5.5.0:" in self.spec: if "@5.5.0:" in self.spec:
args.append(self.define("CMAKE_CXX_FLAGS", "-I{0}".format(abspath))) args.append(self.define("CMAKE_CXX_FLAGS", "-I{0}".format(abspath)))
args.append(self.define("MIGRAPHX_ENABLE_PYTHON", "OFF")) args.append(self.define("MIGRAPHX_ENABLE_PYTHON", "OFF"))
if "@5.7" in self.spec: if "@5.7:" in self.spec:
args.append(self.define("MIGRAPHX_USE_COMPOSABLEKERNEL", "OFF")) args.append(self.define("MIGRAPHX_USE_COMPOSABLEKERNEL", "OFF"))
args.append(
self.define("GPU_TARGETS", "gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102")
)
return args return args
def test(self): def test(self):

View file

@ -14,9 +14,11 @@ class Rocmlir(CMakePackage):
homepage = "https://github.com/ROCm/rocMLIR" homepage = "https://github.com/ROCm/rocMLIR"
git = "https://github.com/ROCm/rocMLIR.git" git = "https://github.com/ROCm/rocMLIR.git"
url = "https://github.com/ROCm/rocMLIR/archive/refs/tags/rocm-6.0.0.tar.gz" url = "https://github.com/ROCm/rocMLIR/archive/refs/tags/rocm-6.0.2.tar.gz"
maintainers("srekolam") maintainers("srekolam")
version("6.0.2", sha256="6ed039e8045169bb64c10fb063c2e1753b8d52d6d56c60e001c929082be1f20b")
version("6.0.0", sha256="128915abdceaf5cef26a717d154f2b2f9466f6904f4490f158038878cedbf618")
version("5.5.1", commit="8c29325e7e68e3248e863172bf0e7f97055d45ee") version("5.5.1", commit="8c29325e7e68e3248e863172bf0e7f97055d45ee")
version("5.5.0", sha256="a5f62769d28a73e60bc8d61022820f050e97c977c8f6f6275488db31512e1f42") version("5.5.0", sha256="a5f62769d28a73e60bc8d61022820f050e97c977c8f6f6275488db31512e1f42")
version("5.4.3", sha256="c0ba0f565e1c6614c9e6091a24cbef67b734a29e4a4ed7a8a57dc43f58ed8d53") version("5.4.3", sha256="c0ba0f565e1c6614c9e6091a24cbef67b734a29e4a4ed7a8a57dc43f58ed8d53")
@ -48,7 +50,7 @@ def patch(self):
depends_on("half") depends_on("half")
depends_on("pkgconfig", type="build") depends_on("pkgconfig", type="build")
for ver in ["5.3.0", "5.4.0", "5.4.3", "5.5.0", "5.5.1"]: for ver in ["5.3.0", "5.4.0", "5.4.3", "5.5.0", "5.5.1", "6.0.0", "6.0.2"]:
depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"hip@{ver}", when=f"@{ver}")
depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}")
depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}")