Skip to content

Commit

Permalink
Build and upload SYCL wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheorey committed Dec 30, 2024
1 parent 8db6e35 commit da95b80
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 10 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ubuntu-sycl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ jobs:
docker/docker_test.sh sycl-static
fi
- name: Upload wheel to GitHub artifacts
if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' }}
uses: actions/upload-artifact@v4
with:
name: open3d-sycl-linux-python-wheel
path: open3d-*.whl
if-no-files-found: error
- name: Update devel release
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ ${{ matrix.BUILD_SHARED_LIBS }} == 'ON' ] ; then
gh release upload main-devel open3d-*.whl --clobber
fi
gh release view main-devel
- name: GCloud CLI auth
if: ${{ github.ref == 'refs/heads/main' }}
uses: 'google-github-actions/auth@v2'
Expand Down
7 changes: 5 additions & 2 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1538,8 +1538,11 @@ if(BUILD_SYCL_MODULE)
target_link_libraries(3rdparty_sycl INTERFACE
$<$<AND:$<CXX_COMPILER_ID:IntelLLVM>,$<NOT:$<LINK_LANGUAGE:ISPC>>>:sycl>)
target_link_options(3rdparty_sycl INTERFACE
$<$<AND:$<CXX_COMPILER_ID:IntelLLVM>,$<NOT:$<LINK_LANGUAGE:ISPC>>>:-fsycl -fsycl-targets=intel_gpu_acm_g10>)
# $<$<AND:$<CXX_COMPILER_ID:IntelLLVM>,$<NOT:$<LINK_LANGUAGE:ISPC>>>:-fsycl -fsycl-targets=spir64,spir64_gen>)
$<$<AND:$<CXX_COMPILER_ID:IntelLLVM>,$<NOT:$<LINK_LANGUAGE:ISPC>>>:-fsycl -fsycl-targets=${OPEN3D_SYCL_TARGETS}>)
if (OPEN3D_SYCL_TARGET_BACKEND_OPTIONS)
target_link_options(3rdparty_sycl INTERFACE
$<$<AND:$<CXX_COMPILER_ID:IntelLLVM>,$<NOT:$<LINK_LANGUAGE:ISPC>>>:-Xs ${OPEN3D_SYCL_TARGET_BACKEND_OPTIONS}>)
endif()
if(NOT BUILD_SHARED_LIBS OR arg_PUBLIC)
install(TARGETS 3rdparty_sycl EXPORT Open3DTargets)
endif()
Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ else()
option(STATIC_WINDOWS_RUNTIME "Use static (MT/MTd) Windows runtime" ON )
endif()
option(BUILD_SYCL_MODULE "Build SYCL module with Intel oneAPI" OFF)
if(BUILD_SYCL_MODULE)
set(OPEN3D_SYCL_TARGETS "spir64" CACHE STRING
"SYCL targets: spir64 for JIT, or another for AOT compilation. See https://github.com/intel/llvm/blob/sycl/sycl/doc/UsersManual.md."
)
set(OPEN3D_SYCL_TARGET_BACKEND_OPTIONS "" CACHE STRING
"SYCL target backend options, e.g. to compile for a specific device. See https://github.com/intel/llvm/blob/sycl/sycl/doc/UsersManual.md."
)
set(BUILD_ISPC_MODULE OFF CACHE BOOL "Build the ISPC module" FORCE)
set(BUILD_CUDA_MODULE OFF CACHE BOOL "Build the CUDA module" FORCE)
endif()
option(GLIBCXX_USE_CXX11_ABI "Set -D_GLIBCXX_USE_CXX11_ABI=1" ON )
option(ENABLE_SYCL_UNIFIED_SHARED_MEMORY "Enable SYCL unified shared memory" OFF)
if(BUILD_GUI AND (WIN32 OR UNIX AND NOT LINUX_AARCH64 AND NOT APPLE_AARCH64))
Expand Down
3 changes: 1 addition & 2 deletions cmake/Open3DSYCLTargetSources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ function(open3d_sycl_target_sources target)
if(BUILD_SYCL_MODULE)
foreach(sycl_file IN LISTS arg_UNPARSED_ARGUMENTS)
set_source_files_properties(${sycl_file} PROPERTIES
COMPILE_OPTIONS "-fsycl;-fsycl-targets=intel_gpu_acm_g10")
#COMPILE_OPTIONS "-fsycl;-fsycl-targets=spir64,spir64_gen")
COMPILE_OPTIONS "-fsycl;-fsycl-targets=${OPEN3D_SYCL_TARGETS}")
if(arg_VERBOSE)
message(STATUS "open3d_sycl_target_sources(${target}): marked ${sycl_file} as SYCL code")
endif()
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ RUN ccache -s \
&& tar -caf /${CCACHE_TAR_NAME}.tar.xz ${CCACHE_DIR_NAME} \
&& if [ "${PACKAGE}" = "ON" ]; then mv /root/Open3D/build/package/open3d-devel*.tar.xz /; fi \
&& if [ "${PACKAGE}" = "VIEWER" ]; then mv /root/Open3D/build/package-Open3DViewer-deb/open3d-viewer-*-Linux.deb /; fi \
&& if [ "${BUILD_SYCL_MODULE}" = "ON" && "${BUILD_SHARED_LIBS}" = "ON"]; then mv /root/Open3D/build/lib/python_package/pip_package/open3d-*.whl /; fi \
&& ls -alh /

