Conversation
From Metal.jl 1.12, Metal.jl lowers LLVM atomics to AIR (JuliaGPU/Metal.jl#977), so Atomix's generic path through UnsafeAtomics works on Metal as-is. Unlike the extension, which called Metal.jl's relaxed atomic functions, it honours the requested ordering, and supports more types and operators. Metal stays a weak dependency, without an extension, so that its compat keeps older versions of Metal.jl out of the environment. The tests now cover orderings, adapted from #79.
This branch has not been deployed
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.
Depends on JuliaGPU/Metal.jl#977, and a Metal.jl release with it (1.12).
With that PR, Metal.jl emits its atomics as plain LLVM atomics, which GPUCompiler lowers to AIR (JuliaGPU/GPUCompiler.jl#942), so Atomix's generic path through UnsafeAtomics works on Metal as-is. It honours the requested ordering on every macOS version Metal.jl supports: natively from Metal 4.1, with fences before that. The extension, which ignores orderings, is therefore removed rather than extended (superseding #79). The generic path also supports more than the extension did: 8- and 16-bit and
Float16atomics, and arbitrary operators inmodify!(through a compare-exchange loop).Versioning: Metal stays in
[weakdeps], without an extension, so that its compat (bumped to 1.12) keeps older versions of Metal.jl out of an environment with this version of Atomix; Pkg keeps Atomix 1.2 for those. Metal.jl 1.12's own compat takes care of GPUCompiler and UnsafeAtomics. Conversely, Atomix 1.2 still works with Metal.jl 1.12, as the functions its extension calls remain, but orderings stay ignored there.The Metal tests now cover orderings (adapted from #79) and check that ordered atomics reach the generated code. They pass locally (M1, macOS 27, Julia 1.12) with Metal.jl and GPUCompiler from the PRs' branches, as does Aqua. Metal CI will fail until Metal.jl 1.12 is registered, because the compat can't be satisfied yet.