Repository navigation
Legalize barriers for the target AIR version here, not in GPUCompiler - #1099
Merged
Merged
Conversation
Device code emits barriers in their AIR 2.9 form, with a memory order, and relied on GPUCompiler to drop it for older targets and to make it sequentially consistent before MSL 4.1. Do that in `finish_ir!` instead, next to the rewrites of the other intrinsics device code emits, so that GPUCompiler doesn't need to know the forms Metal.jl emits and the two can change independently.
Contributor
Metal.jl BenchmarksDetails
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 #1099 +/- ##
==========================================
- Coverage 88.18% 88.16% -0.02%
==========================================
Files 105 105
Lines 9147 9194 +47
==========================================
+ Hits 8066 8106 +40
- Misses 1081 1088 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Device code emits barriers in their AIR 2.9 form, with a memory order, and relied on GPUCompiler (
legalize_barrier_abi!, JuliaGPU/GPUCompiler.jl#1020) to drop the order for older AIR versions and to make it sequentially consistent before MSL 4.1. This moves that rewrite intofinish_ir!, next to those of the simdgroup matrix and tensor intrinsics, following #1097: GPUCompiler then doesn't need to know the forms Metal.jl emits, and only legalizes the atomics and fences it emits itself.With the GPUCompiler releases this currently allows, the rewrite there becomes a no-op, so this needs no compat change. It has to be merged before JuliaGPU/GPUCompiler.jl#1047 is released, which removes GPUCompiler's version; no released Metal.jl emits the AIR 2.9 form.
device/intrinsics/{synchronization,simd,atomics}pass on an M1 with macOS 27 against both GPUCompiler 2.16.0 and that branch. Without this change, the barrier ABI tests (Metal 3.2/AIR 2.7, Metal 4.0/AIR 2.9) fail against the branch.