Skip to content

feat: add public runtime dispatch API#3

Merged
voltjia merged 1 commit into
masterfrom
feat/public-runtime-dispatch-api
Jun 17, 2026
Merged

feat: add public runtime dispatch API#3
voltjia merged 1 commit into
masterfrom
feat/public-runtime-dispatch-api

Conversation

@voltjia

@voltjia voltjia commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a stable public dynamic dispatch layer for InfiniRT runtime calls, so users can call CUDA-style free functions through #include <infini/rt.h> instead of selecting Runtime<Device::Type::...> directly.

Changes

  • Add public runtime APIs: SetDevice, GetDevice, GetDeviceCount, DeviceSynchronize, Malloc, Free, Memset, and Memcpy.
  • Extend public header generation to also generate generated/src/runtime_dispatch.cc for enabled backends.
  • Add backend runtime adapters for CPU, NVIDIA, Iluvatar, MetaX, Moore, Cambricon, and Ascend device management and memcpy kinds.
  • Add CTest coverage for CPU/NVIDIA dynamic dispatch and extend install consumer smoke to use only <infini/rt.h>.

Validation

  • ruff check scripts/generate_public_headers.py
  • ruff format --check scripts/generate_public_headers.py
  • git diff --check origin/master..HEAD
  • Remote CPU CTest: 6/6 passed
  • Remote NVIDIA CTest: 6/6 passed
  • Remote Cambricon CTest: 4/4 passed
  • Remote Iluvatar CTest: 4/4 passed
  • Remote Ascend CTest output: 4/4 passed; container exits with code 137 after tests complete, consistent with the known environment behavior

@voltjia voltjia force-pushed the feat/public-runtime-dispatch-api branch from c60cc8e to 7629d09 Compare June 17, 2026 07:36
Comment thread src/native/ascend/runtime_.h
Comment thread src/native/cambricon/runtime_.h
Comment thread src/native/cambricon/runtime_.h
Comment thread src/native/cpu/runtime_.h
Comment thread src/runtime.h
Comment thread tests/test_runtime_dispatch.cc
Comment thread tests/install_consumer_smoke.cc
@voltjia voltjia force-pushed the feat/public-runtime-dispatch-api branch from 7629d09 to be8440c Compare June 17, 2026 08:07
Comment thread src/runtime.h Outdated
@voltjia voltjia force-pushed the feat/public-runtime-dispatch-api branch from be8440c to 4669f36 Compare June 17, 2026 08:16
@voltjia voltjia marked this pull request as ready for review June 17, 2026 08:19
@voltjia voltjia requested a review from Ziminli June 17, 2026 08:19
@voltjia voltjia changed the title Add public runtime dispatch API feat: add public runtime dispatch API Jun 17, 2026
@voltjia voltjia merged commit ea21e2f into master Jun 17, 2026
4 checks passed
@voltjia voltjia deleted the feat/public-runtime-dispatch-api branch June 17, 2026 08:40
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