Coder Social home page Coder Social logo

climacalibrate.jl's People

Contributors

lenkanovak avatar nefrathenrici avatar szy21 avatar trontrytel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

climacalibrate.jl's Issues

Improve slurm argument passing

The available slurm resource control we provide is restrictive and doesn't provide the capability we need. We should just pass slurm_args as a tuple and splat them into the sbatch script.

Rename CalibrateAtmos

Since this package will be used for other component models than Atmos, we should rename it to reflect this. This will be straightforward because the package is not registered.

The simplest name would be CalibrateModel.jl. Ollie also suggested ClimaCalibrate

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Update to 1.9

We should upgrade sooner rather than later, before more 1.8.5 infrastructure is added.
We need to wait for Atmos to update first.

O3.2.5 Program of work for Moist HS Calibration

Tasks

Rename Repo to CalibrateClimaAtmos or CalibrateMoistHeldSuarez

Could I be a kill-joy here are suggest the name CalibrateClimaAtmos because I expect folks may use this repo as somewhat of a template in future for calibration pipelines too; so starting a naming convention that scales would be a good idea.

Also i hate it ;)

Allow per-experiment slurm configuration

Once ClimaAtmos#2341 is finalized and merged, we can add full GPU support.
This will just require setting proper sbatch arguments for the driver, pipeline.sh. We could do this quickly by adding an additional GPU driver, but I would rather have a unified interface.
I am planning on doing this by introducing a proper command line interface, which will also allow a simpler interface for running experiments.

We will need to :

  • determine the correct GPU settings. This will be quick.
  • Add an argument parser and change the way the pipeline takes in configurations. This will be the bulk of the work, but won't be too complicated because the pipeline is still quite simple.

Add a perfect model example using SurfaceFluxes.jl

This addresses the following issue of the O3.1.1 Milestone:

CliMA/ClimaCoupler.jl#638

Components

  • implement the SF perfect example, using Businger parameters
  • use (and modify where needed) the CalibrateAtmos interface
  • show convergence of parameters
  • debug insensitivity (better observation data needed)
  • ensure the test still runs using the bash scripts
  • adapt Atmos code for the new interface, ensure it runs as before

Convergence (a_m and a_b params)

convergence_coefficient_a_h_businger
convergence_coefficient_a_m_businger
scatter_iter

notes / TODOs

  • SF - Why are some Businger params still hard coded? - fixed in CliMA/SurfaceFluxes.jl#165
  • pipeline.jl runs without bash scripts and was here for debugging. As part of a separate PR, we can generalize it, so a similar script can be used by other lightweight models. For the heavyweight models, we may be able to wrap the bash / SLURM script execution into Julia's pipeline functions, so we can call the scripts from the model repos.
  • we should use the saved output to retrieve ustar in the plotting script

Add proper failure handling

There is no real mechanism to handle failures in the pipeline (particularly in forward model runs).
FailureHandler from EnsembleKalmanProcesses will be used in order to fill the model output with NaNs and properly perform the update step with missing values.
See SampleSuccGauss for more info.

Add backend for Derecho cluster

Derecho uses PBS instead of slurm, so we will need to create a new job controller with the same funcitonality as the slurm controller.

Make `using ClimaCalibrate` useful

We don't export anything, we should export useful methods/types:

An initial list:

  • CaltechHPC
  • calibrate
  • ExperimentConfig
  • get_prior
  • kwargs

Plan for EDMF calibration pipeline for ClimaAtmos.jl

Purpose

The goal is to have calibration scripts for EDMF in ClimaAtmos.jl. This is an equivalent of https://github.com/CliMA/CalibrateEDMF.jl for the standalone EDMF repository.

Cost/Benefits/Risks

Cost/Risk: The initial cost and risk are minimal. We will be mostly porting over and adapting the scripts from CalibrateEDMF.jl

Benefits: We need a calibration pipeline for EDMF in the ClimaAtmos model. The EDMF code is being refactored. It would be extremely helpful to be able to calibrate the refactored code to see if we can recover the current model results.

People and Personnel

(@ the personnel required/requested to implement the software solution)

Components

(Describe the main components of the software solution)

Inputs

(Describe the inputs to the software solution)

Results and deliverables

  • Calibrate a ClimaAtmos.jl SCM EDMF Bomex case (one of the cases we run in the CI) with the data from the standalone TurbulenceConvection.jl model.
  • Add more cases to calibration pipeline.
  • Create a semi-automatic way to trigger calibrations. (This would help with the code refactoring of EDMF)

Task Breakdown And Tentative Due Date

(A preliminary list of PRs and a preliminary timeline of PRs, milestones, and key results)

Proposed Delivery Date

