Skip to main content
QUICK REVIEW

[Paper Review] Hybrid Fortran: High Productivity GPU Porting Framework Applied to Japanese Weather Prediction Model

Michel Müller, Takayuki Aoki|arXiv (Cornell University)|Oct 24, 2017
Distributed and Parallel Computing SystemsComputer Science4 citations
TL;DR

This paper proposes Hybrid Fortran, a high-productivity GPU porting framework that combines directive-based programming with stencil domain-specific language (DSL) abstractions to enable efficient, low-overhead GPU offloading of structured grid Fortran codes. By abstracting memory layout and supporting multiple parallelization granularities, it reduces code changes by over 85% compared to OpenACC, achieving up to 4.9× speedup on a single GPU and replacing 50+ CPU sockets with 24 Tesla P100 GPUs in a real-world weather model (ASUCA).

ABSTRACT

In this work we use the GPU porting task for the operative Japanese weather prediction model "ASUCA" as an opportunity to examine productivity issues with OpenACC when applied to structured grid problems. We then propose "Hybrid Fortran", an approach that combines the advantages of directive based methods (no rewrite of existing code necessary) with that of stencil DSLs (memory layout is abstracted). This gives the ability to define multiple parallelizations with different granularities in the same code. Without compromising on performance, this approach enables a major reduction in the code changes required to achieve a hybrid GPU/CPU parallelization - as demonstrated with our ASUCA implementation using Hybrid Fortran.

Motivation & Objective

  • Address the productivity gap in GPU porting of legacy structured grid Fortran codes in atmospheric science.
  • Overcome the limitations of OpenACC in managing memory layout and coarse-grained parallelization for stencil-based weather models.
  • Enable efficient GPU offloading without rewriting core computational kernels, preserving code reuse and maintainability.
  • Support multiple parallelization granularities and abstract memory layout at compile-time to improve performance and portability.
  • Demonstrate the framework’s effectiveness on a production-grade weather prediction model (ASUCA) with real-world performance and scalability.

Proposed method

  • Introduce Hybrid Fortran as a domain-specific language (DSL) layer on top of Fortran, combining OpenACC-style directives with stencil-specific abstractions.
  • Abstract memory layout through compile-time data layout transformations, reordering arrays to match target GPU memory access patterns.
  • Support multiple parallelization granularities via explicit @parallelRegion and @domainDependent directives, enabling fine-grained and coarse-grained parallelism in the same codebase.
  • Use storage order macros and DSL constructs to decouple user code from low-level memory layout decisions, reducing manual optimization burden.
  • Leverage existing CPU code with minimal modifications, reusing over 95% of the original ASUCA codebase.
  • Apply automatic code transformations to map CPU-centric loops and data structures to efficient GPU kernels with optimized memory access.

Experimental results

Research questions

  • RQ1Can directive-based GPU programming (e.g., OpenACC) be made sufficiently productive for large-scale, legacy structured grid weather models with complex memory access patterns?
  • RQ2To what extent can memory layout abstraction reduce the need for low-level code refactoring during GPU porting?
  • RQ3How can multiple parallelization granularities be expressed and compiled efficiently within a single Fortran codebase?
  • RQ4What is the practical code size overhead of an OpenACC-based GPU port versus a Hybrid Fortran-based approach for a real-world mesoscale weather model?
  • RQ5Can a hybrid GPU/CPU implementation be achieved with minimal performance loss and high code reuse in production weather prediction systems?

Key findings

  • Over 85% of the ASUCA codebase was reused without modification, with only 16% of the total codebase requiring changes in the Hybrid Fortran version.
  • An equivalent OpenACC-based implementation would require approximately 11,000 additional lines of code—about 28% of the reference codebase—compared to just 16% for Hybrid Fortran.
  • The Hybrid Fortran implementation achieved up to 4.9× speedup on a single Tesla P100 GPU compared to a single 18-core Intel Xeon CPU socket.
  • On a full-scale production run (1581 × 1301 × 58 grid), 24 Tesla P100 GPUs replaced more than 50 18-core Broadwell Xeon CPU sockets, demonstrating significant hardware efficiency.
  • The framework reduced mechanical code changes such as storage order macros and code duplication for multiple parallelizations, which in OpenACC would have required over 13,000 lines of additional code.
  • The library of sample applications confirms the general applicability of Hybrid Fortran to data-parallel Fortran workloads beyond the ASUCA case study.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.