Replace hypot(x, y) with sqrt(x*x + y*y) for GPU compatibility#48
Merged
siddharthabishnu merged 78 commits intomainfrom Oct 20, 2025
Merged
Replace hypot(x, y) with sqrt(x*x + y*y) for GPU compatibility#48siddharthabishnu merged 78 commits intomainfrom
siddharthabishnu merged 78 commits intomainfrom
Conversation
Added the script 'elliptic_quasi_conformal_cubed_sphere_grid.jl' in the 'src' directory, which leverages elliptic grid generation techniques to enlarge corner cells of the conformal cubed sphere while preserving near-orthogonality. This potentially offers a solution to both computational intensity and grid alignment concerns.
Refined the quasi-conformal cubed sphere grid using the Ensemble Kalman Inversion (EKI) method. EKI, an advanced derivative-free data assimilation technique, iteratively adjusts model parameters to optimize performance and accuracy, based on the comparison of model outputs with observational data. In our application, EKI is employed to optimize the parameters of elliptic grid generation, aiming to enhance the grid's quality. This improvement is measured by steering three key grid diagnostics---orthogonality, isotropy, and uniformity of cell sizes---towards their ideal values representing the “observational data” in our optimization process.
Implement Haversine formula to compute spherical distance.
f9ef5af to
d697527
Compare
Member
|
Two questions:
|
Collaborator
Author
JIT session error: Symbols not found: [ __nv_hypot ] lookupError Failed to materialize symbols: { (enzymejitdl_23, { entry }) } [2025/10/17 20:03:20.897] ERROR Compilation failed, MLIR module written to /tmp/reactant_cZpeeZ/module_000_I6HH_post_all_pm.mlir -@-> /var/lib/buildkite-agent/.julia-oceananigans/packages/Reactant/IgTfV/src/mlir/IR/Pass.jl:119 Reactanigans unit tests: Error During Test at /var/lib/buildkite-agent/Oceananigans.jl-26323/test/test_reactant.jl:64 Got exception outside of a @test "failed to run pass manager on module"On the GPU, the |
Member
|
are we missing an Adapt statement here? |
|
I don't think so, it looks like an issue with Reactant/XLA. I guess if we can use a simpler function that does the same thing that's ok. |
simone-silvestri
approved these changes
Oct 20, 2025
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 change replaces calls to
hypot(x, y)withsqrt(x*x + y*y)to improve GPU compatibility.The
hypotfunction was lowering to the CUDA symbol__nv_hypot, which caused JIT compilation failures in Oceananigans tests.Using explicit multiplication avoids external libdevice dependencies and ensures portability across GPU backends.