Skip to content

refactor: consume InfiniRT runtime headers#644

Draft
spike-zhu wants to merge 2 commits into
masterfrom
feat/infinirt_runtime
Draft

refactor: consume InfiniRT runtime headers#644
spike-zhu wants to merge 2 commits into
masterfrom
feat/infinirt_runtime

Conversation

@spike-zhu

@spike-zhu spike-zhu commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • Route InfiniOps runtime integration through InfiniRT public headers, using <infini/rt.h> and generated <infini/rt/<backend>/...> wrappers.
  • Rename INFINIRT_SOURCE_DIR to INFINI_RT_SOURCE_DIR and remove the old global src include pollution before adding InfiniRT.
  • Update wrapper code generation to parse against InfiniRT include and generated/include, instead of depending on InfiniRT root-level src headers.
  • Keep InfiniOps legacy public header installation unchanged in this PR.

Motivation

This updates the existing InfiniOps runtime migration to match the current InfiniOps and InfiniRT layout. The related InfiniRT prerequisite is InfiniTensor/InfiniRT#4, which scopes installed InfiniRT headers under <infini/rt.h> / infini/rt/detail/... so installed InfiniOps consumers are not polluted by InfiniRT root-level device.h, runtime.h, data_type.h, or hash.h.

No linked issue.

Type of Change

  • fix – Bug fix (non-breaking change that fixes an issue)
  • feat – New feature (non-breaking change that adds functionality)
  • breaking – Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • docs – Documentation update
  • build / ci – Build system or CI changes
  • perf – Performance improvement
  • test – Test-only changes
  • refactor – Code refactoring without behavior change
  • chore – Maintenance / cleanup

Platforms Affected

  • CPU (WITH_CPU)
  • NVIDIA (WITH_NVIDIA)
  • Iluvatar (WITH_ILUVATAR)
  • MetaX (WITH_METAX)
  • Cambricon (WITH_CAMBRICON)
  • Moore Threads (WITH_MOORE)
  • Ascend (WITH_ASCEND)
  • Build system / CMake / CI
  • Python bindings / user-facing API
  • Documentation only

Smoke Test Result

InfiniOps CPU:

cmake -S . -B build-cpu -DWITH_CPU=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build-cpu -j2

Result: build passed, including examples.

Install consumer smoke:

cmake --install build-cpu --prefix /work/infiniops-install-cpu
c++ consumer.cc \
  -I/work/infiniops-install-cpu/include \
  -L/work/infiniops-install-cpu/lib \
  -linfiniops -linfinirt

Result: compiled and ran successfully with only installed headers, including both <infini/ops.h> and <infini/rt.h>.

InfiniOps NVIDIA:

cmake -S . -B build-nvidia -DWITH_NVIDIA=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build-nvidia -j2

Result: build passed, including examples. The build emitted existing third-party/backend warnings but exited successfully.

Python formatting:

ruff check scripts/generate_wrappers.py
ruff format --check scripts/generate_wrappers.py

Result: passed.

C++ formatting: not run because clang-format / versioned clang-format-* is not installed in the available local or remote images.

Test Results on Supported Platforms

Platform Affected Result Notes
NVIDIA Yes Build passed Compile-level validation passed; runtime execution was not run in the available container.
Iluvatar Yes Not run Runtime include migration touches backend integration; platform validation can follow separately.
MetaX Yes Not run Runtime include migration touches backend integration; platform validation can follow separately.
Cambricon Yes Not run Runtime include migration touches backend integration; platform validation can follow separately.
Moore Threads Yes Not run Runtime include migration touches backend integration; platform validation can follow separately.
Ascend Yes Not run Runtime include migration touches backend integration; platform validation can follow separately.

Benchmark / Performance Impact

No performance impact expected. This PR changes runtime integration, include boundaries, and code generation inputs; it does not change operator kernels or dispatch algorithms.

Notes for Reviewers

Please review this together with InfiniTensor/InfiniRT#4. The important boundary is that InfiniOps should consume InfiniRT through public/installable headers and should not require users to add InfiniRT src/native/... paths to their include search path.

@spike-zhu spike-zhu requested a review from a team June 4, 2026 09:29
Comment thread scripts/generate_wrappers.py
Comment thread src/native/cpu/data_type_.h Outdated
Comment thread src/native/cpu/device_.h Outdated
Comment thread src/native/cpu/runtime_.h Outdated
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
Comment thread src/runtime.h
Comment thread src/data_type.h Outdated
Comment thread src/CMakeLists.txt Outdated
@spike-zhu spike-zhu marked this pull request as draft June 5, 2026 08:51
@spike-zhu spike-zhu force-pushed the feat/infinirt_runtime branch 4 times, most recently from c190413 to df19e5d Compare June 16, 2026 09:28
@spike-zhu spike-zhu changed the title refactor InfiniOps cpu runtime through InfiniRT refactor InfiniOps runtime through InfiniRT Jun 16, 2026
@voltjia voltjia force-pushed the feat/infinirt_runtime branch from df19e5d to ec1e978 Compare June 17, 2026 09:28
@voltjia voltjia changed the title refactor InfiniOps runtime through InfiniRT refactor: consume InfiniRT runtime headers Jun 17, 2026
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