Repository navigation
Fix interpolate! on Metal for Float32 LatitudeLongitudeGrid - #6057
Merged
Merged
Conversation
xkykai
added a commit
that referenced
this pull request
Sep 22, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6057 +/- ##
==========================================
+ Coverage 74.83% 74.84% +0.01%
==========================================
Files 439 439
Lines 27385 27382 -3
==========================================
+ Hits 20493 20494 +1
+ Misses 6892 6888 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xkykai
marked this pull request as ready for review
September 29, 2026 18:50
xkykai
marked this pull request as draft
September 29, 2026 18:59
xkykai
marked this pull request as ready for review
September 30, 2026 16:45
xkykai
added a commit
that referenced
this pull request
Sep 30, 2026
# Conflicts: # test/metal/metal.jl
xkykai
added this pull request to stack #6122
September 30, 2026 17:45
giordano
reviewed
Sep 30, 2026
xkykai
added a commit
that referenced
this pull request
Sep 30, 2026
xkykai
force-pushed
the
xk/float32-longitude-range
branch
from
September 30, 2026 21:27
db6578e to
c9ba5c2
Compare
xkykai
added a commit
that referenced
this pull request
Sep 30, 2026
`find_λ_range` uses `floor(λ / 360)`: on Julia ≥ 1.12, `÷` and `fld` on Float32 compile to Float64 instructions, which Metal rejects (JuliaGPU/Metal.jl#972). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xkykai
force-pushed
the
xk/float32-longitude-range
branch
from
September 30, 2026 21:36
c9ba5c2 to
efa542f
Compare
xkykai
removed this pull request from stack #6122
September 30, 2026 21:37
giordano
approved these changes
Sep 30, 2026
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.
find_λ_rangeusesfloor(λ / 360)in place of the hand-built floor divisionifelse((λ < 0) & (mod(λ, 360) != 0), λ ÷ 360 - 1, λ ÷ 360), sointerpolate!compiles on Metal for Float32LatitudeLongitudeGrids.On Julia ≥ 1.12,
÷andfldon Float32 go through Float64 (JuliaGPU/Metal.jl#972), which Metal can't compile. The upstream fix, JuliaGPU/Metal.jl#975, needs Metal ≥ 1.10.1, which needs GPUCompiler 2, and Enzyme and Reactant cap it at 1.x.floor(λ / 360)matchesfld(λ, 360)for every Float32 with 2.5e-43 < |λ| < 1.9e8 on the CPU.LatitudeLongitudeGrids with longitudes (-180, 180) and (0, 360).find_λ_rangeto switch tofldonce Oceananigans can use a Metal release with the fix.Closes #6056
🤖 Generated with Claude Code