Skip to content

Reduce installed Open3D wheel size - #7540

Draft
ssheorey wants to merge 2 commits into
mainfrom
ss/v0.20
Draft

Reduce installed Open3D wheel size#7540
ssheorey wants to merge 2 commits into
mainfrom
ss/v0.20

Conversation

@ssheorey

Copy link
Copy Markdown
Member

Type

  • Bug fix (non-breaking change which fixes an issue): Fixes #
  • New feature (non-breaking change which adds functionality). Resolves #
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

Total open3d wheel install size (blank virtual env): 1.41 GB. Most of the size comes from ML dependencies and CUDA SASS / PTX per-architecture binary code.

Direct requirement Subtotal Notable packages
open3d (wheel) 849.8 MiB open3d
numpy 65.9 MiB numpy
dash 125.4 MiB plotly 62.5, dash 37.8, pydantic/setuptools, …
flask 0.7 MiB Flask
werkzeug 1.6 MiB Werkzeug
nbformat 3.7 MiB jsonschema, rpds-py, …
configargparse 0.2 MiB ConfigArgParse
ipywidgets 47.9 MiB jedi, widgetsnbextension, Pygments, ipython, …
addict ~0 addict
pillow 20.1 MiB pillow
matplotlib 67.8 MiB matplotlib, fonttools, kiwisolver, …
pandas 65.4 MiB pandas
pyyaml 3.0 MiB PyYAML
scikit-learn 178.4 MiB scipy 132.3, scikit-learn 44.1, joblib
tqdm 0.4 MiB tqdm
pyquaternion 0.1 MiB pyquaternion

Separating ml dependencies saves ~335MB of installed disk space.

Install Approx. venv size vs core-only
pip install open3d (today’s release wheel + all Requires-Dist) 1.41 GiB
pip install open3d (future core only) 1.03 GiB baseline
pip install open3d[ml] (core + Open3D-ML requirements.txt) 1.36 GiB +0.33 GiB (~335 MiB)

Analysis of open3d-0.19.0-cp312-manylinux_2_35_x86_64.whl vs open3d_cpu from the same pipeline:

Artifact Approx. size Notes
open3d (CUDA) wheel ~344 MiB Full CUDA + bundled deps
open3d_cpu wheel ~76 MiB CPU-only companion
libOpen3D.so (CUDA wheel) ~778 MiB on disk (uncompressed in wheel) Dominates CUDA wheel
libOpen3D.so (CPU wheel) ~217 MiB No CUDA fatbin
.nv_fatbin (CUDA libOpen3D.so) ~450 MiB Most of the CUDA vs CPU gap

Most CUDA wheel bloat is embedded multi-arch SASS/PTX in libOpen3D.so, not Python packaging overhead.

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style
    to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is
      updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test
      results
      (e.g. screenshots or numbers) here.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description

Reduce CUDA wheel and install size by narrowing release GPU targets for CUDA 12.x (drop Turing SASS) and by aligning CI so release builds consistently use the common architecture list. Documents measured wheel breakdown from 0.19.0 main-devel (cp312, manylinux).

Changes

  • Release CUDA arch list (CUDA toolkit > 12, e.g. 12.6):
    80-real;86-real;89-real;90-real;90
    (Ampere through Hopper SASS, plus 90 PTX for forward compatibility.)
    Replaces 75-real;80-real;86-real;89-real;90, dropping Turing (sm_75) from release builds.
  • CI / wheel pipeline: ensure BUILD_COMMON_CUDA_ARCHS=ON on the installed-library CUDA wheel path so ML CUDA ops match the devel libOpen3D arch set;
  • Ship Open3D-ML pip deps as extras_require[ml], and validate imports via require_ml_extra.
  • Bundle Filament LLVM libc++ on Linux GUI wheels with a small ldd helper

Expected impact

  • CUDA wheel / libOpen3D.so: removing one real architecture (75) from the fatbin should shrink the ~450 MiB NV fatbin section by on the order of ~10–15% (~50–90 MiB off libOpen3D.so, ~50–90 MiB off the CUDA wheel once recompressed—exact numbers need a rebuild). Rough prior estimate was ~778 MiB → ~690 MiB for libOpen3D.so.
  • Dropping Turing support.
  • Open3D-ML users need to explicitly install open3d[ml]

…ackaging

