Skip to content

feat: add Kunlun XRE runtime support - #48

Open
JoeZhang-0x000 wants to merge 1 commit into
InfiniTensor:masterfrom
JoeZhang-0x000:feat/kunlun-runtime
Open

JoeZhang-0x000 wants to merge 1 commit into
InfiniTensor:masterfrom
JoeZhang-0x000:feat/kunlun-runtime

Conversation

@JoeZhang-0x000

@JoeZhang-0x000 JoeZhang-0x000 commented Oct 10, 2026 •

Copy link
Copy Markdown

Summary

  • Add WITH_KUNLUN, append Device::Type::kKunlun = 10 without renumbering existing devices, and generate public Kunlun headers/dispatch.
  • Wrap XRE device memory, pinned host memory, copies, streams and events. Reuse native runtime/dispatch/installed-consumer tests.

Motivation

Prerequisite for InfiniOps #1001, the Kunlun RoPE backend. Neither current runtime nor operator repositories have a Kunlun backend. This replaces the runtime dependency of the closed legacy contribution InfiniCore #1574.

Type of Change

  • feat — new backend capability

Platforms Affected

  • Kunlun (WITH_KUNLUN)
  • Build system / CMake / generated headers
  • Public headers / installed consumer API

Smoke Build and Test Result

P800 OAM; XRE runtime query 5.0 (bded6e7); GCC 9.4; Python 3.10. Fresh builds from this patch:

cmake -S . -B build -DWITH_KUNLUN=ON -DWITH_CPU=ON \
  -DXRE_ROOT=/path/to/xre -DINFINI_RT_BUILD_TESTING=ON \
  -DCMAKE_BUILD_TYPE=Release
cmake --build build -j4
ctest --test-dir build --output-on-failure
# 12/12 passed, including native Kunlun runtime, dispatch,
# unsupported graph capture and installed standalone consumer.

Also built/tested Kunlun only (WITH_CPU=OFF): 11/11 passed; CPU only (WITH_KUNLUN=OFF): 10/10 passed.

Test Results on Supported Platforms

Platform/configuration Result
Kunlun Full ctest passed (11/11)
CPU + Kunlun Full ctest passed (12/12)
CPU Full ctest passed (10/10)
NVIDIA, Iluvatar, Hygon, T-Head, MetaX, Mars, Moore, Cambricon, Ascend Hardware/SDK unavailable; existing backend implementations untouched

Benchmark / Performance Impact

N/A — prerequisite runtime support, no kernel performance claim.

Notes for Reviewers

XRE has no native memset: synchronous fills use bounded 4 KiB staging copies. Async memset/allocation, memory-info, event timing and native graph capture return XPUERR_NOSUPPORT; nonzero event flags are rejected. DeviceSynchronize waits for the default stream and runtime-created streams on the current device; callers borrowing external streams must synchronize them explicitly. Installed consumers resolve XRE via InfiniRT_KUNLUN_ROOT / XRE_ROOT. No report documents or benchmark data are committed.

This branch has not been deployed

No deployments
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