Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,15 @@ therock_add_feature(MIOPEN
REQUIRES COMPILER HIP_RUNTIME BLAS RAND ${_optional_profiler_requirements}
)

#hipDNN on Windows is disabled for now, but will be enabled in a follow-up change.
if(NOT WIN32)
therock_add_feature(HIPDNN
GROUP ML_LIBS
DESCRIPTION "Enables the hipDNN project"
REQUIRES COMPILER HIP_RUNTIME
)
endif()

# Finalize all feature flags.
therock_finalize_features()
therock_report_features()
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ minimal build):
| `-DTHEROCK_ENABLE_SOLVER=ON` | Enables the SOLVER libraries |
| `-DTHEROCK_ENABLE_SPARSE=ON` | Enables the SPARSE libraries |
| `-DTHEROCK_ENABLE_MIOPEN=ON` | Enables MIOpen |
| `-DTHEROCK_ENABLE_HIPDNN=ON` | Enables hipDNN |

> [!TIP]
> Enabling any features will implicitly enable their *minimum* dependencies. Some
Expand Down
9 changes: 9 additions & 0 deletions build_tools/github_actions/fetch_test_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ def _get_script_path(script_name: str) -> str:
"platform": ["linux"],
"total_shards": 1,
},
# hipDNN tests
"hipdnn": {
"job_name": "hipdnn",
"fetch_artifact_args": "--hipdnn --tests",
"timeout_minutes": 5,
"test_script": f"python {_get_script_path('test_hipdnn.py')}",
"platform": ["linux"],
"total_shards": 1,
},
}


Expand Down
29 changes: 29 additions & 0 deletions build_tools/github_actions/test_executable_scripts/test_hipdnn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import logging
import os
import shlex
import subprocess
from pathlib import Path

THEROCK_BIN_DIR = os.getenv("THEROCK_BIN_DIR")
SCRIPT_DIR = Path(__file__).resolve().parent
THEROCK_DIR = SCRIPT_DIR.parent.parent.parent

logging.basicConfig(level=logging.INFO)

cmd = [
"ctest",
"--test-dir",
f"{THEROCK_BIN_DIR}",
"--output-on-failure",
"--parallel",
"8",
"--timeout",
"300",
]
logging.info(f"++ Exec [{THEROCK_DIR}]$ {shlex.join(cmd)}")

subprocess.run(
cmd,
cwd=THEROCK_DIR,
check=True,
)
15 changes: 13 additions & 2 deletions build_tools/install_rocm_from_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[--output-dir OUTPUT_DIR]
[--amdgpu-family AMDGPU_FAMILY]
(--run-id RUN_ID | --release RELEASE | --input-dir INPUT_DIR)
[--blas | --no-blas] [--fft | --no-fft] [--miopen | --no-miopen] [--prim | --no-prim]
[--blas | --no-blas] [--fft | --no-fft] [--hipdnn | --no-hipdnn] [--miopen | --no-miopen] [--prim | --no-prim]
[--rand | --no-rand] [--rccl | --no-rccl] [--tests | --no-tests] [--base-only]

Examples:
Expand Down Expand Up @@ -154,14 +154,18 @@ def retrieve_artifacts_by_run_id(args):

if args.base_only:
argv.extend(base_artifact_patterns)
elif any([args.blas, args.fft, args.miopen, args.prim, args.rand, args.rccl]):
elif any(
[args.blas, args.fft, args.hipdnn, args.miopen, args.prim, args.rand, args.rccl]
):
argv.extend(base_artifact_patterns)

extra_artifacts = []
if args.blas:
extra_artifacts.append("blas")
if args.fft:
extra_artifacts.append("fft")
if args.hipdnn:
extra_artifacts.append("hipdnn")
if args.miopen:
extra_artifacts.append("miopen")
if args.prim:
Expand Down Expand Up @@ -303,6 +307,13 @@ def main(argv):
action=argparse.BooleanOptionalAction,
)

