Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d5c0725
[CK DSL] Add hipDNN provider implementation plan.
DarylHawkinsAMD May 21, 2026
0a84024
[CK DSL] Add provider skeleton (M1 step I-1).
DarylHawkinsAMD May 21, 2026
33fef48
[CK DSL] Embed CPython interpreter in provider plugin (M1 step I-2).
DarylHawkinsAMD May 21, 2026
f94aa38
[CK DSL] Add Python compile-service bridge (M1 step I-3).
DarylHawkinsAMD May 21, 2026
6137883
[CK DSL] Hold GIL while releasing CompileServiceBridge module ref.
DarylHawkinsAMD May 21, 2026
97b83a3
[CK DSL] Commit transient WIP scratch for session handoff.
DarylHawkinsAMD May 21, 2026
14cc08b
[CK DSL] Add KernelArtifact/HipModule round-trip (M1 step I-4).
DarylHawkinsAMD May 21, 2026
ce00d01
[CK DSL] Add in-memory JitCache (M1 step I-5).
DarylHawkinsAMD May 21, 2026
eec18b0
[CK DSL] Add ConvImplicitGemm spec + adapter + payload (M1 step I-6).
DarylHawkinsAMD May 21, 2026
5c39c0d
[CK DSL] Add ConvImplicitGemm plan builder + JIT path (M1 step I-7).
DarylHawkinsAMD May 21, 2026
2b10cb6
[CK DSL] Wire ConvImplicitGemmPlan::execute() (M1 step I-8).
DarylHawkinsAMD May 21, 2026
b8eacca
[CK DSL] Add PerfMeasurement hipEvent helper (M1 step I-9).
DarylHawkinsAMD May 21, 2026
31c11b0
[CK DSL] Add IntegrationGpuCkDslConvFp16 (M1 step I-10).
DarylHawkinsAMD May 21, 2026
66b9956
[CK DSL] Wire ck-dsl-provider check targets (M1 step I-11).
DarylHawkinsAMD May 22, 2026
6d044db
Fixed PR feedback
DarylHawkinsAMD May 29, 2026
37de1d9
[CK DSL] Add architecture diagrams to ck-dsl-provider README
DarylHawkinsAMD May 29, 2026
9da9442
[CK DSL] Parameterize conv integration test across shapes.
DarylHawkinsAMD May 29, 2026
2ba7db8
[CK DSL] Provider cleanup: dedup graph signature, drop dead code
DarylHawkinsAMD May 30, 2026
53df5ed
[CK DSL] Link provider README to design plan
DarylHawkinsAMD May 30, 2026
a7f518b
[CK DSL] Thread target arch through conv compile path; fail closed on…
DarylHawkinsAMD May 31, 2026
4f79fd6
[CK DSL] Address arch-threading PR feedback: memoize arch detection, …
DarylHawkinsAMD May 31, 2026
46c7d4a
[CK DSL] Make smoke path arch-aware; refocus the gfx950 test gate
DarylHawkinsAMD May 31, 2026
0013b1a
[ci][hipdnn-superbuild]: Fix hipdnn labeler issue (#7467)
adickin-amd May 28, 2026
5293118
Added end to end tests with a single shape on all supported archs (gf…
DarylHawkinsAMD May 31, 2026
0b0a9b1
[CK DSL] Remove WIP scratch artifacts from provider branch
DarylHawkinsAMD May 31, 2026
85119c5
Updated architecture diagrams
DarylHawkinsAMD Jun 1, 2026
ec86e94
[CK DSL] Embed python-build-standalone interpreter (drop system Python)
DarylHawkinsAMD Jun 8, 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
37 changes: 1 addition & 36 deletions .github/workflows/hipdnn-superbuild-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: hipDNN Superbuild CI

on:
pull_request:
types: [opened, synchronize, reopened, labeled]
types: [opened, synchronize, reopened]
paths:
- 'projects/hipdnn/**'
- 'dnn-providers/**'
Expand All @@ -20,41 +20,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

env:
# Labels that trigger this workflow. Extend this list to gate on additional labels.
TRIGGER_LABELS: '["project: hipdnn", "project: miopen-provider", "project: hipblaslt-provider", "project: hip-kernel-provider", "project: hipdnn-integration-tests"]'

jobs:
gate:
name: Check Labels
runs-on: ubuntu-24.04
outputs:
should_run: ${{ steps.check.outputs.should_run }}
steps:
- name: Evaluate PR labels
id: check
env:
PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
run: |
echo "PR labels: $PR_LABELS"

# Check if any trigger label is present
TRIGGER='${{ env.TRIGGER_LABELS }}'
MATCH=$(echo "$PR_LABELS" | jq -e --argjson trigger "$TRIGGER" \
'[.[] | select(. as $l | $trigger | index($l))] | length > 0')

if [ "$MATCH" = "true" ]; then
echo "Trigger label found"
echo "should_run=true" >> "$GITHUB_OUTPUT"
else
echo "No trigger label found"
echo "should_run=false" >> "$GITHUB_OUTPUT"
fi

hipdnn-windows-superbuild:
name: HipDNN Windows Superbuild
needs: gate
if: needs.gate.outputs.should_run == 'true'
runs-on: azure-windows-scale-rocm
defaults:
run:
Expand Down Expand Up @@ -157,8 +125,6 @@ jobs:

hipdnn-linux-superbuild:
name: HipDNN Linux Superbuild
needs: gate
if: needs.gate.outputs.should_run == 'true'
runs-on: azure-linux-scale-rocm
env:
GPU_TARGET: gfx94X-dcgpu
Expand Down Expand Up @@ -241,7 +207,6 @@ jobs:
name: hipDNN Superbuild Summary
if: always()
needs:
- gate
- hipdnn-windows-superbuild
- hipdnn-linux-superbuild
runs-on: ubuntu-24.04
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ set(AVAILABLE_COMPONENTS
miopen-provider
hipblaslt-provider
hip-kernel-provider
ck-dsl-provider
hipdnn-samples
)

Expand Down Expand Up @@ -219,6 +220,14 @@ if("hip-kernel-provider" IN_LIST ROCM_LIBS_ENABLE_COMPONENTS)
)
endif()

if("ck-dsl-provider" IN_LIST ROCM_LIBS_ENABLE_COMPONENTS)
add_subdirectory_with_message(
COMPONENT ck-dsl-provider
PREFIX_PATH dnn-providers
EXPECT_TARGET ck_dsl_provider_plugin
)
endif()

if("hipdnn-samples" IN_LIST ROCM_LIBS_ENABLE_COMPONENTS)
add_subdirectory_with_message(
COMPONENT samples
Expand Down
8 changes: 8 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@
"ROCM_LIBS_ENABLE_COMPONENTS": "hipdnn;hipdnn-integration-tests;hip-kernel-provider"
}
},
{
"name": "ck-dsl-provider",
"description": "Build hipdnn and ck-dsl-provider",
"inherits": ["default:release"],
"cacheVariables": {
"ROCM_LIBS_ENABLE_COMPONENTS": "hipdnn;ck-dsl-provider"
}
},
{
"name": "hipdnn-samples",
"description": "Build hipdnn, all supported providers, integration tests, and samples",
Expand Down
174 changes: 174 additions & 0 deletions dnn-providers/ck-dsl-provider/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Copyright © Advanced Micro Devices, Inc., or its affiliates.
# SPDX-License-Identifier: MIT

cmake_minimum_required(VERSION 3.25.2)
message(STATUS "Building CK DSL provider plugin")
add_compile_definitions(__HIP_PLATFORM_AMD__)

set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/ClangToolChain.cmake"
CACHE STRING "Toolchain file"
)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Version handling: read version.json + git SHA into CK_DSL_PROVIDER_*
# variables before project() so they can drive the project version.
include(${CMAKE_CURRENT_LIST_DIR}/cmake/CkDslProviderVersion.cmake)
ck_dsl_provider_setup_version()

