Skip to content

Test KernelAbstractions launches by their behavior, not the launch kind - #1107

Merged
maleadt merged 1 commit into
mainfrom
tb/ka-fold-launch-tests
Oct 23, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/ka-fold-launch-tests

Conversation

@maleadt

@maleadt maleadt commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

The launch configuration tests asserted which kind of launch KernelAbstractions picks for a few shapes. That choice is KernelAbstractions' policy, not something the back end controls, and the assertions break whenever it changes: JuliaGPU/KernelAbstractions.jl#919 launches 4-d ranges on the N-d grid, which fails them on every back end.

This keeps the checks of what the back end does affect: that a dynamic 3-d range is indexed without divisions, and that iteration spaces too large for 32-bit indices are indexed correctly. The latter now covers a 4-d range that is launched on the N-d grid with JuliaGPU/KernelAbstractions.jl#919, and one that is only large along its last dimension.

The tests pass with KernelAbstractions main and with JuliaGPU/KernelAbstractions.jl#919, so this can be merged first.

The launch configuration tests asserted which kind of launch
KernelAbstractions picks for a few shapes. That is KernelAbstractions'
policy, not something the back end controls, and the assertions break
whenever it changes (JuliaGPU/KernelAbstractions.jl#912 launches 4-d
ranges on the N-d grid).

Keep the checks of what the back end does affect: that a dynamic 3-d
range is indexed without divisions, and that iteration spaces too large
for 32-bit indices are indexed correctly, now also one that is only
large along its last dimension.
@github-actions

Copy link
Copy Markdown
Contributor

Metal.jl Benchmarks

