Repository navigation
fix(hygon): resolve CUDA runtime overloads in device compilation - #53
Open
baominghelly wants to merge 1 commit into
Open
baominghelly wants to merge 1 commit into
baominghelly wants to merge 1 commit into
Conversation
baominghelly
marked this pull request as ready for review
November 5, 2026 09:27
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetDevice,GetDeviceCount,DeviceSynchronize, andMemcpyAsync) with forwarding lambdas, matching the existing wrappers insrc/native/cuda/hygon/runtime_.h..cutranslation unit, retaining the ordinary C++ test.Motivation
In the DTK 25.04.1 CI image, InfiniRT builds successfully as C++, but downstream InfiniOps device compilation fails when it includes the installed Hygon runtime header:
The same diagnostic occurs for all four aliases. Calling the CUDA APIs inside forwarding wrappers allows overload resolution at the call site instead of trying to deduce a function pointer from an overload set.
The baseline failure was reproduced with a minimal CUDA translation unit before validating the fix. Original downstream failure.
Type of Change
feat- new feature / new backend capability / new public APIfix- bug fixperf- performance improvement without behavior changerefactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changesPlatforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_HYGON)WITH_METAX)WITH_MOORE)WITH_CAMBRICON)WITH_ASCEND)The CMake addition is restricted to
WITH_HYGON. Generated and installed Hygon detail headers inherit the source change; the header generator itself is unchanged.Smoke Build and Test Result
Validated commit:
46d411ef37f7c8a5d599ceca78547eac0bcbbfd4.Environment: BW200 / gfx936, image
image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.4.1-ubuntu22.04-dtk25.04.1-py3.10, DTK CUDA facade 12.6.77. The temporary container selected its existing CUDA 12 toolkit and exportedCUDA_PATH,CUDA_HOME,PATH, and its runtime library directory inLD_LIBRARY_PATH. One idle GPU was selected automatically and held with the existing host GPU lease; the container verified that exactly one device was visible.Downstream InfiniOps build and smoke:
python -m pip install '.[dev]' --no-build-isolation \ --config-settings=cmake.define.INFINI_OPS_SMOKE_BUILD=ON \ --config-settings=cmake.define.INFINI_RT_ROOT=/task/infinirt-prefix pytest tests/ -m smoke -n 4 -v --tb=short --junitxml=/task/test-results.xmlA fresh GitHub runner acceptance run pinned this exact InfiniRT commit and independently passed build/install and the same smoke suite: 161 passed, 73 skipped, 0 failed. JUnit and GPU lease artifact.
The existing smoke suite determines the skips for unavailable implementations and platform-specific requirements. No test selection, tolerance, or idle-GPU threshold was relaxed. The two Torch warnings concern unavailable memory-efficient attention; the corresponding tests passed.
Test Results on Supported Platforms
Benchmark / Performance Impact
N/A. This fixes device-compilation compatibility; no performance claim.
Notes for Reviewers
test_native_runtime.ccand the existing Hygon test definitions so host and device compiler coverage exercise the same runtime behavior.