Enable BUNDLE_OPEN3D_ML automatically when PyTorch or TensorFlow ops are built,
ship Open3D-ML pip deps as extras_require[ml], and validate imports via require_ml_extra.
Bundle Filament LLVM libc++ on Linux GUI wheels with a small ldd helper; refresh CI/Docker
for Open3D-ML main, CUDA 12.6+ arch defaults, and local style --changed-only.
@update-docs

update-docs Bot commented Aug 21, 2026

Copy link
Copy Markdown

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@ssheorey ssheorey added this to the v0.20 milestone Aug 21, 2026
@ssheorey
ssheorey requested a balanced review from Copilot August 21, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Reduces Open3D wheel size by optionalizing ML dependencies and narrowing release CUDA architectures.

Changes:

  • Adds the ml package extra and dependency checks.
  • Updates CUDA targets, CI dependencies, and Open3D-ML checkout behavior.
  • Bundles Linux GUI runtime libraries and adds changed-file style checking.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
CMakeLists.txt Automates ML bundling and revises CUDA targets.
cmake/Open3DPrintConfigurationSummary.cmake Reports CUDA architecture settings.
cpp/pybind/CMakeLists.txt Revises wheel runtime-library handling.
cpp/pybind/make_python_package.cmake Packages ML requirements and Linux runtimes.
cpp/pybind/package_linux_wheel_runtime.sh Copies required LLVM runtime libraries.
python/setup.py Exposes ML dependencies as an extra.
python/open3d/_optional_deps.py Validates optional ML dependencies.
python/open3d/ml/configs.py Adds ML dependency validation.
python/open3d/ml/datasets.py Adds ML dependency validation.
python/open3d/ml/utils.py Adds ML dependency validation.
python/open3d/ml/vis.py Adds ML dependency validation.
util/ci_utils.sh Aligns runtime dependencies and CUDA architectures.
util/check_style.py Adds changed-files-only formatting.
docker/Dockerfile.ci Updates ML checkout and dependencies.
3rdparty/README_SYCL.md Documents SYCL runtime installation.
.github/workflows/windows.yml Uses Open3D-ML’s default branch.
.github/workflows/ubuntu.yml Revises the documentation ML checkout.
.github/workflows/ubuntu-wheel.yml Uses Open3D-ML’s default branch.
.github/workflows/macos.yml Uses Open3D-ML’s default branch.

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

from open3d._optional_deps import require_ml_extra

if _build_config['BUNDLE_OPEN3D_ML']:
require_ml_extra()
Comment thread CMakeLists.txt Outdated
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.8")
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.6")
# CUDA 12.x release wheels: drop Turing (75); 90-real SASS + 90 PTX for forward compatibility.
set(CMAKE_CUDA_ARCHITECTURES 80-real 86-real 89-real 90-real 90)
Comment thread cpp/pybind/make_python_package.cmake Outdated
Comment on lines +42 to +44
file(GLOB _libopen3d_probe LIST_DIRECTORIES false
"${PYTHON_PACKAGE_DST_DIR}/open3d/libOpen3D.so.*")
list(GET _libopen3d_probe 0 _libopen3d_probe)
Comment thread .github/workflows/ubuntu.yml Outdated
uses: actions/checkout@v4
with:
repository: isl-org/Open3D-ML
path: /tmp/Open3D-ML
Comment thread python/setup.py
python_requires=">=3.10",
include_package_data=True,
install_requires=install_requires,
extras_require=extras_require,
Make BUNDLE_OPEN3D_ML an option again, defaulting to ON only when ML ops are
built and OPEN3D_ML_ROOT resolves, so local builds can opt out and CI jobs
without an Open3D-ML checkout configure instead of erroring out. Windows wheels
now bundle Open3D-ML too.

Import the Open3D-ML backed submodules of open3d.ml, open3d.ml.torch and
open3d.ml.tf lazily and gate them on require_ml_extra(), so the ops and layers
stay usable with a core-only install and a missing dependency reports how to
install the ml extra. Wheel tests install that extra.

Keep Turing usable after dropping its SASS by emitting compute_75 PTX, which
also needs a -virtual case when translating architectures for PyTorch.

Fall back to the pybind extension when probing for libc++ in static builds,
where libOpen3D is not packaged.

Co-authored-by: Cursor <cursoragent@cursor.com>
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