Repository navigation
Forward KernelInterface's kernel queries to the HIPFunction - #1162
Merged
Merged
Conversation
`KI.max_work_group_size` and `KI.launch_configuration` are specialized on the kernel, so their bodies, including the checked `hipFuncGetAttribute` call, were compiled for every kernel launched through KernelAbstractions. Forward them to functions of the `HIPFunction`, which are compiled once, as CUDA.jl does. The calls are unchanged. Host compile time for a new broadcast kernel, after warm-up: 106.7 -> 95.9 ms (medians of 3 runs, Julia 1.12, gfx1036).
Contributor
AMDGPU.jl BenchmarksDetails
This comment was automatically generated by workflow using github-action-benchmark. |
Member
|
cscs-ci run |
Member
|
cscs-ci run MI250,MI300 |
luraess
approved these changes
Oct 21, 2026
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.
KI.max_work_group_size(::KI.Kernel)andKI.launch_configuration(::KI.Kernel)are specialized on the kernel, whose type includes the kernel function and argument types, and KernelAbstractions calls them from launch code that's compiled for every kernel. Their bodies, including the checkedhipFuncGetAttributecall, were therefore compiled again for every new kernel:ROCKernels.max_work_group_sizealone took ~8 ms of inference per kernel.This forwards both to functions of the
HIPFunction, which are compiled once, the same way CUDA.jl does. The calls are unchanged;AMDGPU.launch_configuration(::HIPKernel)only forwarded toHIP.launch_configuration(::HIPFunction).For one new GPUArrays broadcast kernel, after warm-up, host compile time goes from 106.7 to 95.9 ms (Julia 1.12, gfx1036, medians of 3 runs). JuliaGPU/KernelAbstractions.jl#900 removes more of the per-kernel cost in KA's own launch code.
Tested with the kernelabstractions, kernelinterface and gpuarrays/broadcasting tests on a gfx1036.