Skip to content

Commit d6fc047

Browse files
BrianHarrisonAMDSamuelReedermarbre
authored
Add hipDNN to TheRock (#1689)
## Motivation This PR adds hipDNN into TheRock with tests enabled. ## Technical Details hipDNN is a new project for ml-libs. ## Test Plan Running tests in the CI & local tests to ensure build is working properly. ## Test Result Tests pass for hipDNN in #1759 --------- Co-authored-by: Samuel Reeder <[email protected]> Co-authored-by: Marius Brehler <[email protected]>
1 parent 9190789 commit d6fc047

File tree

12 files changed

+183
-46
lines changed

12 files changed

+183
-46
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,16 @@ therock_add_feature(MIOPEN
310310
REQUIRES COMPILER HIP_RUNTIME BLAS RAND ${_optional_profiler_requirements}
311311
)
312312

313+
# hipDNN on Windows is disabled for now, but will be enabled in a follow-up change.
314+
# Windows support issue tracked at: https://github.com/ROCm/TheRock/issues/1822
315+
if(NOT WIN32)
316+
therock_add_feature(HIPDNN
317+
GROUP ML_LIBS
318+
DESCRIPTION "Enables the hipDNN project"
319+
REQUIRES COMPILER HIP_RUNTIME
320+
)
321+
endif()
322+
313323
# Finalize all feature flags.
314324
therock_finalize_features()
315325
therock_report_features()

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ minimal build):
172172
| `-DTHEROCK_ENABLE_SOLVER=ON` | Enables the SOLVER libraries |
173173
| `-DTHEROCK_ENABLE_SPARSE=ON` | Enables the SPARSE libraries |
174174
| `-DTHEROCK_ENABLE_MIOPEN=ON` | Enables MIOpen |
175+
| `-DTHEROCK_ENABLE_HIPDNN=ON` | Enables hipDNN |
175176

176177
> [!TIP]
177178
> Enabling any features will implicitly enable their *minimum* dependencies. Some

build_tools/github_actions/fetch_test_configurations.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ def _get_script_path(script_name: str) -> str:
170170
"platform": ["linux"],
171171
"total_shards": 1,
172172
},
173+
# hipDNN tests
174+
"hipdnn": {
175+
"job_name": "hipdnn",
176+
"fetch_artifact_args": "--hipdnn --tests",
177+
"timeout_minutes": 5,
178+
"test_script": f"python {_get_script_path('test_hipdnn.py')}",
179+
"platform": ["linux"],
180+
"total_shards": 1,
181+
},
173182
}
174183

175184

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import logging
2+
import os
3+
import shlex
4+
import subprocess
5+
from pathlib import Path
6+
7+
THEROCK_BIN_DIR = os.getenv("THEROCK_BIN_DIR")
8+
SCRIPT_DIR = Path(__file__).resolve().parent
9+
THEROCK_DIR = SCRIPT_DIR.parent.parent.parent
10+
11+
logging.basicConfig(level=logging.INFO)
12+
13+
cmd = [
14+
"ctest",
15+
"--test-dir",
16+
f"{THEROCK_BIN_DIR}/hipdnn",
17+
"--output-on-failure",
18+
"--parallel",
19+
"8",
20+
"--timeout",
21+
"10",
22+
]
23+
logging.info(f"++ Exec [{THEROCK_DIR}]$ {shlex.join(cmd)}")
24+
25+
subprocess.run(
26+
cmd,
27+
cwd=THEROCK_DIR,
28+
check=True,
29+
)

build_tools/install_rocm_from_artifacts.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[--output-dir OUTPUT_DIR]
1515
[--amdgpu-family AMDGPU_FAMILY]
1616
(--run-id RUN_ID | --release RELEASE | --input-dir INPUT_DIR)
17-
[--blas | --no-blas] [--fft | --no-fft] [--miopen | --no-miopen] [--prim | --no-prim]
17+
[--blas | --no-blas] [--fft | --no-fft] [--hipdnn | --no-hipdnn] [--miopen | --no-miopen] [--prim | --no-prim]
1818
[--rand | --no-rand] [--rccl | --no-rccl] [--tests | --no-tests] [--base-only]
1919
2020
Examples:
@@ -154,7 +154,9 @@ def retrieve_artifacts_by_run_id(args):
154154

