Skip to content

GPU equation of state kernel — 18x speedup at 1M ocean points, PASS #1070

Description

@consigcody94

Summary

The UNESCO equation of state (density from T/S/P) runs on GPU with 18x speedup and max relative error 2.38e-07. Each ocean grid point is independent — one thread per point.

Benchmark (RTX 3060)

Points CPU GPU Speedup Max Rel Error
1M 2 ms 0.109 ms 18.3x 2.38e-07
5M 6 ms 0.427 ms 14.0x 2.38e-07
10M 12 ms 1.02 ms 11.8x 2.38e-07

Zero NaN, zero failures. The polynomial evaluation is simple arithmetic per point.

Also Tested: triDiagTS Vertical Mixing

The implicit vertical mixing tridiagonal solver (triDiagTS) was also tested but only achieved 1.5x speedup due to the large per-column data structure (75 levels x 5 arrays). This would need an Array-of-Structs to Struct-of-Arrays transformation for better GPU performance.

Code

https://github.com/consigcody94/noaa-gpu-kernels/tree/main/ocean/mom6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions