Repository navigation
feat(hygon): expose driver modules and device attributes - #52
Conversation
|
现有 test_install_consumer 会调用 runtime,但没有引用 Driver::ModuleLoadData 等新符号。Hygon 的 CMake target 目前只显式导出 CUDA::cudart。建议让一个只链接 InfiniRT::infinirt 的独立可执行文件实际引用新增函数。这样即使没有加速卡,也能在链接阶段发现依赖缺失。 |
The public Hygon driver header exposes cuModuleLoadData, cuLaunchKernel and the other driver entry points, which live in the CUDA driver library rather than in cudart. The library itself never calls them, so nothing linked it and the exported target carried only CUDA::cudart: a consumer referencing the header had to find the driver library on its own. FindCUDAToolkit does not provide CUDA::cuda for this DTK layout, so the driver library is located next to the toolkit and carried through InfiniRT::BackendRuntime, which the package config re-finds on the consumer's machine - the same route the vendor SDK drivers take. The install consumer now references every entry point of the driver interface, so a missing dependency fails its link on any machine, with or without a device. Addresses the review comment on InfiniTensor#52.
7815bd2 to
62f2195
Compare
感谢!已按建议修复(62f2195): install consumer 现在引用 Driver 接口的全部 7 个入口点(ModuleLoad/GetFunction/Unload、FuncGetAttribute/SetCacheConfig/SetAttribute、LaunchKernel)。volatile 指针存储防止编译器把地址折叠掉。双向验证过:不加导出修复时这个测试链接立即失败,加上后通过——纯链接期检查,无卡机器同样生效。 |
Summary
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 APIPlatforms Affected
WITH_HYGON)Smoke Build and Test Result
Validated on Hygon BW / gfx936 with DTK 26.04, GCC 11.4, and CMake/Ninja:
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
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.