155155
if args.base_only:
156156
argv.extend(base_artifact_patterns)
157-
elif any([args.blas, args.fft, args.miopen, args.prim, args.rand, args.rccl]):
157+
elif any(
158+
[args.blas, args.fft, args.hipdnn, args.miopen, args.prim, args.rand, args.rccl]
159+
):
158160
argv.extend(base_artifact_patterns)
159161

160162
extra_artifacts = []
@@ -163,6 +165,8 @@ def retrieve_artifacts_by_run_id(args):
163165
if args.fft:
164166
extra_artifacts.append("fft")
165167
extra_artifacts.append("fftw3")
168+
if args.hipdnn:
169+
extra_artifacts.append("hipdnn")
166170
if args.miopen:
167171
extra_artifacts.append("miopen")
168172
if args.prim:
@@ -304,6 +308,13 @@ def main(argv):
304308
action=argparse.BooleanOptionalAction,
305309
)
306310

311+
artifacts_group.add_argument(
312+
"--hipdnn",
313+
default=False,
314+
help="Include 'hipdnn' artifacts",
315+
action=argparse.BooleanOptionalAction,
316+
)
317+
307318
artifacts_group.add_argument(
308319
"--miopen",
309320
default=False,

docs/development/installing_artifacts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The script supports the following command-line options:
1212
| `--base-only` | Flag | Include only base artifacts (minimal installation) |
1313
| `--blas` | Flag | Include BLAS artifacts |
1414
| `--fft` | Flag | Include FFT artifacts |
15+
| `--hipdnn` | Flag | Include hipDNN artifacts |
1516
| `--input-dir` | String | Existing TheRock directory to copy from |
1617
| `--miopen` | Flag | Include MIOpen artifacts |
1718
| `--output-dir` | Path | Output directory for TheRock installation (default: `./therock-build`) |

docs/development/windows_support.md

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,51 @@ This table tracks current support status for each subproject in TheRock on
2323
Windows. Some subprojects may need extra patches to build within TheRock (on
2424
mainline, in open source, using MSVC, etc.).
2525

26-
| Component subset | Subproject | Supported | Notes |
27-
| ------------------- | ---------------------------------------------------------------------------- | --------- | --------------------------------------------- |
28-
| base | aux-overlay || |
29-
| base | [amdsmi](https://github.com/ROCm/amdsmi) || Unsupported |
30-
| base | [rocm-cmake](https://github.com/ROCm/rocm-cmake) || |
31-
| base | [rocm-core](https://github.com/ROCm/rocm-core) || |
32-
| base | [rocm_smi_lib](https://github.com/ROCm/rocm_smi_lib) || Unsupported |
33-
| base | [rocprofiler-register](https://github.com/ROCm/rocprofiler-register) || Unsupported |
34-
| base | [rocm-half](https://github.com/ROCm/half) || |
35-
| | | | |
36-
| compiler | [amd-llvm](https://github.com/ROCm/llvm-project) || Limited runtimes |
37-
| compiler | [amd-comgr](https://github.com/ROCm/llvm-project/tree/amd-staging/amd/comgr) || |
38-
| compiler | [hipcc](https://github.com/ROCm/llvm-project/tree/amd-staging/amd/hipcc) || |
39-
| compiler | [hipify](https://github.com/ROCm/HIPIFY) || |
40-
| | | | |
41-
| core | [ROCR-Runtime](https://github.com/ROCm/ROCR-Runtime) || Unsupported |
42-
| core | [rocminfo](https://github.com/ROCm/rocminfo) || Unsupported |
43-
| core | [hipInfo from hip-tests](https://github.com/ROCm/hip-tests) || |
44-
| core | [clr](https://github.com/ROCm/clr) | 🟡 | Needs a folder with prebuilt static libraries |
45-
| | | | |
46-
| profiler | [rocprofiler-sdk](https://github.com/ROCm/rocprofiler-sdk) || Unsupported |
47-
| | | | |
48-
| comm-libs | [rccl](https://github.com/ROCm/rccl) || Unsupported |
49-
| | | | |
50-
| math-libs | [rocRAND](https://github.com/ROCm/rocRAND) || |
51-
| math-libs | [hipRAND](https://github.com/ROCm/hipRAND) || |
52-
| math-libs | [rocPRIM](https://github.com/ROCm/rocPRIM) || |
53-
| math-libs | [hipCUB](https://github.com/ROCm/hipCUB) || |
54-
| math-libs | [rocThrust](https://github.com/ROCm/rocThrust) || |
55-
| math-libs | [rocFFT](https://github.com/ROCm/rocFFT) || |
56-
| math-libs | [hipFFT](https://github.com/ROCm/hipFFT) || |
57-
| math-libs (support) | [mxDataGenerator](https://github.com/ROCm/mxDataGenerator) || Unsupported |
58-
| math-libs (BLAS) | [hipBLAS-common](https://github.com/ROCm/hipBLAS-common) || |
59-
| math-libs (BLAS) | [rocRoller](https://github.com/ROCm/rocRoller) || Unsupported |
60-
| math-libs (BLAS) | [hipBLASLt](https://github.com/ROCm/hipBLASLt) || |
61-
| math-libs (BLAS) | [rocBLAS](https://github.com/ROCm/rocBLAS) || |
62-
| math-libs (BLAS) | [rocSPARSE](https://github.com/ROCm/rocSPARSE) || |
63-
| math-libs (BLAS) | [hipSPARSE](https://github.com/ROCm/hipSPARSE) || |
64-
| math-libs (BLAS) | [rocSOLVER](https://github.com/ROCm/rocSOLVER) || |
65-
| math-libs (BLAS) | [hipSOLVER](https://github.com/ROCm/hipSOLVER) || |
66-
| math-libs (BLAS) | [hipBLAS](https://github.com/ROCm/hipBLAS) || |
67-
| | | | |
68-
| ml-libs | [Composable Kernel](https://github.com/ROCm/composable_kernel) || Unsupported |
69-
| ml-libs | [MIOpen](https://github.com/ROCm/MIOpen) || |
26+
| Component subset | Subproject | Supported | Notes |
27+
| ------------------- | ----------------------------------------------------------------------------- | --------- | --------------------------------------------- |
28+
| base | aux-overlay || |
29+
| base | [amdsmi](https://github.com/ROCm/amdsmi) || Unsupported |
30+
| base | [rocm-cmake](https://github.com/ROCm/rocm-cmake) || |
31+
| base | [rocm-core](https://github.com/ROCm/rocm-core) || |
32+
| base | [rocm_smi_lib](https://github.com/ROCm/rocm_smi_lib) || Unsupported |
33+
| base | [rocprofiler-register](https://github.com/ROCm/rocprofiler-register) || Unsupported |
34+
| base | [rocm-half](https://github.com/ROCm/half) || |
35+
| | | | |
36+
| compiler | [amd-llvm](https://github.com/ROCm/llvm-project) || Limited runtimes |
37+
| compiler | [amd-comgr](https://github.com/ROCm/llvm-project/tree/amd-staging/amd/comgr) || |
38+
| compiler | [hipcc](https://github.com/ROCm/llvm-project/tree/amd-staging/amd/hipcc) || |
39+
| compiler | [hipify](https://github.com/ROCm/HIPIFY) || |
40+
| | | | |
41+
| core | [ROCR-Runtime](https://github.com/ROCm/ROCR-Runtime) || Unsupported |
42+
| core | [rocminfo](https://github.com/ROCm/rocminfo) || Unsupported |
43+
| core | [hipInfo from hip-tests](https://github.com/ROCm/hip-tests) || |
44+
| core | [clr](https://github.com/ROCm/clr) | 🟡 | Needs a folder with prebuilt static libraries |
45+
| | | | |
46+
| profiler | [rocprofiler-sdk](https://github.com/ROCm/rocprofiler-sdk) || Unsupported |
47+
| | | | |
48+
| comm-libs | [rccl](https://github.com/ROCm/rccl) || Unsupported |
49+
| | | | |
50+
| math-libs | [rocRAND](https://github.com/ROCm/rocRAND) || |
51+
| math-libs | [hipRAND](https://github.com/ROCm/hipRAND) || |
52+
| math-libs | [rocPRIM](https://github.com/ROCm/rocPRIM) || |
53+
| math-libs | [hipCUB](https://github.com/ROCm/hipCUB) || |
54+
| math-libs | [rocThrust](https://github.com/ROCm/rocThrust) || |
55+
| math-libs | [rocFFT](https://github.com/ROCm/rocFFT) || |
56+
| math-libs | [hipFFT](https://github.com/ROCm/hipFFT) || |
57+
| math-libs (support) | [mxDataGenerator](https://github.com/ROCm/mxDataGenerator) || Unsupported |
58+
| math-libs (BLAS) | [hipBLAS-common](https://github.com/ROCm/hipBLAS-common) || |
59+
| math-libs (BLAS) | [rocRoller](https://github.com/ROCm/rocRoller) || Unsupported |
60+
| math-libs (BLAS) | [hipBLASLt](https://github.com/ROCm/hipBLASLt) || |
61+
| math-libs (BLAS) | [rocBLAS](https://github.com/ROCm/rocBLAS) || |
62+
| math-libs (BLAS) | [rocSPARSE](https://github.com/ROCm/rocSPARSE) || |
63+
| math-libs (BLAS) | [hipSPARSE](https://github.com/ROCm/hipSPARSE) || |
64+
| math-libs (BLAS) | [rocSOLVER](https://github.com/ROCm/rocSOLVER) || |
65+
| math-libs (BLAS) | [hipSOLVER](https://github.com/ROCm/hipSOLVER) || |
66+
| math-libs (BLAS) | [hipBLAS](https://github.com/ROCm/hipBLAS) || |
67+
| | | | |
68+
| ml-libs | [Composable Kernel](https://github.com/ROCm/composable_kernel) || Unsupported |
69+
| ml-libs | [MIOpen](https://github.com/ROCm/MIOpen) || |
70+
| ml-libs | [hipDNN](https://github.com/ROCm/rocm-libraries/tree/develop/projects/hipdnn) || Unsupported |
7071

7172
## Building TheRock from source
7273

examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ add_test(
3131
"-DTHEROCK_ENABLE_BLAS=${THEROCK_ENABLE_BLAS}"
3232
"-DTHEROCK_ENABLE_FFT=${THEROCK_ENABLE_FFT}"
3333
"-DTHEROCK_ENABLE_HIP=${THEROCK_ENABLE_HIP_RUNTIME}"
34+
"-DTHEROCK_ENABLE_HIPDNN=${THEROCK_ENABLE_HIPDNN}"
3435
"-DTHEROCK_ENABLE_MIOPEN=${THEROCK_ENABLE_MIOPEN}"
3536
"-DTHEROCK_ENABLE_PRIM=${THEROCK_ENABLE_PRIM}"
3637
"-DTHEROCK_ENABLE_RAND=${THEROCK_ENABLE_RAND}"

examples/clean_configure_test_project.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(propagate_vars
88
THEROCK_ENABLE_BLAS
99
THEROCK_ENABLE_FFT
1010
THEROCK_ENABLE_HIP
11+
THEROCK_ENABLE_HIPDNN
1112
THEROCK_ENABLE_MIOPEN
1213
THEROCK_ENABLE_PRIM
1314
THEROCK_ENABLE_RAND

0 commit comments

Comments
 (0)