Skip to content

Intel GPU support (xpu) - #697

Merged
ssheorey merged 14 commits into
mainfrom
ss/xpu
Aug 21, 2026
Merged

Intel GPU support (xpu)#697
ssheorey merged 14 commits into
mainfrom
ss/xpu

Conversation

@ssheorey

Copy link
Copy Markdown
Member
  • Include parity tests between CPU and GPU (CUDA or XPU) backends.
  • Download and use the latest main-devel Open3D wheel instead of building from source.
  • pointtransformer fully supports all 3 backends (cpu, cuda, xpu)

ssheorey and others added 11 commits July 23, 2026 06:52
update CI to use prebuilt wheel
cpu parity tests (simplified)
Use accelerator-aware device defaults and .to() paths, configurable
run_ci.sh (cpu/cuda/xpu), and GitHub Actions on cpu-only without parity tests.
Document torch model test coverage and CPU/CUDA/XPU parity in howtos and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ssheorey
ssheorey requested a lite review from Copilot August 20, 2026 21:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Intel GPU (XPU/SYCL) support across the Open3D-ML PyTorch stack and introduces CPU↔accelerator parity tests to validate correctness across CPU, CUDA, and XPU backends. It also updates CI to test against prebuilt Open3D “main-devel” wheels instead of building Open3D from source.

Changes:

  • Adds PyTorch CPU vs CUDA/XPU parity test helpers and a dedicated parity-focused torch model test suite.
  • Extends device selection and custom-op gating to support xpu/sycl across pipelines, models, and utilities.
  • Updates CI and dependency requirements to use prebuilt Open3D wheels and backend-specific PyTorch installs (CPU/CUDA/XPU).

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/torch_backend_parity.py Adds shared CPU↔CUDA/XPU parity assertions for outputs and gradients.
tests/test_models_torch.py New parity + smoke tests for registered PyTorch models across CPU/CUDA/XPU.
tests/test_models_tf.py Removes legacy torch tests from TF test module; improves repo-root path handling.
tests/run_tests.sh Runs each pytest test case in a separate process to avoid XPU/SYCL state issues.
scripts/run_pipeline.py Expands device help/handling and adjusts distributed worker device string formatting.
requirements-torch.txt Bumps CPU PyTorch/torchvision requirements.
requirements-torch-xpu.txt Adds XPU-specific PyTorch/torchvision requirements.
requirements-torch-cuda.txt Bumps CUDA PyTorch/torchvision requirements.
README.md Documents installing XPU PyTorch requirements and links parity testing docs.
ml3d/utils/tensorboard_o3d.py Adds helper to conditionally register Open3D TensorBoard plugin on GUI builds.
ml3d/utils/open3d_ops.py Centralizes “PyTorch ops built” checks and a consistent error for missing ops.
ml3d/utils/builder.py Extends device name conversion to include xpu/sycl.
ml3d/torch/utils/torch_utils.py Adds default_training_device() to pick cuda/xpu/cpu consistently.
ml3d/torch/utils/roipool3d/roipool3d_utils.py Switches custom-op import/guards to BUILD_PYTORCH_OPS-based gating (XPU-friendly).
ml3d/torch/utils/pointnet/pointnet2_utils.py Switches custom-op import/guards to BUILD_PYTORCH_OPS-based gating (XPU-friendly).
ml3d/torch/utils/objdet_helper.py Updates docstrings to explicitly include xpu device usage.
ml3d/torch/pipelines/semantic_segmentation.py Uses conditional TensorBoard plugin registration; updates device defaulting to be accelerator-aware.
ml3d/torch/pipelines/object_detection.py Uses conditional TensorBoard plugin registration; improves DDP device_ids handling.
ml3d/torch/pipelines/base_pipeline.py Adds default device selection and xpu handling; adjusts distributed device setup logic.
ml3d/torch/models/sparseconvnet.py Defaults model device based on available accelerator (cuda/xpu/cpu).
ml3d/torch/models/randlanet.py Updates loss docstring to include xpu.
ml3d/torch/models/pvcnn.py Defaults model device based on available accelerator; gates custom ops via BUILD_PYTORCH_OPS.
ml3d/torch/models/point_transformer.py Fixes KNN device handling to preserve original device (cuda/xpu/cpu).
ml3d/torch/models/point_rcnn.py Defaults model device based on available accelerator (cuda/xpu/cpu).
ml3d/torch/models/point_pillars.py Defaults model device based on available accelerator (cuda/xpu/cpu).
ml3d/torch/models/base_model.py Updates loss docstring to include xpu.
ml3d/torch/dataloaders/concat_batcher.py Updates docstring to include xpu.
ml3d/metrics/init.py Adds SYCL iou backend selection path.
docs/howtos.md Adds documentation on CPU/CUDA/XPU parity testing and CI limitations.
ci/run_ci.sh Reworks CI to download/install Open3D wheels per backend and run appropriate test subsets.
.github/workflows/ubuntu.yml Updates GitHub Actions workflow to use the new CPU-wheel-based CI path.
Suppressed comments (2)

ml3d/torch/pipelines/semantic_segmentation.py:663

  • ensure_tensorboard_plugin() can return False on headless Open3D builds (BUILD_GUI=OFF), but writer.add_3d(...) is still called unconditionally. That will raise AttributeError if the plugin couldn't be imported/registered. Consider guarding the add_3d call (e.g., if ensure_tensorboard_plugin(): ...) or skipping 3D summaries when the plugin is unavailable.
        for stage in self.summary:
            ensure_tensorboard_plugin()
            for key, summary_dict in self.summary[stage].items():
                label_to_names = summary_dict.pop('label_to_names', None)
                writer.add_3d('/'.join((stage, key)),
                              summary_dict,
                              epoch,
                              max_outputs=0,
                              label_to_names=label_to_names)

ml3d/torch/pipelines/object_detection.py:534

  • Same issue as semantic_segmentation: ensure_tensorboard_plugin() return value is ignored, but writer.add_3d(...) is called unconditionally. On BUILD_GUI=OFF wheels this will likely fail at runtime when saving logs.
        for stage in self.summary.keys():
            ensure_tensorboard_plugin()
            for key, summary_dict in self.summary[stage].items():
                label_to_names = summary_dict.pop('label_to_names', None)
                writer.add_3d('/'.join((stage, key)),
                              summary_dict,
                              epoch,
                              max_outputs=0,
                              label_to_names=label_to_names)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ml3d/torch/pipelines/base_pipeline.py Outdated
Comment thread tests/torch_backend_parity.py
Comment thread scripts/run_pipeline.py Outdated
Comment thread ml3d/metrics/__init__.py Outdated
ssheorey and others added 3 commits August 20, 2026 23:20
Use device_index for distributed CUDA set_device, device-specific sync
fallbacks in parity tests, drop dead TF cuda:N parsing, and gate SYCL IoU
kernels on non-CPU SYCL devices. CI sets OPEN3D_ML_ROOT so pytest uses
this checkout's PointTransformer until the wheel bundle catches up.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ssheorey
ssheorey merged commit a3d0f7a into main Aug 21, 2026
5 checks passed
@ssheorey
ssheorey deleted the ss/xpu branch August 21, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants