Skip to content

Commit

Permalink
Merge branch 'main' into port/onnxruntime
Browse files Browse the repository at this point in the history
  • Loading branch information
luncliff committed Feb 13, 2024
2 parents 1b7f188 + 62f3782 commit 5b14630
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 8 deletions.
15 changes: 9 additions & 6 deletions ports/directml/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(ENV{NUGET_PACKAGES} "${BUILDTREES_DIR}/nuget")

# see https://www.nuget.org/packages/Microsoft.AI.DirectML/
set(PACKAGE_NAME "Microsoft.AI.DirectML")
set(PACKAGE_VERSION "1.13.0")
set(PACKAGE_VERSION "1.13.1")

file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${PACKAGE_NAME}")
vcpkg_execute_required_process(
Expand All @@ -17,11 +17,16 @@ vcpkg_execute_required_process(

get_filename_component(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/${PACKAGE_NAME}.${PACKAGE_VERSION}" ABSOLUTE)
if(VCPKG_TARGET_IS_WINDOWS)
# todo: x64-xbox?
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(TRIPLE "x64-win")
# check community triplets...
if(DEFINED VCPKG_XBOX_CONSOLE_TARGET AND (VCPKG_XBOX_CONSOLE_TARGET MATCHES "scarlett"))
set(TRIPLE "x64-xbox-scarlett-231000")
endif()
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(TRIPLE "x86-win")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64ec")
set(TRIPLE "arm64ec-win")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(TRIPLE "arm64-win")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
Expand All @@ -45,20 +50,18 @@ if(VCPKG_TARGET_IS_WINDOWS)
file(INSTALL "${SOURCE_PATH}/bin/${TRIPLE}/DirectML.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(INSTALL "${SOURCE_PATH}/bin/${TRIPLE}/DirectML.Debug.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(INSTALL "${SOURCE_PATH}/bin/${TRIPLE}/DirectML.Debug.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
# debug/release will use same copy
file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(INSTALL "${CURRENT_PACKAGES_DIR}/lib/" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
elseif(VCPKG_TARGET_IS_LINUX)
file(INSTALL "${SOURCE_PATH}/bin/${TRIPLE}/libdirectml.so" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
else()
message(FATAL_ERROR "The target platform is not supported")
endif()

file(INSTALL "${SOURCE_PATH}/include/" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")

file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE-CODE.txt"
"${SOURCE_PATH}/README.md"
"${SOURCE_PATH}/ThirdPartyNotices.txt"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
2 changes: 1 addition & 1 deletion ports/directml/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "directml",
"version-semver": "1.13.0",
"version-semver": "1.13.1",
"description": [
"DirectML is a high-performance, hardware-accelerated DirectX 12 library for machine learning.",
"DirectML provides GPU acceleration for common machine learning tasks across a broad range of supported hardware and drivers, ",
Expand Down
50 changes: 50 additions & 0 deletions ports/nvidia-cutlass/fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 114d793..7a05453 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -668,7 +668,7 @@ include(CTest)
enable_testing()

if (CUTLASS_ENABLE_GTEST_UNIT_TESTS)
- include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/googletest.cmake)
+ find_package(GTest CONFIG REQUIRED) # GTest::gtest GTest::gmock
endif()

if (NOT TARGET test_all)
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 16252a0..800ffc6 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -42,7 +42,7 @@ target_link_libraries(
CUTLASS
cutlass_tools_util_includes
$<$<BOOL:${CUTLASS_ENABLE_CUBLAS}>:nvidia::cublas>
- gtest
+ GTest::gtest
cudart
cuda_driver
)
@@ -84,7 +84,7 @@ function(cutlass_test_unit_add_executable NAME)
target_link_libraries(
${NAME}
PUBLIC
- gtest
+ GTest::gtest
)
else()
target_link_libraries(
diff --git a/test/unit/core/CMakeLists.txt b/test/unit/core/CMakeLists.txt
index 965c050..a11c0e8 100644
--- a/test/unit/core/CMakeLists.txt
+++ b/test/unit/core/CMakeLists.txt
@@ -45,6 +45,10 @@ cutlass_test_unit_add_executable(
functional.cu
)

+target_include_directories(cutlass_test_unit_core PUBLIC
+ $<BUILD_INTERFACE:${CUTLASS_INCLUDE_DIR}>
+ $<BUILD_INTERFACE:${CUTLASS_TOOLS_UTIL_INCLUDE_DIR}>
+)
#
# CUTLASS 3x increases the host compiler requirements to C++17. However, there are
# certain existing integrations that will benefit from maintaining C++11 compatibility.
60 changes: 60 additions & 0 deletions ports/nvidia-cutlass/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO NVIDIA/cutlass
REF v3.4.0
SHA512 6debdfa0ffbb9c14293619a281e864ac16592f64856e4a54ae456a79cbce3ec2f5068031f4eae589e72fb10c3c61f1fa6d3fa14650754a27c4b12e14774e7f75
PATCHES
fix-cmake.patch
HEAD_REF main
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools CUTLASS_ENABLE_TOOLS
tools CUTLASS_ENABLE_PROFILER
test CUTLASS_ENABLE_TESTS
test CUTLASS_ENABLE_GTEST_UNIT_TESTS
test CUTLASS_INSTALL_TESTS
)

if("tools" IN_LIST FEATURES)
x_vcpkg_get_python_packages(
PYTHON_VERSION 3
PACKAGES numpy
OUT_PYTHON_VAR PYTHON3
)
get_filename_component(PYTHON_PATH "${PYTHON3}" PATH)
else()
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON_PATH "${PYTHON3}" PATH)
endif()
vcpkg_add_to_path(PREPEND "${PYTHON_PATH}")

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DCUTLASS_REVISION:STRING=v3.4.0
-DCUTLASS_ENABLE_HEADERS_ONLY=ON
-DCUTLASS_ENABLE_LIBRARY=ON
-DCUTLASS_ENABLE_EXAMPLES=OFF
-DCUTLASS_ENABLE_PERFORMANCE=OFF
-DCUTLASS_LIBRARY_OPERATIONS:STRING=all
-DCUTLASS_LIBRARY_KERNELS:STRING=all
-DPython3_EXECUTABLE:FILEPATH=${PYTHON3}
MAYBE_UNUSED_VARIABLES
CUTLASS_LIBRARY_OPERATIONS
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/NvidiaCutlass PACKAGE_NAME NvidiaCutlass)

file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug"
"${CURRENT_PACKAGES_DIR}/test"
"${CURRENT_PACKAGES_DIR}/lib"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
18 changes: 18 additions & 0 deletions ports/nvidia-cutlass/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "nvidia-cutlass",
"version-semver": "3.4.0",
"description": "CUDA Templates for Linear Algebra Subroutines",
"homepage": "https://github.com/NVIDIA/cutlass",
"license": "BSD-3-Clause",
"dependencies": [
"cuda",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
1 change: 1 addition & 0 deletions test/azure-port-arm64-windows.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
libdispatch
tensorflow-lite
onnxruntime[directml]
1 change: 1 addition & 0 deletions test/self-hosted-cuda.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"platform": "x64 & windows"
},
"nvidia-cnmem",
"nvidia-cutlass",
"nvidia-tools-extension-sdk",
"nvidia-triton-common",
"nvidia-triton-core",
Expand Down
6 changes: 5 additions & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"port-version": 0
},
"directml": {
"baseline": "1.13.0",
"baseline": "1.13.1",
"port-version": 0
},
"dlpack": {
Expand Down Expand Up @@ -92,6 +92,10 @@
"baseline": "2018-11-28",
"port-version": 0
},
"nvidia-cutlass": {
"baseline": "3.4.0",
"port-version": 0
},
"nvidia-tools-extension-sdk": {
"baseline": "3.1.0",
"port-version": 0
Expand Down
5 changes: 5 additions & 0 deletions versions/d-/directml.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "aa4bc85c9d05b6aecb312b23f26f9d3c5014f5c8",
"version-semver": "1.13.1",
"port-version": 0
},
{
"git-tree": "b8621fdac36cd2db3cea051d27b8b2e8eb8dfb33",
"version-semver": "1.13.0",
Expand Down
9 changes: 9 additions & 0 deletions versions/n-/nvidia-cutlass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "75c26a2bd20f4cbd49b9ed5189b9eb2a21e30007",
"version-semver": "3.4.0",
"port-version": 0
}
]
}

0 comments on commit 5b14630

Please sign in to comment.