Skip to content
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4cdd574
Add hipdnn and miopen-plugin to python packages
BrianHarrisonAMD Jan 15, 2026
e1d0587
add hipdnn to dist info
BrianHarrisonAMD Jan 15, 2026
232ac0b
Add hipdnn to the _rocm_init.py example
BrianHarrisonAMD Jan 15, 2026
94f2ee7
Add hipdnn to the prod wheels preload for Pytorch build
BrianHarrisonAMD Jan 15, 2026
a009ffd
Move hipDNN to the libraries location and allow generic targets
BrianHarrisonAMD Jan 20, 2026
a1fc728
Merge branch 'main' into users/bharriso/hipdnn-python-packaging
BrianHarrisonAMD Jan 20, 2026
4d6164a
Merge branch 'main' into users/bharriso/hipdnn-python-packaging
BrianHarrisonAMD Jan 21, 2026
f90fae2
Exclude plugins from the python loading tests
BrianHarrisonAMD Jan 22, 2026
e712582
Add third party deps as well to wheel install
BrianHarrisonAMD Jan 22, 2026
68bccf2
Merge branch 'main' into users/bharriso/hipdnn-python-packaging
BrianHarrisonAMD Jan 26, 2026
5adb0a4
Include the plugins, and use path to simulate plugin loading
BrianHarrisonAMD Jan 28, 2026
cd4d025
Merge branch 'users/bharriso/hipdnn-python-packaging' of github.com:R…
BrianHarrisonAMD Jan 28, 2026
7fb39e6
Swap to add_dll_directory instead of PATH due to python 3.8 loading b…
BrianHarrisonAMD Jan 28, 2026
4490d10
Move plugin check to match other customized logic and minimize indent…
BrianHarrisonAMD Jan 28, 2026
5ddc423
Merge branch 'main' into users/bharriso/hipdnn-python-packaging
BrianHarrisonAMD Jan 28, 2026
3177708
Merge branch 'main' into users/bharriso/hipdnn-python-packaging
BrianHarrisonAMD Jan 29, 2026
f681b6b
Merge branch 'main' into users/bharriso/hipdnn-python-packaging
BrianHarrisonAMD Feb 2, 2026
d09044e
Add test_plugins RPATH, and dll path loading for Windows
BrianHarrisonAMD Feb 2, 2026
c56ae95
Merge branch 'users/bharriso/hipdnn-python-packaging' of github.com:R…
BrianHarrisonAMD Feb 2, 2026
ca69fc5
Merge branch 'main' into users/bharriso/hipdnn-python-packaging
BrianHarrisonAMD Feb 3, 2026
cd80df5
Attempting RPATH magic in hipDNN instead
mousdahl-amd Feb 4, 2026
ea1bb06
Merge remote-tracking branch 'origin/main' into users/bharriso/hipdnn…
mousdahl-amd Feb 10, 2026
2c9a1f1
Merge remote-tracking branch 'origin/main' into users/bharriso/hipdnn…
mousdahl-amd Feb 10, 2026
95aa633
Merge branch 'users/bharriso/hipdnn-python-packaging' of github.com:R…
mousdahl-amd Feb 10, 2026
8a55aa7
Adding hipblaslt-plugin for hipDNN
mousdahl-amd Feb 10, 2026
2bc9d43
Merge remote-tracking branch 'origin/main' into users/bharriso/hipdnn…
mousdahl-amd Feb 17, 2026
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: 8 additions & 1 deletion build_tools/build_python_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ def run(args: argparse.Namespace):
# included in runtime packages, but we still want them in the devel package.
"prim",
"rocwmma",
# Third party dependencies needed by hipDNN consumers.
"flatbuffers",
"fmt",
"nlohmann-json",
"spdlog",
],
tarball_compression=args.devel_tarball_compression,
)
Expand Down Expand Up @@ -113,15 +118,17 @@ def libraries_artifact_filter(target_family: str, an: ArtifactName) -> bool:
in [
"blas",
"fft",
"hipdnn",
"miopen",
"miopen-plugin",
"rand",
"rccl",
]
and an.component
in [
"lib",
]
and an.target_family == target_family
and (an.target_family == target_family or an.target_family == "generic")
)
return libraries

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def determine_target_family() -> str:
LibraryEntry("hipsolver", "libraries", "libhipsolver.so*", "hipsolver*.dll")
LibraryEntry("rccl", "libraries", "librccl.so*", "")
LibraryEntry("miopen", "libraries", "libMIOpen.so*", "MIOpen*.dll")
LibraryEntry("hipdnn", "libraries", "libhipdnn_backend.so*", "hipdnn_backend*.dll")

