Skip to content

Add build-time plugin contract#633

Draft
voltjia wants to merge 1 commit into
masterfrom
feat/build-plugin-contract
Draft

Add build-time plugin contract#633
voltjia wants to merge 1 commit into
masterfrom
feat/build-plugin-contract

Conversation

@voltjia
Copy link
Copy Markdown
Collaborator

@voltjia voltjia commented Jun 3, 2026

Summary

Introduce a build-time plugin contract for InfiniOps platform backends while keeping the produced libinfiniops and Python ops module unchanged.

This PR adds:

  • a CMake plugin registry API (infini_ops_register_plugin, infini_ops_register_device) and INFINI_OPS_PLUGINS selection
  • built-in plugin manifests and CMake entries for CPU, cuda-common, NVIDIA, Iluvatar, Hygon, MetaX, Moore, Cambricon, and Ascend
  • compatibility mapping from existing WITH_<PLATFORM> options to the new plugin enable path
  • generated plugin registry JSON consumed by wrapper generation
  • wrapper generation support for plugin-provided device headers and operator roots
  • schema/registry and codegen tests for plugin behavior

cuda-common is modeled as a shared plugin and is pulled in by CUDA-like device plugins rather than exposed as a user device.

Validation

  • .venv/bin/python -m py_compile scripts/infini_ops_plugin_registry.py scripts/generate_wrappers.py
  • .venv/bin/python -m pytest -s -q tests/test_plugin_registry.py tests/test_generate_wrappers_plugins.py
  • .venv/bin/ruff check scripts/infini_ops_plugin_registry.py scripts/generate_wrappers.py tests/test_plugin_registry.py tests/test_generate_wrappers_plugins.py
  • /home/voltjia/.cache/uv/archive-v0/xuDH-Kne6u5S9ov7/bin/cmake -S . -B build/plugin-cpu-rename-smoke -DINFINI_OPS_PLUGINS=cpu -DGENERATE_PYTHON_BINDINGS=OFF -DGENERATE_OPERATOR_CALL_INSTANTIATIONS=OFF
  • /home/voltjia/.cache/uv/archive-v0/xuDH-Kne6u5S9ov7/bin/cmake --build build/plugin-cpu-rename-smoke --target infiniops --parallel 2
  • /home/voltjia/.cache/uv/archive-v0/xuDH-Kne6u5S9ov7/bin/cmake -S . -B build/plugin-legacy-cpu-rename-smoke -DWITH_CPU=ON -DGENERATE_PYTHON_BINDINGS=OFF -DGENERATE_OPERATOR_CALL_INSTANTIATIONS=OFF

Hardware backend builds/tests were not run locally.

@voltjia voltjia force-pushed the feat/build-plugin-contract branch from 850951c to 034bc25 Compare June 3, 2026 12:44
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.

1 participant