-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[onnxruntime] Update to v1.18.1, redesign portfile (#227)
* [onnxruntime] update to v1.18.1 * [onnxruntime] replace vcpkg_deps.cmake to external_deps.cmake * [onnxruntime] resurrect training feature * ci: test onnxruntime[training] in azure, circleci
- Loading branch information
Showing
17 changed files
with
831 additions
and
2,572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ grpc[codegen] | |
flatbuffers | ||
abseil | ||
liblzma | ||
onnxruntime | ||
onnx[disable-static-registration] | ||
onnxruntime[training] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt | ||
index f829cea..bda2d4c 100644 | ||
--- a/cmake/CMakeLists.txt | ||
+++ b/cmake/CMakeLists.txt | ||
@@ -715,6 +715,13 @@ if (onnxruntime_USE_CUDA) | ||
if (onnxruntime_USE_CUDA_NHWC_OPS) | ||
add_compile_definitions(ENABLE_CUDA_NHWC_OPS) | ||
endif() | ||
+ # Give more hints for the generator, with FindCUDAToolkit.cmake | ||
+ find_package(CUDAToolkit REQUIRED) | ||
+ if(CMAKE_GENERATOR MATCHES "Visual Studio") | ||
+ set(CMAKE_VS_PLATFORM_TOOLSET_CUDA "${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}") | ||
+ set(CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR "${CUDAToolkit_TARGET_DIR}/") | ||
+ endif() | ||
+ get_filename_component(CMAKE_CUDA_COMPILER "${CUDAToolkit_NVCC_EXECUTABLE}" ABSOLUTE) | ||
enable_language(CUDA) | ||
message( STATUS "CMAKE_CUDA_COMPILER_VERSION: ${CMAKE_CUDA_COMPILER_VERSION}") | ||
|
||
diff --git a/cmake/onnxruntime_providers_cuda.cmake b/cmake/onnxruntime_providers_cuda.cmake | ||
index 1346a9c..fd60dd8 100644 | ||
--- a/cmake/onnxruntime_providers_cuda.cmake | ||
+++ b/cmake/onnxruntime_providers_cuda.cmake | ||
@@ -211,8 +211,12 @@ | ||
target_link_libraries(${target} PRIVATE CUDA::cuda_driver) | ||
endif() | ||
|
||
- include(cutlass) | ||
- target_include_directories(${target} PRIVATE ${cutlass_SOURCE_DIR}/include ${cutlass_SOURCE_DIR}/examples ${cutlass_SOURCE_DIR}/tools/util/include) | ||
+ find_package(NvidiaCutlass REQUIRED) | ||
+ target_link_libraries(${target} PRIVATE nvidia::cutlass::cutlass) | ||
+ if(MSVC) | ||
+ # CUTLASS_CONSTEXPR_IF_CXX17 must be constexpr. Correct the __cplusplus value with MSVC | ||
+ target_compile_options(${target} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler /Zc:__cplusplus>) | ||
+ endif() | ||
|
||
target_include_directories(${target} PRIVATE ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR} ${eigen_INCLUDE_DIRS} ${TVM_INCLUDES} | ||
PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
diff --git a/cmake/tensorboard/compat/proto/CMakeLists.txt b/cmake/tensorboard/compat/proto/CMakeLists.txt | ||
index ad31e40..3e80a6e 100644 | ||
--- a/cmake/tensorboard/compat/proto/CMakeLists.txt | ||
+++ b/cmake/tensorboard/compat/proto/CMakeLists.txt | ||
@@ -1,14 +1,21 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
-FetchContent_Declare( | ||
- tensorboard | ||
- URL ${DEP_URL_tensorboard} | ||
- URL_HASH SHA1=${DEP_SHA1_tensorboard} | ||
-) | ||
-FetchContent_MakeAvailable(tensorboard) | ||
- | ||
-set(TENSORBOARD_ROOT ${tensorboard_SOURCE_DIR}) | ||
+if(onnxruntime_USE_VCPKG) | ||
+ if(NOT DEFINED TENSORBOARD_ROOT) | ||
+ message(FATAL_ERROR "TENSORBOARD_ROOT not defined") | ||
+ endif() | ||
+ find_path(PROTOBUF_IMPORT_DIR NAMES "google/protobuf/api.proto" REQUIRED) | ||
+else() | ||
+ FetchContent_Declare( | ||
+ tensorboard | ||
+ URL ${DEP_URL_tensorboard} | ||
+ URL_HASH SHA1=${DEP_SHA1_tensorboard} | ||
+ ) | ||
+ FetchContent_MakeAvailable(tensorboard) | ||
+ set(TENSORBOARD_ROOT ${tensorboard_SOURCE_DIR}) | ||
+ set(PROTOBUF_IMPORT_DIR ${protobuf_SOURCE_DIR}/src) | ||
+endif() | ||
|
||
# tensorboard protos | ||
file(GLOB_RECURSE tensorboard_proto_srcs CONFIGURE_DEPENDS | ||
@@ -16,7 +23,7 @@ file(GLOB_RECURSE tensorboard_proto_srcs CONFIGURE_DEPENDS | ||
) | ||
|
||
add_library(tensorboard STATIC ${tensorboard_proto_srcs}) | ||
-onnxruntime_protobuf_generate(APPEND_PATH IMPORT_DIRS ${tensorboard_SOURCE_DIR} ${protobuf_SOURCE_DIR}/src TARGET tensorboard) | ||
+onnxruntime_protobuf_generate(APPEND_PATH IMPORT_DIRS ${TENSORBOARD_ROOT} ${PROTOBUF_IMPORT_DIR} TARGET tensorboard) | ||
onnxruntime_add_include_to_target(tensorboard ${PROTOBUF_LIB}) | ||
target_include_directories(tensorboard PRIVATE ${PROJECT_BINARY_DIR}) | ||
add_dependencies(tensorboard ${onnxruntime_EXTERNAL_DEPENDENCIES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.