Skip to content

Convert OpenMP parallelization to OneAPI::TBB #3514

Convert OpenMP parallelization to OneAPI::TBB

Convert OpenMP parallelization to OneAPI::TBB #3514

Workflow file for this run

name: Ubuntu SYCL
permissions: {}
on:
workflow_dispatch:
inputs:
developer_build:
description: 'Set to OFF for Release wheels'
required: false
default: 'ON'
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GCE_CLI_GHA_VERSION: "416.0.0"
DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }}
jobs:
build-lib:
name: Build Lib
permissions:
contents: write # Release upload
id-token: write
attestations: write
artifact-metadata: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
BUILD_SHARED_LIBS: [ON, OFF]
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Maximize build space
run: |
source util/ci_utils.sh
maximize_ubuntu_github_actions_build_space
- name: Docker build lib
run: |
# Use py310 as dummy
if [ "${{ matrix.BUILD_SHARED_LIBS }}" = "ON" ]; then
docker/docker_build.sh sycl-shared build-lib
docker tag open3d-ci:sycl-shared open3d-lib-sycl-shared:latest
docker save open3d-lib-sycl-shared:latest | zstd -T0 --fast=1 \
-o open3d-lib-sycl-shared.tar.zst
ls -lhs open3d-lib-sycl-shared.tar.zst
else
docker/docker_build.sh sycl-static build-lib
# Static build usually doesn't produce wheels or shared libs for python
# But we might need artifacts. For now keep simple.
fi
- name: Upload Lib Image
if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' }}
uses: actions/upload-artifact@v4
with:
name: open3d-lib-sycl-shared
path: open3d-lib-sycl-shared.tar.zst
retention-days: 1
compression-level: 0
- name: Upload C++ binary package to GitHub artifacts
if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' }}
uses: actions/upload-artifact@v4
with:
name: open3d-devel-sycl
path: open3d-devel-*.tar.xz
if-no-files-found: error
- name: Docker test (C++)
# Only the C++ phase runs here; Python tests run later in the
# build-wheel job against the actual per-Python-version wheel
# (see docker/docker_test.sh's cpp_test()/python_test() split),
# so we avoid testing Python twice.
run: |
if [ "${{ matrix.BUILD_SHARED_LIBS }}" = "ON" ]; then
docker/docker_test.sh sycl-shared cpp
else
docker/docker_test.sh sycl-static cpp
fi
- name: Update devel release
if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'ON' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
.github/workflows/update_release.sh open3d*.whl open3d-devel-*.tar.xz
- name: GCloud CLI auth
if: ${{ github.ref == 'refs/heads/main' }}
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ secrets.GCE_PROJECT }}
credentials_json: '${{ secrets.GCE_SA_KEY_GPU_CI }}'
- name: GCloud CLI setup
if: ${{ github.ref == 'refs/heads/main' }}
uses: google-github-actions/setup-gcloud@v2
with:
version: ${{ env.GCE_CLI_GHA_VERSION }}
project_id: ${{ secrets.GCE_PROJECT }}
- name: Upload ccache to GCS
if: ${{ github.ref == 'refs/heads/main' }}
run: |
gsutil cp ${GITHUB_WORKSPACE}/open3d-ci-sycl.tar.xz gs://open3d-ci-cache/ || true
build-wheel:
name: Build Wheel
permissions:
contents: write # Release upload
id-token: write
attestations: write
artifact-metadata: write
runs-on: ubuntu-latest
needs: build-lib
strategy:
fail-fast: false
matrix:
python_version: ['3.10', '3.11', '3.12', '3.13', '3.14']
is_main:
- ${{ github.ref == 'refs/heads/main' }}
exclude:
- is_main: false
python_version: '3.10'
- is_main: false
python_version: '3.11'
- is_main: false
python_version: '3.12'
- is_main: false
python_version: '3.13'
env:
PYTHON_VERSION: ${{ matrix.python_version }}
OPEN3D_ML_ROOT: ${{ github.workspace }}/open3d_ml
# TensorFlow v2.20 only supports python 3.9-3.13
BUILD_TENSORFLOW_OPS: ${{ matrix.python_version >= '3.14' && 'OFF' || 'ON' }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Maximize build space
run: |
source util/ci_utils.sh
maximize_ubuntu_github_actions_build_space
- name: Download Lib Image
uses: actions/download-artifact@v4
with:
name: open3d-lib-sycl-shared
path: .
- name: Load Lib Image
run: zstd -d --stdout open3d-lib-sycl-shared.tar.zst | docker load
- name: Docker build
run: |
export BASE_IMAGE=open3d-lib-sycl-shared:latest
# We execute docker buildscript with python version argument.
docker/docker_build.sh sycl-shared py${{ matrix.python_version }}
# The loaded build-lib image contains its Python 3.12 wheel. Keep
# only the wheel produced for this matrix entry before later steps
# expand open3d*.whl.
PYTHON_ABI="cp${PYTHON_VERSION/./}"
find . -maxdepth 1 -name 'open3d*.whl' \
! -name "*${PYTHON_ABI}-${PYTHON_ABI}-*.whl" -delete
- name: Generate artifact attestation
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/attest@v4
with:
subject-path: |
${{ github.workspace }}/open3d*.whl
- name: Upload wheel to GitHub artifacts
uses: actions/upload-artifact@v4
with:
name: open3d-sycl-wheel-py${{ matrix.python_version }}
path: open3d*.whl
if-no-files-found: error
- name: Checkout Open3D-ML source code
uses: actions/checkout@v4
with:
repository: isl-org/Open3D-ML
ref: main
path: ${{ env.OPEN3D_ML_ROOT }}
- name: Install runtime dependencies
# Open3D links against EGL for GPU-accelerated offscreen rendering
# (see cpp/open3d/visualization/visualizer/EGLOffscreenContext.*).
# This bare runner (unlike the docker_build.sh image) does not have
# it installed by default.
run: sudo apt-get update && sudo apt-get install --yes libegl1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Test Python package
run: |
python -V
source util/ci_utils.sh
test_wheel open3d*.whl
- name: Run Python unit tests
run: |
source util/ci_utils.sh
echo "Running Open3D python tests..."
run_python_tests
- name: Update devel release
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
.github/workflows/update_release.sh open3d*.whl