Skip to content

feat: add driver API foundation and NVIDIA implementation - #44

Merged
voltjia merged 1 commit into
InfiniTensor:masterfrom
fuyou4546:feat/add-driver-api
Aug 11, 2026
Merged

feat: add driver API foundation and NVIDIA implementation#44
voltjia merged 1 commit into
InfiniTensor:masterfrom
fuyou4546:feat/add-driver-api

Conversation

@fuyou4546

Copy link
Copy Markdown
Contributor

Summary

  • Add Driver abstraction DriverBase, DeviceDriver, CudaDriver in src/driver.h and src/native/cuda/driver_.h
  • Implement NVIDIA CUDA driver specialization in src/native/cuda/nvidia/driver_.h
  • Add DeviceGetAttribute in src/native/cuda/nvidia/runtime_.h

Motivation

Enable module loading, kernel function retrieval, and kernel launching through a Driver API.

Type of Change

  • feat - new feature / new backend capability / new public API
  • fix - bug fix
  • perf - performance improvement without behavior 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 (requires a ! in the Conventional Commits prefix or a BREAKING CHANGE: footer)

Platforms Affected

  • CPU (WITH_CPU)
  • NVIDIA (WITH_NVIDIA)
  • Iluvatar (WITH_ILUVATAR)
  • Hygon (WITH_HYGON)
  • MetaX (WITH_METAX)
  • Moore (WITH_MOORE)
  • Cambricon (WITH_CAMBRICON)
  • Ascend (WITH_ASCEND)
  • Build system / CMake / generated headers
  • Public headers / installed consumer API
  • Documentation only

Smoke Build and Test Result

cmake -S . -B build -DWITH_NVIDIA=ON -DINFINI_RT_BUILD_TESTING=ON
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zhangshuo/projects/InfiniTensor/InfiniRT/build
cmake --build build -j
Consolidate compiler generated dependencies of target infinirt
···
[100%] Built target test_tensor_view_allocations
ctest --test-dir build --output-on-failure
···
100% tests passed, 0 tests failed out of 12
Total Test time (real) = 12.96 sec

Test Results on Supported Platforms

PlatformAffectedBuild / Smoke ResultFull Result / Notes
CPU
NVIDIA
Iluvatar
Hygon
MetaX
Moore
Cambricon
Ascend
Full `ctest` output (optional)
ctest --test-dir build --output-on-failure
Start 1: test_smoke
1/12 Test #1: test_smoke ....................... Passed 0.00 sec
Start 2: test_core
2/12 Test #2: test_core ........................ Passed 0.00 sec
Start 3: test_small_vector
3/12 Test #3: test_small_vector ................ Passed 0.00 sec
Start 4: test_metadata_view
4/12 Test #4: test_metadata_view ............... Passed 0.00 sec
Start 5: test_shape_strides_storage
5/12 Test #5: test_shape_strides_storage ....... Passed 0.00 sec
Start 6: test_tensor_view_allocations
6/12 Test #6: test_tensor_view_allocations ..... Passed 0.01 sec
Start 7: test_cpu_runtime
7/12 Test #7: test_cpu_runtime ................. Passed 0.00 sec
Start 8: test_nvidia_runtime
8/12 Test #8: test_nvidia_runtime .............. Passed 3.05 sec
Start 9: test_nvidia_graph
9/12 Test #9: test_nvidia_graph ................ Passed 2.84 sec
Start 10: test_runtime_dispatch
10/12 Test #10: test_runtime_dispatch ............ Passed 2.87 sec
Start 11: test_install
11/12 Test #11: test_install ..................... Passed 0.02 sec
Start 12: test_install_consumer
12/12 Test #12: test_install_consumer ............ Passed 2.98 sec
100% tests passed, 0 tests failed out of 12

Benchmark / Performance Impact

N/A

Notes for Reviewers

  • The Driver implementation mirrors the existing Runtime system

@voltjiavoltjia changed the title feat: add driver api foundation and NVIDIA implementationfeat: add driver API foundation and NVIDIA implementationAug 11, 2026
Comment threadsrc/native/cuda/nvidia/driver_.h Outdated
Comment threadsrc/native/cuda/nvidia/runtime_.h
@voltjia
voltjia self-requested a review August 11, 2026 03:03
@voltjia
voltjia merged commit f9fd349 into InfiniTensor:masterAug 11, 2026
4 checks passed
Sign up for freeto 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

@fuyou4546@voltjia