Skip to content

Adapt to KernelIntrinsics/KA 0.10 - #868

Draft
christiangnrd wants to merge 11 commits into
JuliaGPU:mainfrom
christiangnrd:intrinsics
Draft

Adapt to KernelIntrinsics/KA 0.10#868
christiangnrd wants to merge 11 commits into
JuliaGPU:mainfrom
christiangnrd:intrinsics

Conversation

@christiangnrd

Copy link
Copy Markdown
Member

No description provided.

@christiangnrd

christiangnrd commented Dec 18, 2025

Copy link
Copy Markdown
Member Author

id for AMDGPU is used to identify whether we need to launch hostcalls, based on the specific id of the global variable. It is not needed for KA, so can be dropped as in https://github.com/JuliaGPU/AMDGPU.jl/pull/868/files#diff-082b94339c8f038178ee472ca9b6feec6f27f434c469138f168031f248f223f9R197.

(From JuliaGPU/KernelAbstractions.jl#666)

Is my changing static local code generation from LLVMExternalLinkage to LLVMInternalLinkage going to cause any unintended effects? I had to do so to prevent local memory allocations from being treated as the same one if there happen to be more than one in a kernel. Otherwise I think we’ll have to readd the id parameter.

@pxl-th

pxl-th commented Dec 19, 2025

Copy link
Copy Markdown
Member

Is my changing static local code generation from LLVMExternalLinkage to LLVMInternalLinkage going to cause any unintended effects?

I don't think. I think it is a remnant from pre-HIP times.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMDGPU.jl Benchmarks

Details
Benchmark suite Current: 16f913a Previous: 724d15f Ratio
amdgpu/synchronization/context/device 585 ns 577.5 ns 1.01
amdgpu/synchronization/stream/blocking 235 ns 237.5 ns 0.99
amdgpu/synchronization/stream/nonblocking 320 ns 322.5 ns 0.99
array/accumulate/Float32/1d 74686 ns 72383.75 ns 1.03
array/accumulate/Float32/dims=1 290731.75 ns 278954.25 ns 1.04
array/accumulate/Float32/dims=1L 89386.25 ns 80043.75 ns 1.12
array/accumulate/Float32/dims=2 77988.5 ns 71466 ns 1.09
array/accumulate/Float32/dims=2L 2656294 ns 2620236.25 ns 1.01
array/accumulate/Int64/1d 80281 ns 76381 ns 1.05
array/accumulate/Int64/dims=1 245216.25 ns 243786 ns 1.01
array/accumulate/Int64/dims=1L 85278.75 ns 84088.75 ns 1.01
array/accumulate/Int64/dims=2 86359 ns 83453.75 ns 1.03
array/accumulate/Int64/dims=2L 2812319 ns 2864940.25 ns 0.98
array/broadcast 57720.75 ns 68581 ns 0.84
array/construct 2052.5 ns 2195 ns 0.94
array/copy 37343.25 ns 37048 ns 1.01
array/copyto!/cpu_to_gpu 110839 ns 104081.5 ns 1.06
array/copyto!/gpu_to_cpu 110551.5 ns 104479 ns 1.06
array/copyto!/gpu_to_gpu 47378.25 ns 37960.5 ns 1.25
array/iteration/findall/bool 140419.5 ns 134574.5 ns 1.04
array/iteration/findall/int 157469.75 ns 148672.25 ns 1.06
array/iteration/findfirst/bool 124711.75 ns 123486.75 ns 1.01
array/iteration/findfirst/int 125254.25 ns 124531.75 ns 1.01
array/iteration/findmin/1d 114296.75 ns 110069 ns 1.04
array/iteration/findmin/2d 110054.25 ns 96364 ns 1.14
array/iteration/logical 257353.75 ns 245316.25 ns 1.05
array/iteration/scalar 306312 ns 296437 ns 1.03
array/permutedims/2d 72583.5 ns 71361 ns 1.02
array/permutedims/3d 72288.75 ns 70816 ns 1.02
array/permutedims/4d 85658.75 ns 73823.5 ns 1.16
array/random/rand/Float32 46143.25 ns 45335.75 ns 1.02
array/random/rand/Int64 54838.25 ns 54068.25 ns 1.01
array/random/rand!/Float32 47498.25 ns 47823 ns 0.99
array/random/rand!/Int64 73826 ns 66071 ns 1.12
array/random/randn/Float32 79926 ns 77073.75 ns 1.04
array/random/randn!/Float32 79158.75 ns 81381 ns 0.97
array/reductions/mapreduce/Float32/1d 101011.75 ns 94514 ns 1.07
array/reductions/mapreduce/Float32/dims=1 87703.75 ns 84653.75 ns 1.04
array/reductions/mapreduce/Float32/dims=1L 782454.25 ns 776879 ns 1.01
array/reductions/mapreduce/Float32/dims=2 87241.25 ns 83853.75 ns 1.04
array/reductions/mapreduce/Float32/dims=2L 144677 ns 143094.75 ns 1.01
array/reductions/mapreduce/Int64/1d 101356.5 ns 94963.75 ns 1.07
array/reductions/mapreduce/Int64/dims=1 86533.75 ns 84003.75 ns 1.03
array/reductions/mapreduce/Int64/dims=1L 789941.75 ns 789344.25 ns 1.00
array/reductions/mapreduce/Int64/dims=2 86993.75 ns 83641.25 ns 1.04
array/reductions/mapreduce/Int64/dims=2L 144672.25 ns 144282.25 ns 1.00
array/reductions/reduce/Float32/1d 104094.25 ns 92824 ns 1.12
array/reductions/reduce/Float32/dims=1 91221.25 ns 84624 ns 1.08
array/reductions/reduce/Float32/dims=1L 783906.5 ns 782216.75 ns 1.00
array/reductions/reduce/Float32/dims=2 91411.5 ns 84249 ns 1.09
array/reductions/reduce/Float32/dims=2L 143917 ns 143379.75 ns 1.00
array/reductions/reduce/Int64/1d 100016.5 ns 87928.75 ns 1.14
array/reductions/reduce/Int64/dims=1 88551.25 ns 84403.75 ns 1.05
array/reductions/reduce/Int64/dims=1L 787971.5 ns 789071.75 ns 1.00
array/reductions/reduce/Int64/dims=2 87199 ns 83748.75 ns 1.04
array/reductions/reduce/Int64/dims=2L 143832.25 ns 142694.5 ns 1.01
array/reverse/1d 43875.75 ns 43903.25 ns 1.00
array/reverse/1dL 71961 ns 71013.5 ns 1.01
array/reverse/1dL_inplace 79903.5 ns 79038.5 ns 1.01
array/reverse/1d_inplace 60626 ns 59903.25 ns 1.01
array/reverse/2d 49493.25 ns 49135.75 ns 1.01
array/reverse/2dL 84543.75 ns 79608.5 ns 1.06
array/reverse/2dL_inplace 88061.5 ns 91884 ns 0.96
array/reverse/2d_inplace 41405.5 ns 55113.25 ns 0.75
array/sorting/1d 341835 ns 338222.5 ns 1.01
integration/byval/reference 39581 ns 39280 ns 1.01
integration/byval/slices=1 40710 ns 40360 ns 1.01
integration/byval/slices=2 140742 ns 150632 ns 0.93
integration/byval/slices=3 235184 ns 236914 ns 0.99
integration/volumerhs 5054664 ns 5050775 ns 1.00
kernel/indexing 48825.75 ns 57423.5 ns 0.85
kernel/indexing_checked 54053.25 ns 47713.25 ns 1.13
kernel/launch 1627.5 ns 1567.5 ns 1.04
kernel/rand 102489 ns 98961.5 ns 1.04
latency/import 1924337669 ns 1712872529 ns 1.12
latency/precompile 42136499710 ns 37407776408 ns 1.13
latency/ttfp 5811781268 ns 5749419423 ns 1.01

This comment was automatically generated by workflow using github-action-benchmark.

@christiangnrd christiangnrd changed the title Adapt to KernelIntrinsics Adapt to KernelIntrinsics/KA 0.10 Jun 19, 2026
@luraess

luraess commented Jun 22, 2026

Copy link
Copy Markdown
Member

@christiangnrd I just merged #932 so feel free to transfer #933 to this one and close it.

@christiangnrd

christiangnrd commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

I don't have permission to close issues or PRs on this repo but you can close it and I'll remember to add it to this pr once the KA interface is merged

These always run on the CPU backend which is currently broken in 1.12, creating false negatives for the GPU tests
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.

3 participants