Skip to content

refactor(runtime)!: adopt the modern Infini stack#506

Draft
voltjia wants to merge 5 commits into
mainfrom
refactor/adopt-modern-infini-stack
Draft

refactor(runtime)!: adopt the modern Infini stack#506
voltjia wants to merge 5 commits into
mainfrom
refactor/adopt-modern-infini-stack

Conversation

@voltjia

@voltjia voltjia commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Move the runtime context, tensor layer, operator adapters, graph bridge, and Python bindings into InfiniLM so the inference repository owns its integration layer.
  • Build InfiniRT, the required InfiniOps operator subset, and InfiniCCL from the revisions pinned by InfiniCore through scripts/build_infini_stack.py.
  • Remove the legacy runtime, inference API, duplicated operator implementation, obsolete model scripts, and retired quantization paths.
  • Add migration contracts, build documentation, focused static tests, and NVIDIA CI integration for the modern stack.

Motivation

The inference stack previously depended on runtime and operator implementations duplicated across repository boundaries. This change makes InfiniRT, InfiniOps, and InfiniCCL authoritative while keeping the inference-specific integration code with InfiniLM. It intentionally removes the former API and build paths, so this is a breaking migration.

Related to InfiniTensor/InfiniCore#1373.

Type of Change

  • feat - new feature / new model
  • fix - bug fix
  • perf - performance improvement (no behavioral change)
  • refactor - code restructuring without behavior change
  • test - adding or fixing tests only
  • docs - documentation only
  • build / ci - build system or CI configuration
  • chore - tooling, formatting, or other non-code changes
  • Breaking change

Test Results of Involved Models on Supported Platforms (Please attach screenshots)

Platform Build Runtime and graph Single request Tensor parallel
NVIDIA A100-SXM4-80GB, CUDA 13.1 Pass Cross-device copy and InfiniRT graph capture/replay pass Qwen3-0.6B pass TP1 and TP2 pass
Other supported platforms Not run Not run Not run Deferred to the follow-up validation phase after NVIDIA review

The validated image reported ci_image_runtime_cross_device_graph_smoke=ok, ci_image_qwen3_tp1_tp2=ok, and CI_IMAGE_VALIDATION_COMPLETE=1. Screenshots are not attached to this draft; the GitHub CI run and remote validation log provide the current evidence.

Benchmark / Performance Impact

N/A. This PR changes ownership and build integration; no performance claim is made.

Notes for Reviewers

  • Review the ownership boundary first: reusable runtime/operator/communication behavior comes from the three pinned components, while inference-specific context, tensors, bindings, and adapters live in this repository.
  • The current phase is intentionally NVIDIA-only. Iluvatar architecture wiring and validation for all remaining platforms are deferred until this branch is reviewed on NVIDIA.
  • The temporary shared-CI feature ref keeps this branch testable before the shared-CI PR lands; a small follow-up will switch both CI references to infiniCore_ci after that merge.

CI / ChatOps

Manual CI was triggered on this branch with infinicore_branch=issue/1373-1: https://github.com/InfiniTensor/InfiniLM/actions/runs/29834591692


Checklist

Title, Branch, and Commits

  • PR title follows Conventional Commits.
  • Branch name follows <type>/xxx-yyyy-zzzz and matches the PR title type.
  • Each commit message follows Conventional Commits.
  • This is a large migration and every commit is meaningful and independently reviewable.
  • No stray merge commits from main; the branch is rebased on the current main.
  • No fixup!, squash!, or wip commits remain.
  • N/A: This work does not retain the legacy issue branch or commit format.

Scope and Design

  • Changes are limited to the modern stack migration, its tests, documentation, and CI support.
  • No dead code, commented-out blocks, debug prints, or unowned TODOs were introduced.
  • No unrelated formatting churn was added.
  • The intentional public API break is documented in the title, motivation, migration design, and build guide.

General Code Hygiene (applies to all languages)

  • Comments are limited to non-obvious rationale.
  • Modified and added files end with a trailing newline.
  • Formatting checks found no trailing whitespace, indentation mixing, or stray BOMs.
  • Code identifiers in comments and error messages use Markdown backticks where applicable.
  • Comments and error messages are in English.
  • Comments and error messages follow repository sentence conventions.

C++ Specific (if C++ files changed)

  • Changed C++ code follows the repository's Google C++ style.
  • Error and warning wording follows the repository conventions.
  • Constructor initializer order was reviewed against member declaration order.
  • No new raw new or delete ownership was introduced.
  • Changed files pass scripts/format.py.
  • No changes or references to csrc/models/llama_legacy/ were added.

Python Specific (if Python files changed)

  • Changed Python code is PEP 8 compliant.
  • Python comments are complete English sentences and format code references consistently.
  • Added docstrings follow PEP 257 where applicable.
  • Changed files pass scripts/format.py, Ruff 0.15.20, and Ruff format checks.
  • No changes or references to python/infinilm/auto_config.py were added.

Testing

  • Other supported platforms are intentionally deferred to the requested follow-up phase; reviewer assignment for those platforms remains pending.
  • Passed examples/test_infer.py with Qwen3-0.6B on NVIDIA at TP1 and TP2.
  • N/A: Offline performance was not run because this PR makes no performance claim.
  • N/A: Benchmark sanity suites were not run in this NVIDIA migration slice; focused runtime, graph, builder, and static contracts were run instead.
  • N/A: The service benchmark was not run because the server endpoint behavior is unchanged and the current validation targets the native stack boundary.

Build, CI, and Tooling

  • A clean accelerator-dev/nvidia:latest build completed from exact GitHub revisions and produced the final NVIDIA CI image.
  • GitHub CI was triggered manually on this branch with the Core integration branch input.

Documentation

  • The repository boundary, build flow, pinned component contract, and landing order are documented.
  • The breaking removal of the legacy API and build path is explicit in the PR title and motivation.

Security and Safety

  • No secrets, access tokens, customer data, or private hardware identifiers were committed.
  • N/A: No third-party source code was added; existing dependencies are fetched at pinned revisions.
  • No unsafe pointer arithmetic, uninitialized reads, or missing bounds checks were introduced by the migration.

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