# Others we may want:
# hiprtc-builtins
Expand Down
Comment thread
mousdahl-amd marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""Installation package tests for the core package."""

import importlib
import os
from pathlib import Path
import platform
import subprocess
Expand Down Expand Up @@ -152,11 +153,30 @@ def testSharedLibrariesLoad(self):
if "libtest_linking_lib" in str(so_path):
# rocprim unit tests, not actual library files
continue

extra_setup = ""
if "hipdnn_plugins" in str(so_path) and sys.platform == "win32":
# hipdnn plugins have dependencies on other libraries (e.g. miopen).
# In a real-world scenario, hipdnn_backend loads these plugins, and
# the dependencies are found because they reside in the same directory
# (or are otherwise resolvable).
# To simulate this loading behavior in the test:
# - On Linux, RPATH ($ORIGIN/../../) handles dependency resolution.
# - On Windows, we must manually add the library directory (calculated
# relative to the plugin) via add_dll_directory, as there is no RPATH equivalent.
# We assume the plugin is at .../{lib|bin}/hipdnn_plugins/engines/plugin.so
# and the dependencies are at .../{lib|bin}.
lib_dir = str(so_path.parents[2]).replace("\\", "\\\\")
extra_setup = f"import os; os.add_dll_directory('{lib_dir}') if hasattr(os, 'add_dll_directory') else None; "

with self.subTest(msg="Check shared library loads", so_path=so_path):
# Load each in an isolated process because not all libraries in the tree
# are designed to load into the same process (i.e. LLVM runtime libs,
# etc).
command = "import ctypes; import sys; ctypes.CDLL(sys.argv[1])"
command = (
extra_setup + "import ctypes; import sys; ctypes.CDLL(sys.argv[1])"
)

subprocess.check_call(
[sys.executable, "-P", "-c", command, str(so_path)]
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""Installation package tests for the core package."""

import importlib
import os
from pathlib import Path
import subprocess
import sys
Expand Down Expand Up @@ -61,6 +62,21 @@ def testSharedLibrariesLoad(self):
# Though this is not needed for the amd-smi client.
continue

extra_setup = ""
if "hipdnn_plugins" in str(so_path) and sys.platform == "win32":
# hipdnn plugins have dependencies on other libraries (e.g. miopen).
# In a real-world scenario, hipdnn_backend loads these plugins, and
# the dependencies are found because they reside in the same directory
# (or are otherwise resolvable).
# To simulate this loading behavior in the test:
# - On Linux, RPATH ($ORIGIN/../../) handles dependency resolution.
# - On Windows, we must manually add the library directory (calculated
# relative to the plugin) via add_dll_directory, as there is no RPATH equivalent.
# We assume the plugin is at .../{lib|bin}/hipdnn_plugins/engines/plugin.so
# and the dependencies are at .../{lib|bin}.
lib_dir = str(so_path.parents[2]).replace("\\", "\\\\")
extra_setup = f"import os; os.add_dll_directory('{lib_dir}') if hasattr(os, 'add_dll_directory') else None; "

# For Windows compatibility, we first preload libraries (DLLs)
# that are not co-located. Specifically this is for
# the "libraries" like hipfft, rocblas, etc. which are siblings
Expand All @@ -74,9 +90,11 @@ def testSharedLibrariesLoad(self):
# are designed to load into the same process (i.e. LLVM runtime libs,
# etc).
command = (
preload_command
extra_setup
+ preload_command
+ " import ctypes; import sys; ctypes.CDLL(sys.argv[1])"
)

subprocess.check_call(
[sys.executable, "-P", "-c", command, str(so_path)]
)
Expand Down
1 change: 1 addition & 0 deletions docs/packaging/python_packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def initialize():
'rccl',
'hipblaslt',
'miopen',
'hipdnn',
],
check_version='$(rocm-sdk version)')
" > torch/_rocm_init.py
Expand Down
2 changes: 2 additions & 0 deletions external-builds/pytorch/build_prod_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
"rccl", # Linux only for the moment.
"hipblaslt",
"miopen",
"hipdnn",
"rocm_sysdeps_liblzma",
"rocm-openblas",
]
Expand All @@ -159,6 +160,7 @@
"hipsolver",
"hipblaslt",
"miopen",
"hipdnn",
"rocm-openblas",
]

Expand Down
Loading