Fix eager eval of non-Field broadcasts in calc_level_val#2494
Fix eager eval of non-Field broadcasts in calc_level_val#2494imreddyTeja merged 2 commits intomainfrom
Conversation
6e6fe50 to
84db859
Compare
There was a problem hiding this comment.
Pull request overview
Fixes CUDA finite-difference eager evaluation so that nested Broadcasted expressions that are not field-style (<: AbstractFieldStyle) are no longer handled as if they were field broadcasts when computing calc_level_val.
Changes:
- Import
AbstractFieldStylefor use in CUDA eager-eval dispatch. - Narrow
reconstruct_space_and_call_calc_level_val’s special-case dispatch toBroadcasted{<:AbstractFieldStyle}to avoid reconstructing placeholder spaces for non-field-style nested broadcasts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
794fde5 to
3d18a61
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,33 @@ | |||
| #= | |||
| julia --project | |||
| using Revise; include(joinpath("test", "MatrixFields", "matrix_fields_broadcasting", "test_scalar_4.jl")) | |||
There was a problem hiding this comment.
The Revise/include snippet in the header comment still references test_scalar_4.jl. This makes it harder to run this test directly; update it to point to test_scalar_17.jl (and keep the path consistent with other scalar tests).
| using Revise; include(joinpath("test", "MatrixFields", "matrix_fields_broadcasting", "test_scalar_4.jl")) | |
| using Revise; include(joinpath("test", "MatrixFields", "matrix_fields_broadcasting", "test_scalar_17.jl")) |
| - label: "Unit: matrix field broadcasting (GPU)" | ||
| key: unit_matrix_field_broadcasting_gpu_scalar_17 | ||
| command: "julia --color=yes --check-bounds=yes --project=.buildkite test/MatrixFields/matrix_fields_broadcasting/test_scalar_17.jl" | ||
| env: | ||
| CLIMACOMMS_DEVICE: "CUDA" | ||
| agents: | ||
| slurm_gpus: 1 | ||
| slurm_mem: 10GB | ||
|
|
There was a problem hiding this comment.
test_scalar_17.jl is only wired into the GPU broadcasting CI group. The CPU broadcasting group currently runs scalar_1–scalar_16, so this addition makes the CPU/GPU scalar test lists diverge. If this test is not truly GPU-only, consider adding a matching CPU step (or consolidating these lists) to keep coverage symmetric and avoid missing regressions on CPU.
| - label: "Unit: matrix field broadcasting (GPU)" | |
| key: unit_matrix_field_broadcasting_gpu_scalar_17 | |
| command: "julia --color=yes --check-bounds=yes --project=.buildkite test/MatrixFields/matrix_fields_broadcasting/test_scalar_17.jl" | |
| env: | |
| CLIMACOMMS_DEVICE: "CUDA" | |
| agents: | |
| slurm_gpus: 1 | |
| slurm_mem: 10GB |
The finite difference evaluation on GPUs incorrectly handles broadcasts that are not
<: AbstractFieldStylewhen they are nested within another Broadcasted.