project(ck-dsl-provider VERSION ${CK_DSL_PROVIDER_VERSION} LANGUAGES CXX)

include(CMakePackageConfigHelpers)

if(NOT WIN32)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${ROCM_PATH}" CACHE PATH "Install path prefix" FORCE)
endif()
message(STATUS "CK DSL provider install prefix: ${CMAKE_INSTALL_PREFIX}")
endif()

include(GNUInstallDirs)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE
CACHE BOOL "Add paths to linker search and installed rpath"
)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake
${CMAKE_CURRENT_SOURCE_DIR}/../cmake ${ROCM_PATH}/lib/cmake/hip ${HIP_DIR}/cmake
)

option(CKDSLPROVIDER_SKIP_TESTS "Skip building tests" OFF)

# NOTE: Workaround until llvm & hip cmake modules fixes symlink logic in their config files;
# remove when fixed. Added to prevent issues with not finding hip cmake.
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/llvm ${ROCM_PATH} ${ROCM_PATH}/hip)

find_package(hip REQUIRED)

# --- Embedded Python (python-build-standalone + pybind11) --------------------
# The plugin embeds a self-contained CPython so the provider can drive
# the CK DSL compile pipeline at runtime with no dependency on the host
# system Python. The interpreter is provisioned from astral's
# python-build-standalone (a pinned, relocatable prefix), discovered via
# find_package below, and bundled beside the plugin at install time.
# See cmake/CkDslPython.cmake. Provisioning honors -DCKDSL_PYTHON_DIST_DIR
# for air-gapped / pre-staged builds, else downloads the pinned tarball.
include(${CMAKE_CURRENT_LIST_DIR}/cmake/CkDslPython.cmake)
ck_dsl_provider_provision_python()

find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
message(STATUS "CK DSL provider Python3: ${Python3_EXECUTABLE} (${Python3_VERSION})")

