BerkeleyLab / inference-engine

A deep learning library for use in high-performance computing applications in modern Fortran
Other
25 stars 6 forks source link

Support LLVM Flang #158

Closed rouson closed 3 weeks ago

rouson commented 2 months ago

Currently, the command

fpm test --compiler flang-new --flag "-mmlir -allow-assumed-rank"

yields the trailing output

[ 57%]        inference_engine_m_.f90  done.

error: Semantic errors in ././src/inference_engine/inference_engine_m_.f90
./././src/inference_engine/inference_engine_m_.f90:72:32: error: Result of pure function may not have polymorphic ALLOCATABLE ultimate component '%activation_strategy_'
        type(inference_engine_t) inference_engine
                                 ^^^^^^^^^^^^^^^^
./././src/inference_engine/inference_engine_m_.f90:30:50: Declaration of 'activation_strategy_'
      class(activation_strategy_t), allocatable :: activation_strategy_ ! Strategy Pattern facilitates elemental activation
                                                   ^^^^^^^^^^^^^^^^^^^^
./././src/inference_engine/inference_engine_m_.f90:104:24: error: Result of pure function may not have polymorphic ALLOCATABLE ultimate component '%activation_strategy_'
        type(exchange_t) exchange
                         ^^^^^^^^
./././src/inference_engine/inference_engine_m_.f90:52:50: Declaration of 'activation_strategy_'
      class(activation_strategy_t), allocatable :: activation_strategy_ ! Strategy Pattern facilitates elemental activation
                                                   ^^^^^^^^^^^^^^^^^^^^
<ERROR> Compilation failed for object " src_inference_engine_inference_engine_m_.f90.o "
<ERROR> stopping due to failed compilation
STOP 1
rouson commented 1 month ago

Update: Flang-new can now build Inference-Engine and 31 of 33 tests pass. The two failing tests involve training unit tests that don't converge. Those same failing tests pass with the GNU gfortran, Intel ifx, and NAG nagfor compilers.

rouson commented 3 weeks ago

Release 0.12.0 addresses this.