Skip to content

Commit

Permalink
[libkineto] remove CUDA dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
luncliff committed Oct 25, 2024
1 parent e70155a commit 6e73401
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
18 changes: 4 additions & 14 deletions ports/libkineto/fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/libkineto/CMakeLists.txt b/libkineto/CMakeLists.txt
index 140ee68..507e961 100644
index 140ee68..bc4d540 100644
--- a/libkineto/CMakeLists.txt
+++ b/libkineto/CMakeLists.txt
@@ -52,6 +52,14 @@ if (NOT ROCM_SOURCE_DIR)
@@ -52,6 +52,13 @@ if (NOT ROCM_SOURCE_DIR)
message(INFO " ROCM_SOURCE_DIR = ${ROCM_SOURCE_DIR}")
endif()

Expand All @@ -12,12 +12,11 @@ index 140ee68..507e961 100644
+ add_compile_definitions(CUDA_VERSION=${CUDA_VERSION})
+ get_target_property(CUPTI_INCLUDE_DIR CUDA::cupti INTERFACE_INCLUDE_DIRECTORIES)
+ get_target_property(CUDA_cupti_LIBRARY CUDA::cupti IMPORTED_LOCATION)
+ link_libraries(CUDA::cudart CUDA::cupti)
+endif()
if (KINETO_BUILD_TESTS)
enable_testing()
if (NOT CUDA_SOURCE_DIR)
@@ -193,7 +201,8 @@ endif()
@@ -193,7 +200,8 @@ endif()
target_compile_options(kineto_base PRIVATE "${KINETO_COMPILE_OPTIONS}")
target_compile_options(kineto_api PRIVATE "${KINETO_COMPILE_OPTIONS}")

Expand All @@ -27,7 +26,7 @@ index 140ee68..507e961 100644
if(NOT FMT_SOURCE_DIR)
set(FMT_SOURCE_DIR "${LIBKINETO_THIRDPARTY_DIR}/fmt"
CACHE STRING "fmt source directory from submodules")
@@ -211,7 +220,7 @@ if(NOT TARGET fmt)
@@ -211,7 +219,7 @@ if(NOT TARGET fmt)
set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
endif()

Expand All @@ -36,12 +35,3 @@ index 140ee68..507e961 100644
message(STATUS "Kineto: FMT_SOURCE_DIR = ${FMT_SOURCE_DIR}")
message(STATUS "Kineto: FMT_INCLUDE_DIR = ${FMT_INCLUDE_DIR}")
if (NOT CUPTI_INCLUDE_DIR)
@@ -308,7 +317,7 @@ install(FILES ${LIBKINETO_PUBLIC_HEADERS}
install(EXPORT kinetoLibraryConfig DESTINATION share/cmake/kineto
FILE kinetoLibraryConfig.cmake)

-if(KINETO_BUILD_TESTS)
+if(FALSE)
add_subdirectory(test)
add_subdirectory("${LIBKINETO_THIRDPARTY_DIR}/googletest")
endif()
8 changes: 5 additions & 3 deletions ports/libkineto/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pytorch/kineto
REF 7a2a167b7233e3a0294c2ebb94c458cccfed7f42
SHA512 297b19d518ae6eaaf4d2a869e47ed912fd8e0fac024fdde166d6e1b7b75728d8f3573faab6144252bb0a21de238b73b9119735ba26dc7d87c5b8adb9f2bc0e71
REF 660b5838acdf9d26c4259621b69fa2920903dfdc
SHA512 652bf0380613e836da68f6edc8df361de68f04b0c80c1a6eed0403e55dafa55d458d10d288f98a87357eda39e293760a2d22a10a5c79c2bd53c47f42d0fb08f6
HEAD_REF main
PATCHES
fix-cmake.patch
Expand All @@ -29,7 +29,9 @@ vcpkg_cmake_configure(
OPTIONS
-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON3}
-DKINETO_BUILD_TESTS=OFF
-DLIBKINETO_NOCUPTI=OFF # use CUDA::cupti
-DLIBKINETO_NOCUPTI=ON # todo: support CUDA feature
-DLIBKINETO_NOROCTRACER=ON
-DLIBKINETO_NOXPUPTI=ON
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME kinetoLibrary CONFIG_PATH "share/cmake/kineto")
Expand Down
3 changes: 1 addition & 2 deletions ports/libkineto/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "libkineto",
"version-date": "2024-10-16",
"version-date": "2024-10-24",
"description": "A CPU+GPU Profiling library that provides access to timeline traces and hardware performance counters",
"homepage": "https://github.com/pytorch/kineto",
"license": "BSD-3-Clause",
"dependencies": [
"cuda",
{
"name": "dynolog",
"platform": "linux"
Expand Down

0 comments on commit 6e73401

Please sign in to comment.