# pybind11: prefer an installed CMake config; otherwise fetch a pinned
# release. pybind11 is header-only for the embed use case and resolves
# the provisioned interpreter through Python3_ROOT_DIR (set by the
# provisioning step above), so no host `pip install` is required.
find_package(pybind11 CONFIG QUIET)
if(NOT pybind11_FOUND)
include(FetchContent)
set(PYBIND11_FINDPYTHON ON CACHE INTERNAL "")
fetchcontent_declare(
pybind11 URL https://github.com/pybind/pybind11/archive/refs/tags/v2.13.6.tar.gz
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
fetchcontent_makeavailable(pybind11)
endif()
message(STATUS "CK DSL provider pybind11: ${pybind11_VERSION}")

# hipdnn SDK dependencies - use targets directly if available (superbuild),
# otherwise find installed packages (true standalone).
if(NOT TARGET hipdnn_data_sdk)
find_package(hipdnn_data_sdk CONFIG REQUIRED)
endif()
if(NOT TARGET hipdnn_flatbuffers_sdk)
find_package(hipdnn_flatbuffers_sdk CONFIG REQUIRED)
endif()
if(NOT TARGET hipdnn_plugin_sdk)
find_package(hipdnn_plugin_sdk CONFIG REQUIRED)
endif()

if(WIN32)
set(HIPDNN_PLUGIN_ENGINE_ROOTDIR "bin")
else()
set(HIPDNN_PLUGIN_ENGINE_ROOTDIR "lib")
endif()

# Both HIPDNN_PLUGIN_ENGINE_SUBDIR and HIPDNN_RELATIVE_INSTALL_PLUGIN_ENGINE_DIR
# are populated by the hipdnn_data_sdk package import above. Guard
# defensively so a standalone build (or a misconfigured SDK install)
# fails with a clear message instead of silently producing
# `build/lib//libfoo.so`.
if(NOT DEFINED HIPDNN_PLUGIN_ENGINE_SUBDIR)
message(FATAL_ERROR "HIPDNN_PLUGIN_ENGINE_SUBDIR was not set by hipdnn_data_sdk package import.")
endif()

set(HIPDNN_BUILD_PLUGIN_ENGINE_DIR
"${CMAKE_BINARY_DIR}/${HIPDNN_PLUGIN_ENGINE_ROOTDIR}/${HIPDNN_PLUGIN_ENGINE_SUBDIR}"
)

message(STATUS "CK DSL provider plugin build directory: ${HIPDNN_BUILD_PLUGIN_ENGINE_DIR}")
message(STATUS "CK DSL provider plugin install directory: ${HIPDNN_INSTALL_PLUGIN_ENGINE_DIR}")
file(MAKE_DIRECTORY ${HIPDNN_BUILD_PLUGIN_ENGINE_DIR})

# Resolve absolute paths to the in-tree ck_dsl Python package and the
# provider-local ck_dsl_provider package, then bake them into a
# generated header that the embedded interpreter uses to prepend them
# to sys.path (PREP_FINDINGS §P-4).
include(${CMAKE_CURRENT_LIST_DIR}/cmake/CkDslProviderPaths.cmake)
ck_dsl_provider_resolve_python_paths()

set(_ckDslPathsHeader "${CMAKE_CURRENT_BINARY_DIR}/include/ckdsl_provider_paths.h")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/templates/ckdsl_provider_paths.h.in"
"${_ckDslPathsHeader}"
@ONLY
)

add_subdirectory(src)

# Make the generated path header visible to every TU in the OBJECT
# library (and therefore to the static + shared downstream targets).
target_include_directories(ck_dsl_provider_impl
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
)

# Generate version.h on top of the plugin's OBJECT library so every
# translation unit sees CK_DSL_PROVIDER_VERSION_STRING.
ck_dsl_provider_generate_version_header(ck_dsl_provider_impl)

# Unit and integration tests for the provider. Guarded so packagers
# and the superbuild can opt out via -DCKDSLPROVIDER_SKIP_TESTS=ON.
# Both lanes share the GTest dependency fetched here.
#
# Test labels (see ../cmake/Tests.cmake):
# * tests/ uses add_unit_test_target -> label "unit_test"
# -> ninja ck-dsl-provider-unit-check
# * integration_tests/ uses add_integration_test_target
# -> label "integration_test"
# -> ninja ck-dsl-provider-integration-check
# finalize_test_targets wires the prefixed ctest targets that the M1
# capstone (I-11) advertises.
if(NOT CKDSLPROVIDER_SKIP_TESTS)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Dependencies.cmake)
fetch_gtest_dependency()
add_subdirectory(tests)
add_subdirectory(integration_tests)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/Tests.cmake)
finalize_test_targets("ck-dsl-provider")
endif()

if(NOT DEFINED HIPDNN_RELATIVE_INSTALL_PLUGIN_ENGINE_DIR)
message(FATAL_ERROR "HIPDNN_RELATIVE_INSTALL_PLUGIN_ENGINE_DIR was not set by hipdnn_data_sdk package import.")
endif()

install(TARGETS ck_dsl_provider_plugin EXPORT ck-dsl-provider-plugin
LIBRARY DESTINATION ${HIPDNN_RELATIVE_INSTALL_PLUGIN_ENGINE_DIR}
RUNTIME DESTINATION ${HIPDNN_RELATIVE_INSTALL_PLUGIN_ENGINE_DIR}
)
Loading
Loading