Details
Benchmark suite Current: 75be05d Previous: c82fe46 Ratio
array/accumulate/Float32/1d 399708 ns 393792 ns 1.02
array/accumulate/Float32/dims=1 366166 ns 365833 ns 1.00
array/accumulate/Float32/dims=1L 8854041 ns 8856083 ns 1.00
array/accumulate/Float32/dims=2 432750 ns 430958 ns 1.00
array/accumulate/Float32/dims=2L 2745417 ns 2682625 ns 1.02
array/accumulate/Int64/1d 526167 ns 523167 ns 1.01
array/accumulate/Int64/dims=1 514208 ns 509042 ns 1.01
array/accumulate/Int64/dims=1L 1639750 ns 1635584 ns 1.00
array/accumulate/Int64/dims=2 548291 ns 540250 ns 1.01
array/accumulate/Int64/dims=2L 5425167 ns 5440125 ns 1.00
array/broadcast 240209 ns 237541 ns 1.01
array/construct 2167 ns 2167 ns 1
array/permutedims/2d 343083 ns 340625 ns 1.01
array/permutedims/3d 460458 ns 461459 ns 1.00
array/permutedims/4d 620209 ns 616792 ns 1.01
array/private/copy 227625 ns 220083 ns 1.03
array/private/copyto!/cpu_to_gpu 221083 ns 216959 ns 1.02
array/private/copyto!/gpu_to_cpu 214750 ns 216917 ns 0.99
array/private/copyto!/gpu_to_gpu 209958 ns 219166 ns 0.96
array/private/iteration/findall/bool 517375 ns 515167 ns 1.00
array/private/iteration/findall/int 589167 ns 593000 ns 0.99
array/private/iteration/findfirst/bool 276541 ns 279667 ns 0.99
array/private/iteration/findfirst/int 284209 ns 280750 ns 1.01
array/private/iteration/findmin/1d 343625 ns 341333 ns 1.01
array/private/iteration/findmin/2d 816000 ns 806125 ns 1.01
array/private/iteration/logical 519875 ns 520958 ns 1.00
array/private/iteration/scalar 1398000 ns 1359000 ns 1.03
array/random/rand/Float32 445292 ns 439292 ns 1.01
array/random/rand/Int64 516375 ns 514667 ns 1.00
array/random/rand!/Float32 427375 ns 427875 ns 1.00
array/random/rand!/Int64 450375 ns 438875 ns 1.03
array/random/randn/Float32 372917 ns 368042 ns 1.01
array/random/randn!/Float32 353000 ns 351167 ns 1.01
array/reductions/mapreduce/Float32/1d 220000 ns 217959 ns 1.01
array/reductions/mapreduce/Float32/dims=1 218541 ns 214667 ns 1.02
array/reductions/mapreduce/Float32/dims=1L 578125 ns 578292 ns 1.00
array/reductions/mapreduce/Float32/dims=2 263667 ns 266041 ns 0.99
array/reductions/mapreduce/Float32/dims=2L 418958 ns 425458 ns 0.98
array/reductions/mapreduce/Int64/1d 229208 ns 227709 ns 1.01
array/reductions/mapreduce/Int64/dims=1 230208 ns 224709 ns 1.02
array/reductions/mapreduce/Int64/dims=1L 1007375 ns 997667 ns 1.01
array/reductions/mapreduce/Int64/dims=2 268792 ns 259375 ns 1.04
array/reductions/mapreduce/Int64/dims=2L 610500 ns 591625 ns 1.03
array/reductions/reduce/Float32/1d 221625 ns 212417 ns 1.04
array/reductions/reduce/Float32/dims=1 217209 ns 208792 ns 1.04
array/reductions/reduce/Float32/dims=1L 582292 ns 575167 ns 1.01
array/reductions/reduce/Float32/dims=2 268584 ns 264167 ns 1.02
array/reductions/reduce/Float32/dims=2L 418334 ns 429000 ns 0.98
array/reductions/reduce/Int64/1d 226958 ns 229250 ns 0.99
array/reductions/reduce/Int64/dims=1 229542 ns 227875 ns 1.01
array/reductions/reduce/Int64/dims=1L 999000 ns 996875 ns 1.00
array/reductions/reduce/Int64/dims=2 260292 ns 257417 ns 1.01
array/reductions/reduce/Int64/dims=2L 606375 ns 606792 ns 1.00
array/shared/copy 127833 ns 128791 ns 0.99
array/shared/copyto!/cpu_to_gpu 35958 ns 37416 ns 0.96
array/shared/copyto!/gpu_to_cpu 37000 ns 37291 ns 0.99
array/shared/copyto!/gpu_to_gpu 37292 ns 37334 ns 1.00
array/shared/iteration/findall/bool 521958 ns 518417 ns 1.01
array/shared/iteration/findall/int 591583 ns 591791 ns 1.00
array/shared/iteration/findfirst/bool 284166 ns 264750 ns 1.07
array/shared/iteration/findfirst/int 278542 ns 288166 ns 0.97
array/shared/iteration/findmin/1d 341166 ns 335666 ns 1.02
array/shared/iteration/findmin/2d 816041 ns 817125 ns 1.00
array/shared/iteration/logical 517000 ns 515625 ns 1.00
array/shared/iteration/scalar 85.39876033057851 ns 83.97731958762887 ns 1.02
array/sorting/1d 1907583 ns 1903125 ns 1.00
array/sorting/2d 8244750 ns 8272041 ns 1.00
integration/byval/reference 1110459 ns 1104917 ns 1.01
integration/byval/slices=1 1127167 ns 1112750 ns 1.01
integration/byval/slices=2 2030542 ns 2024916 ns 1.00
integration/byval/slices=3 6844042 ns 6765208 ns 1.01
integration/metaldevrt 397000 ns 379958 ns 1.04
kernel/indexing 213291 ns 209917 ns 1.02
kernel/indexing_checked 393916 ns 392583 ns 1.00
kernel/launch 1604.1 ns 1608.3 ns 1.00
kernel/metalcall 971.9636363636364 ns 977.4590163934427 ns 0.99
kernel/rand 408917 ns 405541 ns 1.01
latency/import 1481397500 ns 1498977875 ns 0.99
latency/precompile 41807333208 ns 41858955250 ns 1.00
latency/ttfp 1794874125 ns 1804670834 ns 0.99
metal/synchronization/context 559.4594594594595 ns 563.2918918918919 ns 0.99
metal/synchronization/stream 354.85781990521326 ns 358.1333333333333 ns 0.99

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

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.47%. Comparing base (c82fe46) to head (75be05d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1107      +/-   ##
==========================================
+ Coverage   88.41%   88.47%   +0.06%     
==========================================
  Files         105      105              
  Lines        9272     9278       +6     
==========================================
+ Hits         8198     8209      +11     
+ Misses       1074     1069       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt merged commit e14efae into main Oct 23, 2026
21 checks passed
@maleadt
maleadt deleted the tb/ka-fold-launch-tests branch October 23, 2026 19:40
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