(Your best estimate of the date this software solution will be completed)

Forward model run error: Unable to find compatible target in system image.

Likely need to set JULIA_CPU_TARGET: 'broadwell;skylake'

ERROR: Unable to find compatible target in system image.
Stacktrace:
 [1] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
   @ Base ./loading.jl:1052
 [2] _tryrequire_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String)
   @ Base ./loading.jl:1442
 [3] _require(pkg::Base.PkgId, env::String)
   @ Base ./loading.jl:1816
 [4] _require_prelocked(uuidkey::Base.PkgId, env::String)
   @ Base ./loading.jl:1660
 [5] macro expansion
   @ ./loading.jl:1648 [inlined]
 [6] macro expansion
   @ ./lock.jl:267 [inlined]
 [7] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1611

Update ClimaCalibrate to play well with a modifiable and evolving EKP

Specific Issue

PRs such as this one in ClimaAtmos.jl need to call EKP directly for use due to newer features/uses as they do not exist in ClimaCalibrate.jl
CliMA/ClimaAtmos.jl#3223 (comment)

Specific solution

Add interfaces to EKP Observation/ObservationSeries objects and minibatch calls into CAL.

More general issue

At present one can't interface at all with EKP, the idea being that everything is called within ClimaCalibrate objects.

  • this means one shouldn't need to directly load EKP into their package. But all of the options/settable objects are EKP objects so this happens anyway.
    E.g. the CAL.initialize()
import ClimaCalibrate as CAL
import EnsembleKalmanProcesses as EKP
CAL.initialize(
    ensemble_size,
    observations,
    prior,
    output_dir,
    process = EKP.Inversion(); # <- need EKP
    scheduler = EKP.DefaultScheduler(eki_timestep), # <- ...
    localization = EKP.Localizers.SECNice() # <- ...
    # abc = EKP.xyz() <- ...
)

More general solution

Can we allow users to configure their own EKP and then pass this into the ClimaCalibrate wrapper?
i.e. should our guiding principle be that ClimaCalibrate should not depend on the EKP configuration in order to work

  • this has the benefit that there is lower maintenance on EKP features / objects.
    This may be acheivable by simply adding extra methods to take in the EKP objects, so you do not "have" to use the wrapper.

For example, in your e.g. ClimaAtmos script

import EnsembleKalmanProcesses as EKP

initial_ensemble = EKP.construct_initial_ensemble(rng_ekp, prior, ensemble_size)
ekp_obj = EnsembleKalmanProcess( 
    intial_ensemble,
    observation,
    process = EKP.Inversion();
    scheduler = EKP.DefaultScheduler(eki_timestep), 
    localization = EKP.Localizers.SECNice(),
)

Then we can pass this into ClimaCalibrate so that it doesn't need to know anything about the EKP configuration

import ClimaCalibrate as CAL
CAL.initialize(ekp_obj, output_dir, prior) # 

where we have added a new initialize which

function initialize(ekp_obj, output_dir, prior) 
    save_eki_state(eki, output_dir, 0, prior)
    return eki
end

Make CalibrateEmulateSample a weakdep

CES causes issues with precompilation due to its use of Conda and PyCall. I plan to remove these dependencies in the source package, but a quick fix is to only conditionally load CES.

O3.2.4 Moist Held-Suarez Perfect-Model Calibration

The Climate Modeling Alliance

Software Design Issue ๐Ÿ“œ

Purpose

We will implement a pipeline to calibrate on the moist held-suarez experiment in ClimaAtmos. We will calibrate on the horizontal temperature gradient.
Once this is complete, we will generalize to a pipeline that can handle other cases.

Cost/Benefits/Risks

Primary risk is developer time, but this will save us a lot of time for manual calibration in the long run.

People and Personnel

@szy21 @trontrytel

Components

  • EKP interface: Configure EKP, construct the prior distribution, update ensemble
  • HPC interface: this should be GPU and CPU compatible, ideally running on the cluster and the a100 server.
  • Atmos interface: Configure and run the atmosphere model.
  • Data processing utilities: Needed for constructing the observation map
  • Visualization utilities: Used for comparing model output and determining useful information for the observation map

Inputs

  • EKP configuration: ensemble and iteration sizes
  • Prior distribution TOML
  • Observation map
  • Steady-state restart file

Results and Deliverables

  • Fully working and reproducible perfect-model calibration for moist held-suarez
  • Simple experiment configuration interface with tests
  • Inverse problem for the HS case

Task Breakdown And Schedule

  • #5
  • Create interface
  • Moist HS observation map
  • Demonstrate moist HS perfect model calibration

SDI Revision Log

CC

@tapios @simonbyrne @cmbengue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.