Skip to content

feat: remove git submodules, use CMake FetchContent for C++ deps#1634

Open
Goldziher wants to merge 4 commits intoPaddlePaddle:developfrom
Goldziher:feat/cmake-fetchcontent
Open

feat: remove git submodules, use CMake FetchContent for C++ deps#1634
Goldziher wants to merge 4 commits intoPaddlePaddle:developfrom
Goldziher:feat/cmake-fetchcontent

Conversation

@Goldziher
Copy link
Copy Markdown

@Goldziher Goldziher commented Mar 14, 2026

Summary

  • Replace git submodules (onnx, optimizer, pybind11, glog) with CMake FetchContent for ONNX v1.20.1 and onnx-optimizer v0.3.19
  • Use find_package for pybind11 and glog (system-installed)
  • Update tests for PaddlePaddle 3.x compatibility
  • Add uv.lock for reproducible Python dependency resolution
  • Update build documentation

Stack

Review and merge in order: #1633 -> this PR -> #1635

CI is expected to pass only on the final PR (#1635), which includes the workflow updates.

- Update ONNX submodule to v1.20.1 (opset 25), onnx-optimizer to v1.5.0,
  pybind11 to v3.0.2
- Fix protobuf v34 compatibility (SetTotalBytesLimit 2-arg to 1-arg)
- Migrate onnxoptimizer includes to onnx/optimizer namespace
- Replace removed tryReplacingAllUsesWith with replaceAllUsesWith API
- Bump Python minimum to 3.10, add ruff linter config, fix all lint issues
- Add pre-commit hooks (gitfluff, ai-rulez, ruff, pyproject-fmt)
- Pin dependency version ranges in pyproject.toml
@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Mar 14, 2026

Thanks for your contribution!

- Add SIM112 to ruff ignore list (PaddlePaddle uses lowercase FLAGS_*)
- Fix ruff lint errors in debug/ files and notebook
- Run ruff format across all files
- Remove hardcoded VS 2019 generator from setup.py
Replace git submodules (onnx, optimizer, pybind11, glog) with:
- FetchContent for ONNX v1.20.1 and onnx-optimizer v0.3.19
- find_package for pybind11 and glog (system-installed)

Also: update tests for PaddlePaddle 3.x, add uv.lock, update docs.
@Goldziher Goldziher force-pushed the feat/cmake-fetchcontent branch from a81b6c7 to b9241fc Compare March 14, 2026 15:05
- Try CONFIG mode for protobuf first, fall back to module mode
  (Ubuntu 24.04's libprotobuf-dev only provides module mode)
- Add pybind11 include dirs to cpp2py_export target so headers
  are found when pybind11 is installed via pip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant