Elliott Kasoar
Current Organizations / Institutes
The organizations/institutes from the scholar's latest article
Research Subjects
Research Interests
Elliott Kasoar has a total of 9 co-authors. Here are the top co-authors by number of shared publications:
- Dominic Orchard
University of Cambridge, Cambridge, United Kingdom
3 shared publications - Jack Atkinson
Institute of Computing for Climate Science, University of Cambridge, UK
3 shared publications Athena Elafrou
NVIDIA, UK
2 shared publicationsThomas Meltzer
2 shared publications- Chris Edsall
Institute of Computing for Climate Science, University of Cambridge, UK
1 shared publication - Joseph Gregory Wallwork
Institute of Computing for Climate Science, University of Cambridge, Cambridge, UK
1 shared publication
Latest Publications
- Open Access
- 5 March 2025
- Published by The Open Journal in Journal of Open Source Software
- Vol. 10 (107) , 7602
FTorch: a library for coupling PyTorch models to Fortran
In the last decade, machine learning (ML) and deep learning (DL) techniques have revolutionised many fields within science, industry, and beyond. Researchers across domains are increasingly seeking to combine ML with numerical modelling to advance research. This typically brings about the challenge of programming language interoperation. PyTorch (Paszke et al., 2019) is a popular framework for designing and training ML/DL models whilst Fortran remains a language of choice for many high-performance computing (HPC) scientific models. The FTorch library provides an easy-to-use, performant, cross-platform method for coupling the two, allowing users to call PyTorch models from Fortran. FTorch is open-source, open-development, and well-documented with minimal dependencies. A central tenet of its design, in contrast to other approaches, is that FTorch removes dependence on the Python runtime (and virtual environments). By building on the LibTorch backend (written in C++ and accessible via an API), it allows users to run ML models on both CPU and GPU architectures without needing to port code to device-specific languages.
- 5 March 2025
- Published by The Open Journal in Journal of Open Source Software
- Vol. 10 (107) , 7602
Open AccessFTorch: a library for coupling PyTorch models to Fortran
In the last decade, machine learning (ML) and deep learning (DL) techniques have revolutionised many fields within science, industry, and beyond. Researchers across domains are increasingly seeking to combine ML with numerical modelling to advance research. This typically brings about the challenge of programming language interoperation. PyTorch (Paszke et al., 2019) is a popular framework for designing and training ML/DL models whilst Fortran remains a language of choice for many high-performance computing (HPC) scientific models. The FTorch library provides an easy-to-use, performant, cross-platform method for coupling the two, allowing users to call PyTorch models from Fortran. FTorch is open-source, open-development, and well-documented with minimal dependencies. A central tenet of its design, in contrast to other approaches, is that FTorch removes dependence on the Python runtime (and virtual environments). By building on the LibTorch backend (written in C++ and accessible via an API), it allows users to run ML models on both CPU and GPU architectures without needing to port code to device-specific languages.
- Open Access
- 20 January 2025
- Published by Copernicus GmbH
FTorch - lowering the technical barrier of incorporating ML into Fortran models
Across geoscience, numerical models are used for understanding, experimentation, and prediction of complex systems. Many of these models are computationally intensive and involve sub-models for certain processes, often known as parameterisations. Such parameterisations may capture unresolved sub-grid processes, such as turbulence, or represent fast-moving dynamics, such as gravity waves, or provide a combination of the two, such as microphysics schemes.Recently there has been significant interest in incorporating machine learning (ML) methodsinto these parameterisations. Two of the main drivers are the emulation of computationally intensive processes, thereby reducing computational resources required, and the development of data-driven parameterisation schemes that could improve accuracy through capturing ‘additional physics’.Integrating ML sub-models in the context of numerical modelling brings a number of challenges, some of which are scientific, others computational. For example, many numerical models are written in Fortran, whilst the majority of machine learning is conducted using Python-based frameworks such as PyTorch that provide advanced ML modelling capabilities. As such there is a need to leverage ML models developed externally to Fortran, rather than the error-prone approach of writing neural networks directly in Fortran, missing the benefits of highly-developed libraries.Interoperation of the two languages requires care, and increases the burden on researchers and developers. To reduce these barriers we have developed the open-source FTorch library [1] for coupling PyTorch models to Fortran. The library is designed to streamline the development process, offering a Fortran interface mimicking the style of the Python library whilst abstracting away the complex details of interoperability to provide a computationally efficient interface.A significant benefit of this approach is that it enables inference to be performed on either CPU or GPU, enabling deployment on a variety of architectures with low programmer effort. We will report on the performance characteristics of our approach, both in the CPU and GPU settings and include a comparison with alternative approaches.This approach has been deployed on two relevant case studies in the geoscience context: a gravity-wave parameterisation in an intermediate complexity atmospheric model (MiMA) based on Espinosa et al. [2], and a convection parameterisation in a GCM (CAM/CESM) based on Yuval et al. [3]. We will report on these applications and lessons learned from their development. [1] FTorch https://github.com/Cambridge-ICCS/FTorch[2] Espinosa et al., Machine Learning Gravity Wave Parameterization Generalizes to Capture the QBO and Response to Increased CO2, GRL 2022 https://doi.org/10.1029/2022GL098174[3] Yuval et al., Use of Neural Networks for Stable, Accurate and Physically Consistent Parameterization of Subgrid Atmospheric Processes With Good Performance at Reduced Precision, GRL 2021 https://doi.org/10.1029/2020GL091363
- 20 January 2025
- Published by Copernicus GmbH
Open AccessFTorch - lowering the technical barrier of incorporating ML into Fortran models
Across geoscience, numerical models are used for understanding, experimentation, and prediction of complex systems. Many of these models are computationally intensive and involve sub-models for certain processes, often known as parameterisations. Such parameterisations may capture unresolved sub-grid processes, such as turbulence, or represent fast-moving dynamics, such as gravity waves, or provide a combination of the two, such as microphysics schemes.Recently there has been significant interest in incorporating machine learning (ML) methodsinto these parameterisations. Two of the main drivers are the emulation of computationally intensive processes, thereby reducing computational resources required, and the development of data-driven parameterisation schemes that could improve accuracy through capturing ‘additional physics’.Integrating ML sub-models in the context of numerical modelling brings a number of challenges, some of which are scientific, others computational. For example, many numerical models are written in Fortran, whilst the majority of machine learning is conducted using Python-based frameworks such as PyTorch that provide advanced ML modelling capabilities. As such there is a need to leverage ML models developed externally to Fortran, rather than the error-prone approach of writing neural networks directly in Fortran, missing the benefits of highly-developed libraries.Interoperation of the two languages requires care, and increases the burden on researchers and developers. To reduce these barriers we have developed the open-source FTorch library [1] for coupling PyTorch models to Fortran. The library is designed to streamline the development process, offering a Fortran interface mimicking the style of the Python library whilst abstracting away the complex details of interoperability to provide a computationally efficient interface.A significant benefit of this approach is that it enables inference to be performed on either CPU or GPU, enabling deployment on a variety of architectures with low programmer effort. We will report on the performance characteristics of our approach, both in the CPU and GPU settings and include a comparison with alternative approaches.This approach has been deployed on two relevant case studies in the geoscience context: a gravity-wave parameterisation in an intermediate complexity atmospheric model (MiMA) based on Espinosa et al. [2], and a convection parameterisation in a GCM (CAM/CESM) based on Yuval et al. [3]. We will report on these applications and lessons learned from their development. [1] FTorch https://github.com/Cambridge-ICCS/FTorch[2] Espinosa et al., Machine Learning Gravity Wave Parameterization Generalizes to Capture the QBO and Response to Increased CO2, GRL 2022 https://doi.org/10.1029/2022GL098174[3] Yuval et al., Use of Neural Networks for Stable, Accurate and Physically Consistent Parameterization of Subgrid Atmospheric Processes With Good Performance at Reduced Precision, GRL 2021 https://doi.org/10.1029/2020GL091363
- Open Access
- 20 January 2025
- Published by Copernicus GmbH
Tools and techniques for modular, portable (Machine Learning) parameterisations
Numerical models across the geophysical sciences make extensive use of physical parameterisations to represent sub-grid processes such as eddies, convection, gravity waves, and microphysics. With the advent of machine learning (ML), big data, and artificial intelligence there are increasing efforts to develop data-driven parameterisation schemes or emulate existing, but computationally-intensive, parameterisations using ML techniques.Despite their name, the irony is that traditional design approaches often lead to parameterisations which are not themselves parameters, but rather tightly integrated, enmeshed pieces of code in a larger model. Such parameterisations and practices pose a threat to the reproducibility, accuracy, ease-of-(re)-use, and general FAIRness (Findable, Accessible, Interoperable, Reusable) [1] of the schemes being developed.In contrast, a modular approach to parameterisations (and their receivers, e.g., GCMs), would enable them to be more easily (1) interchangeable and Interoperable, to compare different schemes and assess uncertainty due to their inherent approximate behaviour, and (2) portable and Reusable, between models, to reduce engineering effort, and (3) understandable and Accessible, by being clear about dependencies and the physical meaning of program variables, and (4) testable, to aid verification and correctness testing. Achieving this goal in the context of numerical modelling brings a number of scientific, engineering, and computational challenges. In this talk we aim to set out some best-practice principles for achieving modular parameterisation design for geoscience modellers. We then focus on the particular challenges around modem ML parameterisations. To this end we have developed a library for easily interoperating ML-based parameterisations in PyTorch with Fortran-based numerical models, called FTorch [2]. By reducing the Fortran-PyTorch Interoperability burden on researchers this framework should reduce errors that arise and increase the speed of development when compared to other approaches such as re-coding models in Fortran. FTorch aims to make emerging ML parameterisation research more Accessible to those who may not have deep expertise of ML, Fortran, and/or computer science. It also means that models developed using PyTorch can leverage its feature-rich libraries and be shared in their native format, maximising Reusability. We discuss the design principles behind FTorch in the context of modular parameterisations and demonstrate our principles and approach by coupling ML parameterisations to atmospheric and climate models.In general, we present a number of considerations that could be used to make all parameterisation schemes more easily Interoperable and Re-useable by their developers. [1] Barker, M. et al, Introducing the FAIR Principles for research software, Sci Data 9, 622 (2022) https://doi.org/10.1038/s41597-022-01710-x[2] FTorch https://github.com/Cambridge-ICCS/FTorch
- 20 January 2025
- Published by Copernicus GmbH
Open AccessTools and techniques for modular, portable (Machine Learning) parameterisations
Numerical models across the geophysical sciences make extensive use of physical parameterisations to represent sub-grid processes such as eddies, convection, gravity waves, and microphysics. With the advent of machine learning (ML), big data, and artificial intelligence there are increasing efforts to develop data-driven parameterisation schemes or emulate existing, but computationally-intensive, parameterisations using ML techniques.Despite their name, the irony is that traditional design approaches often lead to parameterisations which are not themselves parameters, but rather tightly integrated, enmeshed pieces of code in a larger model. Such parameterisations and practices pose a threat to the reproducibility, accuracy, ease-of-(re)-use, and general FAIRness (Findable, Accessible, Interoperable, Reusable) [1] of the schemes being developed.In contrast, a modular approach to parameterisations (and their receivers, e.g., GCMs), would enable them to be more easily (1) interchangeable and Interoperable, to compare different schemes and assess uncertainty due to their inherent approximate behaviour, and (2) portable and Reusable, between models, to reduce engineering effort, and (3) understandable and Accessible, by being clear about dependencies and the physical meaning of program variables, and (4) testable, to aid verification and correctness testing. Achieving this goal in the context of numerical modelling brings a number of scientific, engineering, and computational challenges. In this talk we aim to set out some best-practice principles for achieving modular parameterisation design for geoscience modellers. We then focus on the particular challenges around modem ML parameterisations. To this end we have developed a library for easily interoperating ML-based parameterisations in PyTorch with Fortran-based numerical models, called FTorch [2]. By reducing the Fortran-PyTorch Interoperability burden on researchers this framework should reduce errors that arise and increase the speed of development when compared to other approaches such as re-coding models in Fortran. FTorch aims to make emerging ML parameterisation research more Accessible to those who may not have deep expertise of ML, Fortran, and/or computer science. It also means that models developed using PyTorch can leverage its feature-rich libraries and be shared in their native format, maximising Reusability. We discuss the design principles behind FTorch in the context of modular parameterisations and demonstrate our principles and approach by coupling ML parameterisations to atmospheric and climate models.In general, we present a number of considerations that could be used to make all parameterisation schemes more easily Interoperable and Re-useable by their developers. [1] Barker, M. et al, Introducing the FAIR Principles for research software, Sci Data 9, 622 (2022) https://doi.org/10.1038/s41597-022-01710-x[2] FTorch https://github.com/Cambridge-ICCS/FTorch