Add atomic fences for Metal 3.2+#875
Merged
Merged
Conversation
christiangnrd
force-pushed
the
fences
branch
3 times, most recently
from
July 17, 2026 15:19
a686e12 to
da6bb0a
Compare
Contributor
There was a problem hiding this comment.
Metal Benchmarks
Details
| Benchmark suite | Current: 997fa62 | Previous: ac0202d | Ratio |
|---|---|---|---|
array/accumulate/Float32/1d |
419125 ns |
407375 ns |
1.03 |
array/accumulate/Float32/dims=1 |
394208 ns |
351791 ns |
1.12 |
array/accumulate/Float32/dims=1L |
8881334 ns |
8796584 ns |
1.01 |
array/accumulate/Float32/dims=2 |
433708 ns |
439792 ns |
0.99 |
array/accumulate/Float32/dims=2L |
2377459 ns |
2603208 ns |
0.91 |
array/accumulate/Int64/1d |
878291 ns |
842333 ns |
1.04 |
array/accumulate/Int64/dims=1 |
950833 ns |
944125 ns |
1.01 |
array/accumulate/Int64/dims=1L |
9680167 ns |
9521000 ns |
1.02 |
array/accumulate/Int64/dims=2 |
948250 ns |
1247208 ns |
0.76 |
array/accumulate/Int64/dims=2L |
6758667 ns |
6499125 ns |
1.04 |
array/broadcast |
191000 ns |
222000 ns |
0.86 |
array/construct |
2416 ns |
2417 ns |
1.00 |
array/permutedims/2d |
461375 ns |
449458 ns |
1.03 |
array/permutedims/3d |
701875 ns |
1011000 ns |
0.69 |
array/permutedims/4d |
1034500 ns |
1275416 ns |
0.81 |
array/private/copy |
244542 ns |
229791 ns |
1.06 |
array/private/copyto!/cpu_to_gpu |
200875 ns |
195833 ns |
1.03 |
array/private/copyto!/gpu_to_cpu |
206167 ns |
194167 ns |
1.06 |
array/private/copyto!/gpu_to_gpu |
182709 ns |
173708 ns |
1.05 |
array/private/iteration/findall/bool |
1126416 ns |
1057250 ns |
1.07 |
array/private/iteration/findall/int |
1252666 ns |
1228125 ns |
1.02 |
array/private/iteration/findfirst/bool |
1095042 ns |
1111542 ns |
0.99 |
array/private/iteration/findfirst/int |
1112000 ns |
1117792 ns |
0.99 |
array/private/iteration/findmin/1d |
1276542 ns |
1229625 ns |
1.04 |
array/private/iteration/findmin/2d |
977541 ns |
769709 ns |
1.27 |
array/private/iteration/logical |
1743166 ns |
1688959 ns |
1.03 |
array/private/iteration/scalar |
1199125 ns |
1216958 ns |
0.99 |
array/random/rand/Float32 |
438875 ns |
426125 ns |
1.03 |
array/random/rand/Int64 |
543917 ns |
513417 ns |
1.06 |
array/random/rand!/Float32 |
371958 ns |
313042 ns |
1.19 |
array/random/rand!/Int64 |
327167 ns |
406791 ns |
0.80 |
array/random/randn/Float32 |
371583 ns |
391833 ns |
0.95 |
array/random/randn!/Float32 |
334250 ns |
340208 ns |
0.98 |
array/reductions/mapreduce/Float32/1d |
391541 ns |
383792 ns |
1.02 |
array/reductions/mapreduce/Float32/dims=1 |
325667 ns |
263000 ns |
1.24 |
array/reductions/mapreduce/Float32/dims=1L |
638792 ns |
621791 ns |
1.03 |
array/reductions/mapreduce/Float32/dims=2 |
328875 ns |
275708 ns |
1.19 |
array/reductions/mapreduce/Float32/dims=2L |
781042 ns |
841125 ns |
0.93 |
array/reductions/mapreduce/Int64/1d |
588958 ns |
621125 ns |
0.95 |
array/reductions/mapreduce/Int64/dims=1 |
547875 ns |
450958 ns |
1.21 |
array/reductions/mapreduce/Int64/dims=1L |
1051917 ns |
1026500 ns |
1.02 |
array/reductions/mapreduce/Int64/dims=2 |
514333 ns |
778292 ns |
0.66 |
array/reductions/mapreduce/Int64/dims=2L |
2162167 ns |
2179166 ns |
0.99 |
array/reductions/reduce/Float32/1d |
387584 ns |
412916 ns |
0.94 |
array/reductions/reduce/Float32/dims=1 |
281125 ns |
345084 ns |
0.81 |
array/reductions/reduce/Float32/dims=1L |
642250 ns |
635167 ns |
1.01 |
array/reductions/reduce/Float32/dims=2 |
202000 ns |
228750 ns |
0.88 |
array/reductions/reduce/Float32/dims=2L |
442084 ns |
448708 ns |
0.99 |
array/reductions/reduce/Int64/1d |
580667 ns |
576542 ns |
1.01 |
array/reductions/reduce/Int64/dims=1 |
543625 ns |
614541 ns |
0.88 |
array/reductions/reduce/Int64/dims=1L |
1036042 ns |
1030125 ns |
1.01 |
array/reductions/reduce/Int64/dims=2 |
227916 ns |
240250 ns |
0.95 |
array/reductions/reduce/Int64/dims=2L |
633084 ns |
644833 ns |
0.98 |
array/shared/copy |
143250 ns |
136583 ns |
1.05 |
array/shared/copyto!/cpu_to_gpu |
37625 ns |
38292 ns |
0.98 |
array/shared/copyto!/gpu_to_cpu |
37083 ns |
38167 ns |
0.97 |
array/shared/copyto!/gpu_to_gpu |
38208 ns |
38917 ns |
0.98 |
array/shared/iteration/findall/bool |
1137542 ns |
1076292 ns |
1.06 |
array/shared/iteration/findall/int |
1143958 ns |
1220458 ns |
0.94 |
array/shared/iteration/findfirst/bool |
782166 ns |
956459 ns |
0.82 |
array/shared/iteration/findfirst/int |
754625 ns |
650041 ns |
1.16 |
array/shared/iteration/findmin/1d |
959375 ns |
1089541 ns |
0.88 |
array/shared/iteration/findmin/2d |
1022458 ns |
1075500 ns |
0.95 |
array/shared/iteration/logical |
1517292 ns |
1553459 ns |
0.98 |
array/shared/iteration/scalar |
3953.125 ns |
4023.714285714286 ns |
0.98 |
array/sorting/1d |
1858459 ns |
1786083 ns |
1.04 |
array/sorting/2d |
8326292 ns |
8305833 ns |
1.00 |
integration/byval/reference |
1103167 ns |
1119042 ns |
0.99 |
integration/byval/slices=1 |
1106625 ns |
1109583 ns |
1.00 |
integration/byval/slices=2 |
2039500 ns |
2021291 ns |
1.01 |
integration/byval/slices=3 |
14466792 ns |
6610875 ns |
2.19 |
integration/metaldevrt |
309250 ns |
379833 ns |
0.81 |
kernel/indexing |
173500 ns |
208708 ns |
0.83 |
kernel/indexing_checked |
367375 ns |
370667 ns |
0.99 |
kernel/launch |
1908.3 ns |
1883.3 ns |
1.01 |
kernel/rand |
341709 ns |
393792 ns |
0.87 |
latency/import |
2065032584 ns |
2038510291 ns |
1.01 |
latency/precompile |
39245643708 ns |
38792921333 ns |
1.01 |
latency/ttfp |
2405619625 ns |
2354706125 ns |
1.02 |
metal/synchronization/context |
578.775956284153 ns |
583.7912087912088 ns |
0.99 |
metal/synchronization/stream |
328.3333333333333 ns |
332.58744394618833 ns |
0.99 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #875 +/- ##
==========================================
- Coverage 86.21% 85.93% -0.29%
==========================================
Files 76 76
Lines 5246 5246
==========================================
- Hits 4523 4508 -15
- Misses 723 738 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Tim Besard <383068+maleadt@users.noreply.github.com>
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.
This is the fence part of #870.
Probably needs better tests since this only checks that things aren't loudly failing and atomic stuff doesn't seem to be validated anywhere other than the compiler we bypass