RUN echo "Docker build done."
16 changes: 12 additions & 4 deletions docker/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -451,13 +451,17 @@ sycl-shared_export_env() {
export BASE_IMAGE=intel/oneapi-basekit:2024.1.0-devel-ubuntu20.04
export DEVELOPER_BUILD=ON
export CCACHE_TAR_NAME=open3d-ci-sycl
export PYTHON_VERSION=3.8
export PYTHON_VERSION=3.10
export BUILD_SHARED_LIBS=ON
export BUILD_CUDA_MODULE=OFF
export BUILD_TENSORFLOW_OPS=OFF
export BUILD_PYTORCH_OPS=OFF
export BUILD_TENSORFLOW_OPS=ON
export BUILD_PYTORCH_OPS=ON
export PACKAGE=OFF
export BUILD_SYCL_MODULE=ON

export IGC_EnableDPEmulation=1 # Enable float64 emulation during compilation
export SYCL_CACHE_PERSISTENT=1 # Cache SYCL kernel binaries.
export OverrideDefaultFP64Settings=1 # Enable double precision emulation at runtime.
}

sycl-static_export_env() {
Expand All @@ -468,13 +472,17 @@ sycl-static_export_env() {
export BASE_IMAGE=intel/oneapi-basekit:2024.1.0-devel-ubuntu20.04
export DEVELOPER_BUILD=ON
export CCACHE_TAR_NAME=open3d-ci-sycl
export PYTHON_VERSION=3.8
export PYTHON_VERSION=3.10
export BUILD_SHARED_LIBS=OFF
export BUILD_CUDA_MODULE=OFF
export BUILD_TENSORFLOW_OPS=OFF
export BUILD_PYTORCH_OPS=OFF
export PACKAGE=OFF
export BUILD_SYCL_MODULE=ON

export IGC_EnableDPEmulation=1 # Enable float64 emulation during compilation
export SYCL_CACHE_PERSISTENT=1 # Cache SYCL kernel binaries.
export OverrideDefaultFP64Settings=1 # Enable double precision emulation at runtime.
}

function main() {
Expand Down
8 changes: 6 additions & 2 deletions util/ci_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ fi
BUILD_TENSORFLOW_OPS=${BUILD_TENSORFLOW_OPS:-ON}
BUILD_PYTORCH_OPS=${BUILD_PYTORCH_OPS:-ON}
LOW_MEM_USAGE=${LOW_MEM_USAGE:-OFF}
BUILD_SYCL_MODULE=${BUILD_SYCL_MODULE:-OFF}

# Dependency versions:
# CUDA: see docker/docker_build.sh
# ML
TENSORFLOW_VER="2.16.2"
TORCH_VER="2.2.2"
TORCH_REPO_URL="https://download.pytorch.org/whl/torch/"
TORCH_CXX11_URL="https://download.pytorch.org/whl/"
# Python
PIP_VER="23.2.1"
WHEEL_VER="0.38.4"
Expand Down Expand Up @@ -77,9 +79,11 @@ install_python_dependencies() {
python -m pip install -U "$TF_ARCH_NAME"=="$TENSORFLOW_VER" # ML/requirements-tensorflow.txt
fi
if [ "$BUILD_PYTORCH_OPS" == "ON" ]; then # ML/requirements-torch.txt
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [[ "$OSTYPE" == "linux-gnu"* && "$BUILD_SYCL_MODULE" == "OFF" ]]; then
python -m pip install -U "${TORCH_GLNX}" -f "$TORCH_REPO_URL" tensorboard

elif [[ "$OSTYPE" == "linux-gnu"* && "$BUILD_SYCL_MODULE" == "ON" ]]; then
python -m pip install -U "${TORCH_GLNX}+cpu.cxx11.abi" -i "$TORCH_CXX11_URL"
python -m pip install -U tensorboard
elif [[ "$OSTYPE" == "darwin"* ]]; then
python -m pip install -U torch=="$TORCH_VER" -f "$TORCH_REPO_URL" tensorboard
else
Expand Down

0 comments on commit da95b80

Please sign in to comment.