-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#22557) onnxruntime: add with_cuda option
* Add with_cuda option * Require static registration from onnx disabled * Add some transitive headers * Test CUDA in the test_package * Add 1.15.1 patch * wip * add comment * wip * wip * wip * remove unused patch * better patching * remove unused patch * fix * copy dlls via cmake in v1 * check if win --------- Co-authored-by: czoido <mrgalleta@gmail.com>
- Loading branch information
Showing
9 changed files
with
120 additions
and
7 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
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
11 changes: 11 additions & 0 deletions
11
recipes/onnxruntime/all/patches/1.15.1-0002-fix-attention-15983.patch
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,11 @@ | ||
--- a/onnxruntime/contrib_ops/cuda/bert/attention.cc | ||
+++ b/onnxruntime/contrib_ops/cuda/bert/attention.cc | ||
@@ -164,7 +164,7 @@ | ||
has_memory_efficient_attention(sm, sizeof(T) == 2); | ||
#else | ||
constexpr bool use_memory_efficient_attention = false; | ||
- ORT_UNUSED_VARIABLE(is_mask_1d_key_seq_len_start); | ||
+ ORT_UNUSED_PARAMETER(is_mask_1d_key_seq_len_start); | ||
#endif | ||
|
||
cublasHandle_t cublas = GetCublasHandle(context); |
15 changes: 15 additions & 0 deletions
15
recipes/onnxruntime/all/patches/1.17.3-0003-fix-cutlass-cuda-provider.patch
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,15 @@ | ||
diff --git a/cmake/onnxruntime_providers_cuda.cmake b/cmake/onnxruntime_providers_cuda.cmake | ||
index b5c3100865..129c4f19f6 100644 | ||
--- a/cmake/onnxruntime_providers_cuda.cmake | ||
+++ b/cmake/onnxruntime_providers_cuda.cmake | ||
@@ -180,8 +180,8 @@ | ||
target_link_libraries(${target} PRIVATE CUDA::cuda_driver) | ||
endif() | ||
|
||
- include(cutlass) | ||
- target_include_directories(${target} PRIVATE ${cutlass_SOURCE_DIR}/include ${cutlass_SOURCE_DIR}/examples) | ||
+ find_package(NvidiaCutlass) | ||
+ target_link_libraries(${target} PRIVATE nvidia::cutlass::cutlass) | ||
|
||
target_include_directories(${target} PRIVATE ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR} ${eigen_INCLUDE_DIRS} ${TVM_INCLUDES} | ||
PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) |
15 changes: 15 additions & 0 deletions
15
recipes/onnxruntime/all/patches/1.18.1-0005-fix-cutlass-cuda-provider.patch
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,15 @@ | ||
diff --git a/cmake/onnxruntime_providers_cuda.cmake b/cmake/onnxruntime_providers_cuda.cmake | ||
index 1346a9ce96..f40661d4bd 100644 | ||
--- a/cmake/onnxruntime_providers_cuda.cmake | ||
+++ b/cmake/onnxruntime_providers_cuda.cmake | ||
@@ -211,8 +211,8 @@ | ||
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) | ||
+ target_link_libraries(${target} PRIVATE nvidia::cutlass::cutlass) | ||
|
||
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
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
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