GridTools
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Architecture for Models with GT4Py [minutes] -> Slides(password: the slack channel name without `#`): https://polybox.ethz.ch/index.php/s/SZUHMAYJbsWn0mQ ## Thursday 6th June ### 9:30 - 11:00 Warmup session and introductions - Oliver E.: Lagrangian to Eulerian use-case forced the introduction of the `while` loop in `gt4py.cartesian` - Florian: probably we need a new `Column` concept to deal with column-based physics code - Hannes: staggering in cartesian grids should be easy and automatic (e.g. `X + Half = X^ ...`) - Rusty: managing a team with many people, some of them looking into improving gt4py.cartesian performance by inspecting at the generated source code - Loic (MeteoFrance): porting AROME physical parametrizations for PMAP in gt4py.cartesian. Some other people trying Loki as a first step into the conversion. Already using python infrastructure like Sympl (ifs-physics-common), xarray. Some challenges with gt4py: - choice of stencil at compilation (inline one or other computation) - choice of function behavior at run-time - `while` loops for explicit sources (field collections?) - `while` loops for explicit sources computation (GlobalTables) For the future keep looking at Loki as pre-translation step for GT4Py, and also looking SURFEX. - Christoph: interested in the interface between Fortran and Python and performance. At MCH they wrote a Fortran pre-processor to substitute loop nests by calls to gt4py stencils in the original Fortran ICON code. + Florian comment: sometimes DaCe doesn't fuse loops that should be fused because of some carried state prevents merging them. It should be improved. - Xavier: interested in how to address the control flow issue in the solver or trying different components. GT4Py should also improve in the user friendliness for writing physics and column-based physics. - Till: working in gt4py IR and contact person for PMAP. - Sara: working in PMAP and gt4py. Some issues in the past with prototyping in embedded (can’t run without parsing/using parts of frontend). - Jeremy: he started working in Sympl and later in Pace. Now doing mostly ML climate models. Interested in models architecture and patterns like the `Builder` pattern: - read configuration from files and represent it as classes (_probably_ similar to `omegaconf`) - code sample: https://storage.googleapis.com/vcm-ml-public/jeremym/fme-docs/5b9e2b80/builder.html - Chia Rui: domain scientist at EXCLAIM. Bad experiences with error messages (in embedded and compiler backends) when something goes wrong. For example, I encountered memory access problem when running on GPU in one stencil and I did not know which line causes the problem.This is especially bad when stencil is long. Also a bit frustated with that gtp4y does not allow while loop iteration as physics parameterization involves looping over species and some iterative schemes. - Mikael Stellio: started with gt4py as a student long time ago. Ported FV3 microphysics and some other codes to gt4py in different student projects. Currently working in HAMMAN project (porting aerosol model to OpenACC and gt4py). + He encountered weird that `scan_operator` signature accepts scalars but then are called with fields. - Stefano: long-time (since 2016) GT4Py user and used it for this PhD. Currently working in PMAP physical parametrizations. + Whishlist: + vertical offset writes + lower-dim temporaries + absolute indexing in the vertical + `for` loops along data dimensions - Christos: joined CSCS in October. Working in DaCe orchestration for gt4py and halo exchanges. - Magdalena: joined EXCLAIM 2 years ago and started with gt4py by porting stencils. Currently working mostly in the architecture and components of a python model. Annoyed by the ugly way to deal with vertical staggering currently in gt4py and two ways to express sparse fields. - Enrique: working in gt4py since 2016 and interested in making gt4py models cleaner and better structured. - Abishek: working in EXCLAIM for 2 years. Integrating the gt4py-python granule in ICON. The current stencils in icon4py do not look very readable. - Mauro: director of software of EXCLAIM and original author of GridTools. Interested in the composability and architecture of a full model using components. Also interested in being able to define the data layout from the computations that are going to be performed, and in how to place the halo exchanges automatically for better performance. ### 11:15 - 12:30 Current infrastructure & support libraries #### PMAP infrastructure - PMAP-L (cartesian): - IndexSpaces, `stencil` wrappers, `FieldDescr` field descriptors for linking index spaces and field shapes - partial implementation of generics, permit a number of pinput locations, output location implements as `SameAs` input location - PMAP-L (distributed): - Partitioner, HaloEschanger, DistributedField - Context manager to allocate temporary fields (fields pool) - Context manager for halo exchanges - CI: - steps: build docker image, compilation cache for the compiled stencils, execution - Tests: - basic unit testing - integration tests: several cases, some automation for validation but also manual validation by scientists (Christian K.) - pytest-benchmarks (no yet place for the outputs) - Configuration: - Read from yaml files and create `pydantic` models (omega-conf like?) - Wishlist: - Compilation cache - Field collections - Enums - Boundary conditions - Generics - Convergence loops with global reductions #### NDSL / PACE infrastructure -> Slides: _arch_workshop24_ndsl.pdf_ - SHiELD = GFDL's FV3 (kind of forked from the NOAA's UFS dycore?) - Pace = PyFV3 + PySHiELD + NDSL - NDSL middleware layer - constants, metric terms - wrapper for gt4py and caching, DaCe support - MPI interface - Configuration classes with overlapping sets as properties - Quantity and Stencil factories - `Translate_` classes initially used for testing the migration from Fortran but now are also useful for having standalone execution of some components. #### ICON4Py infrastructure with Python driver (green-line) - EXCLAIM project uses ICON model from DWD, now also in production at MeteoSwiss. - ICON4Py repository is a monorepo with namespace packages for different components - ICON Fortran is not really modular although there is some ongoing efforts. A _"granule"_ is the concept of module for Fortran - Icon4py granules follow currently the same interface as the Fortran granules. The component object has an explicit `init` method different than `__init__()` because of it. - Python components can now be called from Fortran as a black box, which would allow changing the internals of the module. - Currently exploring reading the ICON grid file using UXarray - GHEX used for halo exchanges. ## Friday 7th June ### **9:15** Jeremy's summary - Florian: code coverage tools could be useful, specially focused in testing all the numeric components in the testing simulation. ### **10:00** Shared Libraries - (Jeremy) Suggestions to add to GT4Py. - Subdomain definitions: - The PMAP domain definitions using names looks better and not so lower-level as the horizontal regions in FV3 - They might be a good way to combine both ways - User-provided cache implementations to customize the behavior. - Try to identify general functionality in the support libraries that it could be extracted and reused. - Checkpointers from Pace - Parallel compilation and distribution of stencils/programs ### **11:00** Physics - Necessary to write full models and therefore for user's adoption of gtp4y. - Mikael (HAMAM) already collected some patterns and how to migrate them (if possible) to gt4py - ECMWF have collected/will collect some patterns for radiation? and tried different frameworks/languages #### Action points: - Create a repository with examples of column physics patterns. All models to contribute. - https://github.com/GridTools/physics_patterns - Match every examples with an answer in gt4py.next and gt4py.cartesian. - Clean it up to make it digestible for new users of GT4Py (e.g. date the example & their matched implementation, etc.) ### **12:00** Other topics #### Autodifferentiation - Florian and someone also at NASA looked into using JAX with the numpy backend but didn't work very well - Another try they did was using Enzyme (LLVM autodifferentiation) with the generated C++ by the DaCe backend. - SPCL is also doing some early work in autodifferentiation with SDFGs -

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully