Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NDSL] Aer Activation #942

Closed
3 tasks done
FlorianDeconinck opened this issue May 22, 2024 · 10 comments · Fixed by #964
Closed
3 tasks done

[NDSL] Aer Activation #942

FlorianDeconinck opened this issue May 22, 2024 · 10 comments · Fixed by #964
Assignees

Comments

@FlorianDeconinck
Copy link
Collaborator

FlorianDeconinck commented May 22, 2024

Port the Aer Activation component of Moist to pyMoist

Original code: aer_actv_single_moment.F90:AerActivation

Parent: GEOS-ESM/SMT-Nebulae#57


  • Port Aer Activation to pyMoist
  • Generate dataset that actually looks at non-clamped values for NACTL and non-zero values for NWFA
  • Validate on finer dataset

Breakdown:

Aer_Activation

  • GetActFrac
    • ActFrac_Mat
@mattweil11
Copy link

mattweil11 commented Jul 24, 2024

State of Validation:

  • Data set not good enough for NACTL or NWFA validation
    • Line 285 in the Fortran acts as a clamping feature making NACTL hard to validate. Need different data set to truly validate NACTL.
    • NWFA validation data is always zero. No variance in the validation data.
  • Variables from Fortran that are serialized that are never used in the Python Port according to the translate tests
    • AERO_F_DUST
    • AERO_F_ORGANIC
    • PLE
    • AERO_F_SOOT
    • ZLE0
    • ZL0
    • AERO_DENSITY
    • n_modes --> technically a global constant, but due to how the translate tests is setup, has to be included in the tests
    • SH
    • EVAP
    • KPBL
  • Potential dead code in the Fortran:
    • Lines 238-244 (JM/IM loop) is reran in lines 252-257 (IM/JM/KM loop) so lines 238-244 does not do anything to our understanding
    • Literals 'WC', 'BB' and 'RAUX' are never used - Defined in lines 233-235

@FlorianDeconinck
Copy link
Collaborator Author

PR up: #964

@FlorianDeconinck FlorianDeconinck linked a pull request Jul 25, 2024 that will close this issue
FlorianDeconinck pushed a commit that referenced this issue Jul 29, 2024
Initial port for Aersol Activation subroutine in Moist. Dataset _does not_ cover all cases, will require a re-validation.
@FlorianDeconinck
Copy link
Collaborator Author

4D fields are not handled by the Translate test. We are doing allocation by hand, resulting in not quantities in code and breaking of the auto-uploaded to GPU.

@mattweil11
Copy link

mattweil11 commented Aug 1, 2024

GPU and CPU benchmarks before reintegration:

CPU Range: 8.113 ms - 14.404 ms / median time: 11.2585 ms
GPU Range: 2.727 ms - 2.905 ms / median time: 2.816 ms

Range of Efficiencies:
Median times: GPU 74.98% faster / 4.00x
Minimum times: GPU 66.4% faster / 2.976x
Maximum times: GPU 79.8% faster / 4.957x

Spec (Discover)
CPU: AMD EPYC 7402 (24 cores, released 2020)
GPU: Nvidia A100 40GB (released 2021)

@FlorianDeconinck
Copy link
Collaborator Author

Handled 4D field by duplicating the IJK quantity factory and adding an extra dimension. This means we still need to do the Translate test memory translation by hand, but at least the code has been re-written with the full Quantity standard and is now ready for cpu/gpu.

@FlorianDeconinck
Copy link
Collaborator Author

Orchestration do not validate
GPU do not validate
dace:cpu do not validate

@FlorianDeconinck
Copy link
Collaborator Author

C180_L137 Run:

  • unstable, crashes w/ floating point exception after 1 calculation in Microphysics downstream
  • is it the numerics? is it the bridge?

@FlorianDeconinck
Copy link
Collaborator Author

Bridge fixed.
Stable for 48h of simulation on CPU.
Performance on par with Fortran on gt:dace:cpu

@FlorianDeconinck
Copy link
Collaborator Author

Test on GPU for lower resolution shows stability on gt:dace:gpu

@FlorianDeconinck
Copy link
Collaborator Author

Validation with multi-model metric + in-situ simulation shows good stability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants