Skip to content

Conversation

@KaanKesginLW
Copy link
Contributor

@KaanKesginLW KaanKesginLW commented Dec 5, 2025

Summary

The __init__ function in initialization.jl blocks execution on macOS < 13:

if macos_version() < v"13"
    @error "Metal.jl requires macOS 13 or later"
    return
end

This makes all branches for macOS 10.13, 10.14, 10.15, 11, and 12 in metallib_support(), air_support(), and metal_support() unreachable dead code.

This PR removes ~36 lines of code that can never execute.

Changes

  • metallib_support(): Removed branches for macOS 10.13-12, kept macOS 13+ (minimum returns v"1.2.7")
  • air_support(): Removed branches for macOS 10.13-12, kept macOS 13+ (minimum returns v"2.5")
  • metal_support(): Removed branches for macOS 10.13-12, kept macOS 13+ (minimum returns v"3.0")

The `__init__` function in `initialization.jl` already blocks execution
on macOS < 13, making all branches for macOS 10.13-12 in `metallib_support()`,
`air_support()`, and `metal_support()` unreachable dead code.

This removes ~36 lines of code that can never execute.
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.97%. Comparing base (239fa4d) to head (7a1228c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #720      +/-   ##
==========================================
+ Coverage   80.96%   81.97%   +1.00%     
==========================================
  Files          62       62              
  Lines        2837     2801      -36     
==========================================
- Hits         2297     2296       -1     
+ Misses        540      505      -35     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Metal Benchmarks

Benchmark suite Current: 7a1228c Previous: 239fa4d Ratio
latency/precompile 24104876875 ns 24383716541 ns 0.99
latency/ttfp 2288838792 ns 2324081375 ns 0.98
latency/import 1408815458 ns 1427504083 ns 0.99
integration/metaldevrt 837334 ns 837292 ns 1.00
integration/byval/slices=1 1562895.5 ns 1598354 ns 0.98
integration/byval/slices=3 8819708.5 ns 19021791.5 ns 0.46
integration/byval/reference 1531604 ns 1590708.5 ns 0.96
integration/byval/slices=2 2595375 ns 2727250 ns 0.95
kernel/indexing 605250 ns 459062.5 ns 1.32
kernel/indexing_checked 604292 ns 463104.5 ns 1.30
kernel/launch 12250 ns 11625 ns 1.05
kernel/rand 568583 ns 526667 ns 1.08
array/construct 6417 ns 5958 ns 1.08
array/broadcast 603167 ns 545375 ns 1.11
array/random/randn/Float32 804312.5 ns 886167 ns 0.91
array/random/randn!/Float32 603542 ns 578875 ns 1.04
array/random/rand!/Int64 542417 ns 539083 ns 1.01
array/random/rand!/Float32 579125 ns 533229.5 ns 1.09
array/random/rand/Int64 738041.5 ns 887000 ns 0.83
array/random/rand/Float32 600375 ns 840959 ns 0.71
array/accumulate/Int64/1d 1253417 ns 1292146 ns 0.97
array/accumulate/Int64/dims=1 1825187.5 ns 1865375 ns 0.98
array/accumulate/Int64/dims=2 2125104 ns 2215437 ns 0.96
array/accumulate/Int64/dims=1L 11670417 ns 12096125 ns 0.96
array/accumulate/Int64/dims=2L 9743625 ns 10003417 ns 0.97
array/accumulate/Float32/1d 1115083 ns 1086042 ns 1.03
array/accumulate/Float32/dims=1 1545125 ns 1581542 ns 0.98
array/accumulate/Float32/dims=2 1853437.5 ns 1998167 ns 0.93
array/accumulate/Float32/dims=1L 9769062.5 ns 10248396 ns 0.95
array/accumulate/Float32/dims=2L 7230604 ns 7422792 ns 0.97
array/reductions/reduce/Int64/1d 1530479 ns 1312917 ns 1.17
array/reductions/reduce/Int64/dims=1 1075166 ns 1120125 ns 0.96
array/reductions/reduce/Int64/dims=2 1303062.5 ns 1153917 ns 1.13
array/reductions/reduce/Int64/dims=1L 1994792 ns 2041417 ns 0.98
array/reductions/reduce/Int64/dims=2L 4209750 ns 3778125 ns 1.11
array/reductions/reduce/Float32/1d 1020791.5 ns 796167 ns 1.28
array/reductions/reduce/Float32/dims=1 816416.5 ns 794000 ns 1.03
array/reductions/reduce/Float32/dims=2 844250 ns 818562.5 ns 1.03
array/reductions/reduce/Float32/dims=1L 1315833 ns 1329000 ns 0.99
array/reductions/reduce/Float32/dims=2L 1785708.5 ns 1796708.5 ns 0.99
array/reductions/mapreduce/Int64/1d 1552167 ns 1298666 ns 1.20
array/reductions/mapreduce/Int64/dims=1 1081208 ns 1086313 ns 1.00
array/reductions/mapreduce/Int64/dims=2 1129041 ns 1122666 ns 1.01
array/reductions/mapreduce/Int64/dims=1L 2003041 ns 2025395.5 ns 0.99
array/reductions/mapreduce/Int64/dims=2L 3610625 ns 3647583 ns 0.99
array/reductions/mapreduce/Float32/1d 1062375 ns 774083.5 ns 1.37
array/reductions/mapreduce/Float32/dims=1 814291 ns 791417 ns 1.03
array/reductions/mapreduce/Float32/dims=2 842625 ns 826542 ns 1.02
array/reductions/mapreduce/Float32/dims=1L 1308875 ns 1322667 ns 0.99
array/reductions/mapreduce/Float32/dims=2L 1806625 ns 1817916.5 ns 0.99
array/private/copyto!/gpu_to_gpu 641917 ns 533917 ns 1.20
array/private/copyto!/cpu_to_gpu 799458 ns 690271 ns 1.16
array/private/copyto!/gpu_to_cpu 408541.5 ns 668542 ns 0.61
array/private/iteration/findall/int 1583896 ns 1565687.5 ns 1.01
array/private/iteration/findall/bool 1436125 ns 1465333.5 ns 0.98
array/private/iteration/findfirst/int 2051125 ns 2079042 ns 0.99
array/private/iteration/findfirst/bool 2033833 ns 2020083 ns 1.01
array/private/iteration/scalar 5309166.5 ns 2787125 ns 1.90
array/private/iteration/logical 2610541.5 ns 2599208 ns 1.00
array/private/iteration/findmin/1d 2233270.5 ns 2265458 ns 0.99
array/private/iteration/findmin/2d 1516666 ns 1528791 ns 0.99
array/private/copy 557708 ns 847041.5 ns 0.66
array/shared/copyto!/gpu_to_gpu 84375 ns 84333 ns 1.00
array/shared/copyto!/cpu_to_gpu 92917 ns 83042 ns 1.12
array/shared/copyto!/gpu_to_cpu 84667 ns 83479.5 ns 1.01
array/shared/iteration/findall/int 1573417 ns 1558208 ns 1.01
array/shared/iteration/findall/bool 1438520.5 ns 1470708 ns 0.98
array/shared/iteration/findfirst/int 1637542 ns 1682792 ns 0.97
array/shared/iteration/findfirst/bool 1619417 ns 1644334 ns 0.98
array/shared/iteration/scalar 209958 ns 202000 ns 1.04
array/shared/iteration/logical 2273042 ns 2368458 ns 0.96
array/shared/iteration/findmin/1d 1824959 ns 1845542 ns 0.99
array/shared/iteration/findmin/2d 1504833.5 ns 1521583 ns 0.99
array/shared/copy 242834 ns 210959 ns 1.15
array/permutedims/4d 2363062.5 ns 2473375 ns 0.96
array/permutedims/2d 1154896 ns 1178666.5 ns 0.98
array/permutedims/3d 1660000 ns 1780750 ns 0.93
metal/synchronization/stream 19292 ns 19334 ns 1.00
metal/synchronization/context 19250 ns 20000 ns 0.96

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

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