Skip to content

Performance changes made by claude#751

Open
imreddyTeja wants to merge 1 commit into
mainfrom
tr/claude-perf
Open

Performance changes made by claude#751
imreddyTeja wants to merge 1 commit into
mainfrom
tr/claude-perf

Conversation

@imreddyTeja

@imreddyTeja imreddyTeja commented Jul 2, 2026

Copy link
Copy Markdown
Member

Purpose

I let a claude agent iterate on clima using a gpu and the repl plugin I made. An extremely slowest part of prognostic edmf with 1M microphysics is microphysics_tendencies_1m( #microphysics_tendencies_quadrature_1m.

Optimizing this function using the "longrun_aquaplanet_allsky_progedmf_1M.yml" config in ClimaAtmis, this is what it came up with.
The performance is dependent on the state of the simulation because the frequent usage of conditionals within that kernel. In general, it seems like the kernel now takes 50% the time it used to. A test of it in nightly amip's performance test is

SYPD Using this branch : 0.295
SYPD Using the last release of CM : 0.262

To-do

  • Run full nightly amip with this. I am a bit concerned about the different NaN and edge case handling behavior of the fast math implementations vs IEEE. This cannot be done unless I apply these commits to v0.36 (this is how tested)

As a follow up, I tried using fast math at the CUDA.jl level in ClimaCore, but there seems to be issues with using both always_inline and fast_math in very deeply nested broadcasted expressions.

Content

  • Annotates lines with fastmath

  • I have read and checked the items on the review checklist.

@imreddyTeja
imreddyTeja force-pushed the tr/claude-perf branch 2 times, most recently from 47975e8 to f85bcc0 Compare July 2, 2026 03:25
@imreddyTeja
imreddyTeja marked this pull request as ready for review July 2, 2026 03:25
@imreddyTeja
imreddyTeja requested a review from petebachant July 2, 2026 03:25
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.06780% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.72%. Comparing base (72fa274) to head (5f3c076).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #751      +/-   ##
==========================================
- Coverage   92.96%   92.72%   -0.25%     
==========================================
  Files          56       56              
  Lines        2859     2888      +29     
==========================================
+ Hits         2658     2678      +20     
- Misses        201      210       +9     
Components Coverage Δ
src 93.51% <96.71%> (-0.26%) ⬇️
ext 69.47% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tapios tapios left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good to me.

Did you compare SYPD after #750?

@haakon-e haakon-e left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I will see what translates from here once #731 is next in line to be merged.

@trontrytel

Copy link
Copy Markdown
Member

@imreddyTeja - should we merge this?

@trontrytel trontrytel added Approved 🍀 CI tests & docs All things that matter labels Jul 10, 2026
@imreddyTeja

Copy link
Copy Markdown
Member Author

@trontrytel
I haven't been able to test this yet due to compatibility issues, but those should be resolved by tonight. Even after testing, I'm not sure if this should be merged because of fastmath's different behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved 🍀 CI tests & docs All things that matter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants