This commit is contained in:
Changming Sun 2025-02-05 13:16:34 -08:00
parent 40ede3d3fc
commit ed91a32698
6 changed files with 11 additions and 15 deletions

View file

@ -600,6 +600,7 @@ endif()
if(onnxruntime_ENABLE_DLPACK)
message(STATUS "dlpack is enabled.")
onnxruntime_fetchcontent_declare(
dlpack
URL ${DEP_URL_dlpack}
@ -607,9 +608,8 @@ if(onnxruntime_ENABLE_DLPACK)
EXCLUDE_FROM_ALL
FIND_PACKAGE_ARGS NAMES dlpack
)
# We can't use onnxruntime_fetchcontent_makeavailable since some part of the the dlpack code is Linux only.
# For example, dlpackcpp.h uses posix_memalign.
FetchContent_Populate(dlpack)
onnxruntime_fetchcontent_makeavailable(dlpack)
endif()
endif()
if(onnxruntime_ENABLE_TRAINING OR (onnxruntime_ENABLE_TRAINING_APIS AND onnxruntime_BUILD_UNIT_TESTS))

View file

@ -77,8 +77,7 @@ endif()
if (onnxruntime_ENABLE_TRAINING_OPS)
target_include_directories(onnxruntime_framework PRIVATE ${ORTTRAINING_ROOT})
if (onnxruntime_ENABLE_TRAINING_TORCH_INTEROP OR onnxruntime_ENABLE_TRITON)
onnxruntime_add_include_to_target(onnxruntime_framework Python::Module)
target_include_directories(onnxruntime_framework PRIVATE ${dlpack_SOURCE_DIR}/include)
onnxruntime_add_include_to_target(onnxruntime_framework Python::Module dlpack::dlpack)
endif()
endif()
if (onnxruntime_USE_MPI)
@ -86,9 +85,7 @@ if (onnxruntime_USE_MPI)
endif()
if (onnxruntime_ENABLE_ATEN)
# DLPack is a header-only dependency
set(DLPACK_INCLUDE_DIR ${dlpack_SOURCE_DIR}/include)
target_include_directories(onnxruntime_framework PRIVATE ${DLPACK_INCLUDE_DIR})
onnxruntime_add_include_to_target(onnxruntime_framework dlpack::dlpack)
endif()
onnxruntime_add_include_to_target(onnxruntime_framework onnxruntime_common onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers safeint_interface Boost::mp11 nlohmann_json::nlohmann_json)

View file

@ -196,8 +196,7 @@ endif()
if (onnxruntime_ENABLE_DLPACK)
target_compile_definitions(onnxruntime_providers PRIVATE ENABLE_DLPACK)
# DLPack is a header-only dependency
set(DLPACK_INCLUDE_DIR ${dlpack_SOURCE_DIR}/include)
target_include_directories(onnxruntime_providers PRIVATE ${DLPACK_INCLUDE_DIR})
onnxruntime_add_include_to_target(onnxruntime_providers dlpack::dlpack)
endif()
if (onnxruntime_ENABLE_TRAINING)

View file

@ -131,7 +131,7 @@ if (onnxruntime_ENABLE_ATEN)
endif()
if (onnxruntime_ENABLE_DLPACK)
target_include_directories(onnxruntime_pybind11_state PRIVATE ${dlpack_SOURCE_DIR}/include)
onnxruntime_add_include_to_target(onnxruntime_providers dlpack::dlpack)
endif()
if (onnxruntime_ENABLE_TRAINING)

View file

@ -106,7 +106,7 @@ stages:
parameters:
BuildConfig: 'RelWithDebInfo'
buildArch: x64
additionalBuildFlags: --build_wheel --use_dnnl
additionalBuildFlags: --build_wheel --use_dnnl --use_vcpkg
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_release

View file

@ -12,7 +12,7 @@ RUN echo "$APT_PREF" > /etc/apt/preferences.d/rocm-pin-600
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl libnuma-dev gnupg && \
apt-get install -y --no-install-recommends ca-certificates ninja-build git zip curl libnuma-dev gnupg && \
curl -sL https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - &&\
printf "deb [arch=amd64] https://repo.radeon.com/rocm/apt/$ROCM_VERSION/ jammy main" | tee /etc/apt/sources.list.d/rocm.list && \
printf "deb [arch=amd64] https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/ubuntu jammy main" | tee /etc/apt/sources.list.d/amdgpu.list && \
@ -45,10 +45,10 @@ ENV LANG C.UTF-8
WORKDIR /stage
# Cmake
ENV CMAKE_VERSION=3.30.1
ENV CMAKE_VERSION=3.31.5
RUN cd /usr/local && \
wget -q https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz && \
tar -zxf /usr/local/cmake-3.30.1-Linux-x86_64.tar.gz --strip=1 -C /usr
tar -zxf /usr/local/cmake-3.31.5-Linux-x86_64.tar.gz --strip=1 -C /usr
# ccache
RUN mkdir -p /tmp/ccache && \