Skip to content

Commit

Permalink
Merge pull request #68 from BerkeleyLab/rm-inference-strategies
Browse files Browse the repository at this point in the history
Remove inference strategies and integrate netCDF file I/O into library & test suite
  • Loading branch information
rouson committed Jul 30, 2023
2 parents 915cf14 + bac70d0 commit efb01ea
Show file tree
Hide file tree
Showing 13 changed files with 252 additions and 342 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ Table of contents
Overview
--------

Inference-Engine is a software library for researching concurrent, large-batch inference and training of deep, feed-forward neural networks. Inference-Engine targets high-performance computing (HPC) applications with performance-critical inference and training needs. The initial target application is _in situ_ training of a cloud microphysics model proxy for the Intermediate Complexity Atmospheric Research ([ICAR]) model. Such a proxy must support concurrent inference at every grid point at every time step of an ICAR run. For validation purposes, Inference-Engine can also import neural networks exported from Python by the companion package [nexport]. The training capability is currently experimental. Current unit tests verify that Inference-Engine's network-training feature works for networks with one hidden layer. Future work will include developing unit tests that verify that the training works for deep neural networks.
Inference-Engine supports research in concurrent, large-batch inference and training of deep, feed-forward neural networks. Inference-Engine targets high-performance computing (HPC) applications with performance-critical inference and training needs. The initial target application is _in situ_ training of a cloud microphysics model proxy for the Intermediate Complexity Atmospheric Research ([ICAR]) model. Such a proxy must support concurrent inference at every grid point at every time step of an ICAR run. For validation purposes, Inference-Engine also supports the export and import of neural networks to and from Python by the companion package [nexport].

Inference-Engine's implementation language, Fortran 2018, makes it suitable for integration into high-performance computing (HPC).
The novel features of Inference-Engine include
The features of Inference-Engine that make it suitable for use in HPC applications include

1. Exposing concurrency via
- An `elemental`, polymorphic, and implicitly `pure` inference strategy,
- An `elemental`, polymorphic, and implicitly `pure` activation strategy , and
- A `pure` training subroutine.
2. Gathering network weights and biases into contiguous arrays
3. Runtime selection of inferences strategy and activation strategy.
1. Implementation in Fortran 2018.
2. Exposing concurrency via
- `Elemental`, implicitly `pure` inference procedures,
- An `elemental` and implicitly `pure` activation strategy, and
- A `pure` training subroutine,
2. Gathering network weights and biases into contiguous arrays for efficient memory access patterns, and
3. User-controlled mini-batch size facilitating `in situ` training at application runtime.

Item 1 facilitates invoking Inference-Engine's `infer` function inside Fortran's `do concurrent` constructs, which some compilers can offload automatically to graphics processing units (GPUs). We envision this being useful in applications that require large numbers of independent inferences or or multiple networks to train concurrently. Item 2 exploits the special case where the number of neurons is uniform across the network layers. The use of contiguous arrays facilitates spatial locality in memory access patterns. Item 3 offers the possibility of adaptive inference method selection based on runtime information. The current methods include ones based on intrinsic functions, `dot_product` or `matmul`. Future options will explore the use of OpenMP and OpenACC for vectorization, multithreading, and/or accelerator offloading.
Making Inference-Engine's `infer` functions and `train` subroutines `pure` facilitates invoking those procedures inside Fortran `do concurrent` constructs, which some compilers can offload automatically to graphics processing units (GPUs). The use of contiguous arrays facilitates spatial locality in memory access patterns. User control of mini-batch size facilitates in-situ training at application runtime.

Downloading, Building and Testing
---------------------------------
Expand All @@ -52,7 +52,7 @@ git clone https://github.com/berkeleylab/inference-engine
cd inference-engine
./setup.sh
```
whereupon the trailing output will provide instructions for running the examples in the [example](./example) subdirectory.
whereupon the trailing output will provide instructions for running the codes in the [example](./example) subdirectory.

Examples
--------
Expand Down
116 changes: 0 additions & 116 deletions example/netCDF_IO.f90

This file was deleted.

1 change: 0 additions & 1 deletion example/read.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ program read_json
use command_line_m, only : command_line_t
use inference_engine_m, only : inference_engine_t
use string_m, only : string_t
use matmul_m, only : matmul_t
use file_m, only : file_t
implicit none

Expand Down
39 changes: 0 additions & 39 deletions src/inference_engine/concurrent_dot_products_m.f90

This file was deleted.

52 changes: 0 additions & 52 deletions src/inference_engine/concurrent_dot_products_s.f90

This file was deleted.

37 changes: 0 additions & 37 deletions src/inference_engine/inference_strategy_m.f90

This file was deleted.

39 changes: 0 additions & 39 deletions src/inference_engine/matmul_m.f90

This file was deleted.

45 changes: 0 additions & 45 deletions src/inference_engine/matmul_s.f90

This file was deleted.

Loading

0 comments on commit efb01ea

Please sign in to comment.