artifacts_group.add_argument(
"--hipdnn",
default=False,
help="Include 'hipdnn' artifacts",
action=argparse.BooleanOptionalAction,
)

artifacts_group.add_argument(
"--miopen",
default=False,
Expand Down
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ add_test(
"-DTHEROCK_ENABLE_BLAS=${THEROCK_ENABLE_BLAS}"
"-DTHEROCK_ENABLE_FFT=${THEROCK_ENABLE_FFT}"
"-DTHEROCK_ENABLE_HIP=${THEROCK_ENABLE_HIP_RUNTIME}"
"-DTHEROCK_ENABLE_HIPDNN=${THEROCK_ENABLE_HIPDNN}"
"-DTHEROCK_ENABLE_MIOPEN=${THEROCK_ENABLE_MIOPEN}"
"-DTHEROCK_ENABLE_PRIM=${THEROCK_ENABLE_PRIM}"
"-DTHEROCK_ENABLE_RAND=${THEROCK_ENABLE_RAND}"
Expand Down
1 change: 1 addition & 0 deletions examples/clean_configure_test_project.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(propagate_vars
THEROCK_ENABLE_BLAS
THEROCK_ENABLE_FFT
THEROCK_ENABLE_HIP
THEROCK_ENABLE_HIPDNN
THEROCK_ENABLE_MIOPEN
THEROCK_ENABLE_PRIM
THEROCK_ENABLE_RAND
Expand Down
6 changes: 6 additions & 0 deletions examples/cpp-sdk-user/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ include(CMakeDependentOption)
option(THEROCK_ENABLE_BLAS "Whether hipblas/hipblaslt/rocblas are available" ON)
option(THEROCK_ENABLE_FFT "Whether the FFT libraries are available" ON)
option(THEROCK_ENABLE_HIP "Whether the HIP runtime and compiler are available" ON)
option(THEROCK_ENABLE_HIPDNN "Whether hipDNN is available" ON)
option(THEROCK_ENABLE_MIOPEN "Whether MIOpen is available" ON)
option(THEROCK_ENABLE_PRIM "Whether rocprim is available" ON)
option(THEROCK_ENABLE_RAND "Whether rocrand/hiprand are available" ON)
Expand Down Expand Up @@ -136,3 +137,8 @@ if(THEROCK_ENABLE_HIP)
endif()
endif()
endif()

if(THEROCK_ENABLE_HIPDNN)
find_package(hipdnn_backend CONFIG REQUIRED)
message(STATUS "hipdnn version: ${hipdnn_VERSION}")
endif()
53 changes: 53 additions & 0 deletions ml-libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,56 @@ if(THEROCK_ENABLE_MIOPEN)
MIOpen
)
endif(THEROCK_ENABLE_MIOPEN)

if(THEROCK_ENABLE_HIPDNN)
##############################################################################
# hipDNN
##############################################################################

therock_cmake_subproject_declare(hipDNN
EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_LIBRARIES_SOURCE_DIR}/projects/hipdnn"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/hipDNN"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
-DROCM_PATH=
-DROCM_DIR=
"-DHIP_DNN_SKIP_TESTS=$<NOT:$<BOOL:${THEROCK_BUILD_TESTING}>>"
-DHIP_DNN_BUILD_BACKEND=ON
-DHIP_DNN_BUILD_FRONTEND=ON
-DHIP_DNN_BUILD_PLUGINS=OFF
-DHIP_DNN_GENERATE_SDK_HEADERS=OFF
-DENABLE_CLANG_TIDY=OFF
-DENABLE_CLANG_FORMAT=OFF
CMAKE_INCLUDES
therock_explicit_finders.cmake
COMPILER_TOOLCHAIN
amd-hip
BUILD_DEPS
therock-googletest
RUNTIME_DEPS
hip-clr
therock-fmt
therock-flatbuffers
therock-nlohmann-json
therock-spdlog
)
therock_cmake_subproject_glob_c_sources(hipDNN
SUBDIRS
.
)
therock_cmake_subproject_activate(hipDNN)

therock_provide_artifact(hipdnn
DESCRIPTOR artifact-hipdnn.toml
COMPONENTS
dbg
dev
doc
lib
run
test
SUBPROJECT_DEPS
hipDNN
)
endif(THEROCK_ENABLE_HIPDNN)
16 changes: 16 additions & 0 deletions ml-libs/artifact-hipdnn.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# hipDNN
[components.dbg."ml-libs/hipDNN/stage"]
[components.dev."ml-libs/hipDNN/stage"]
[components.doc."ml-libs/hipDNN/stage"]
[components.lib."ml-libs/hipDNN/stage"]
exclude = [
"lib/libhipdnn_backend_private.a",
"lib/test_plugins/**",
]
[components.test."ml-libs/hipDNN/stage"]
include = [
"bin/*hipdnn_*_tests*",
"bin/CTestTestfile.cmake",
"lib/test_plugins/**",
]
[components.run."ml-libs/hipDNN/stage"]
10 changes: 10 additions & 0 deletions third-party/flatbuffers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ therock_cmake_subproject_declare(therock-flatbuffers
therock_cmake_subproject_provide_package(therock-flatbuffers flatbuffers lib/cmake)
therock_cmake_subproject_activate(therock-flatbuffers)

if(THEROCK_ENABLE_HIPDNN)
therock_provide_artifact(flatbuffers
DESCRIPTOR artifact-flatbuffers.toml
COMPONENTS
dev
SUBPROJECT_DEPS
therock-flatbuffers
)
endif()

add_dependencies(therock-third-party therock-flatbuffers)
2 changes: 2 additions & 0 deletions third-party/flatbuffers/artifact-flatbuffers.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# flatbuffers
[components.dev."third-party/flatbuffers/stage"]
10 changes: 10 additions & 0 deletions third-party/fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ therock_cmake_subproject_provide_package(
therock-fmt fmt lib/cmake/fmt)
therock_cmake_subproject_activate(therock-fmt)

if(THEROCK_ENABLE_HIPDNN)
therock_provide_artifact(fmt
DESCRIPTOR artifact-fmt.toml
COMPONENTS
dev
SUBPROJECT_DEPS
therock-fmt
)
endif()

add_dependencies(therock-third-party therock-fmt)
2 changes: 2 additions & 0 deletions third-party/fmt/artifact-fmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# fmt
[components.dev."third-party/fmt/stage"]
10 changes: 10 additions & 0 deletions third-party/nlohmann-json/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ therock_cmake_subproject_provide_package(
therock-nlohmann-json nlohmann_json share/cmake/nlohmann_json)
therock_cmake_subproject_activate(therock-nlohmann-json)

if(THEROCK_ENABLE_HIPDNN)
therock_provide_artifact(nlohmann-json
DESCRIPTOR artifact-nlohmann-json.toml
COMPONENTS
dev
SUBPROJECT_DEPS
therock-nlohmann-json
)
endif()

add_dependencies(therock-third-party therock-nlohmann-json)
2 changes: 2 additions & 0 deletions third-party/nlohmann-json/artifact-nlohmann-json.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# nlohmann-json
[components.dev."third-party/nlohmann-json/stage"]
10 changes: 10 additions & 0 deletions third-party/spdlog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@ therock_cmake_subproject_declare(therock-spdlog
therock_cmake_subproject_provide_package(therock-spdlog spdlog lib/cmake)
therock_cmake_subproject_activate(therock-spdlog)

if(THEROCK_ENABLE_HIPDNN)
therock_provide_artifact(spdlog
DESCRIPTOR artifact-spdlog.toml
COMPONENTS
dev
SUBPROJECT_DEPS
therock-spdlog
)
endif()

add_dependencies(therock-third-party therock-spdlog)
2 changes: 2 additions & 0 deletions third-party/spdlog/artifact-spdlog.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# spdlog
[components.dev."third-party/spdlog/stage"]
Loading