Skip to content

feat(hygon): expose driver modules and device attributes - #52

Open
Ringssss wants to merge 1 commit into
InfiniTensor:masterfrom
Ringssss:feat/hygon-driver-modules
Open

Ringssss wants to merge 1 commit into
InfiniTensor:masterfrom
Ringssss:feat/hygon-driver-modules

Conversation

@Ringssss

Copy link
Copy Markdown

Summary

  • Expose Hygon driver module loading, function lookup, launch, unload, and function attributes through the installed InfiniRT API.
  • Add the device attributes used by native JIT launchers and generate infini/rt/hygon/driver_.h.

Motivation

InfiniOps can launch compiled Triton kernels from C++, but its Hygon implementation lacked the public driver interface. This supplies the interface needed by the Clover DCU integration without changing existing runtime operations.

Type of Change

  • feat - new backend capability / public API

Platforms Affected

  • Hygon (WITH_HYGON)
  • Build system / CMake / generated headers
  • Public headers / installed consumer API

Smoke Build and Test Result

Validated on Hygon BW / gfx936 with DTK 26.04, GCC 11.4, and CMake/Ninja:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX="$INFINI_ROOT" -DWITH_CPU=ON -DWITH_HYGON=ON \
  -DAUTO_DETECT_DEVICES=OFF -DINFINI_RT_BUILD_TESTING=ON
cmake --build build -j 12
cmake --install build
export LD_LIBRARY_PATH="/opt/dtk/cuda/cuda/lib64:$LD_LIBRARY_PATH"
ctest --test-dir build --output-on-failure
100% tests passed, 0 tests failed out of 13
Total Test time (real) = 2.18 sec

An installed-header consumer and real InfiniOps Hygon Triton Add, convolution, GDN and MoE launches also passed. The initial consumer run lacked the DTK CUDA compatibility library path; adding that runtime path resolved it.

Test Results on Supported Platforms

Platform Affected Build / Smoke Result Full Result / Notes
CPU Shared header generation Passed Included in the 13-test run
Hygon Yes Passed Runtime, graph, installed consumer, and actual JIT launches
NVIDIA / Iluvatar / MetaX / Moore / Cambricon / Ascend No backend implementation changes N/A Hardware unavailable; their header mappings are unchanged

Benchmark / Performance Impact

N/A: this exposes driver functionality; no standalone speedup is claimed.

Notes for Reviewers

The implementation uses DTK's CUDA driver compatibility API, consistent with the existing Hygon runtime. Tested compiler targets use 64-thread waves. InfiniOps must query the actual HIP compiler target rather than interpreting CUDA compute capability as a gfx architecture.

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