From 1558881cfc1caf417250ef1cd075957b3fd10f52 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Thu, 7 Nov 2024 08:57:22 -0800 Subject: [PATCH 1/3] chore: rm setup.sh Since the programs that necessitated the automatic generation of a script for running fpm were moved to the demo/ subdirectory, retaining the setup.sh script obscures the fact that we can now support the building, testing, and running of progtrams by entering uncomplicated fpm commands such as `fpm test`. This commit therefore removes the script. --- setup.sh | 96 -------------------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100755 setup.sh diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 455007afa..000000000 --- a/setup.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/sh - -set -e # exit on error - -usage() -{ - echo "Fiats Setup Script" - echo "" - echo "USAGE:" - echo "./setup.sh [--help|-h]" - echo "" - echo " --help Display this help text" - echo " --prefix=PREFIX Install any binaries needed to build fiats in 'PREFIX/bin'" - echo " Default prefix='\$HOME/.local/bin'" - echo "" -} - -PREFIX="$HOME/.local" - -while [ "$1" != "" ]; do - PARAM=$(echo "$1" | awk -F= '{print $1}') - VALUE=$(echo "$1" | awk -F= '{print $2}') - case $PARAM in - -h | --help) - usage - exit - ;; - -p | --prefix) - PREFIX=$VALUE - ;; - *) - echo "ERROR: unknown parameter \"$PARAM\"" - usage - exit 1 - ;; - esac - shift -done - -set -u # error on use of undefined variable - -install_fpm_from_source() -{ - echo "Installing fpm in following location: $PREFIX/bin" - echo "Ensure $PREFIX/bin is in your path or rerun script with the --prefix=PREFIX flag" - if ! command -v curl > /dev/null ; then - echo "This script uses curl to download source file for fpm to install it" - echo "Please install curl and then rerun ./setup.sh" - exit 1 - fi - mkdir temp-dir-to-build-fpm-for-fiats-installation - curl -L -o temp-dir-to-build-fpm-for-fiats-installation/fpm.F90 https://github.com/fortran-lang/fpm/releases/download/current/fpm.F90 - gfortran -o $PREFIX/bin/fpm -Jtemp-dir-to-build-fpm-for-fiats-installation temp-dir-to-build-fpm-for-fiats-installation/fpm.F90 - rm -rf temp-dir-to-build-fpm-for-fiats-installation - if command -v fpm > /dev/null ; then - echo "fpm installed" - else - echo "Some error has occured while trying to install fpm. Please install fpm, ensure it is in your path, and rerun script" - fi -} - -# if no fpm, install either through homebrew or by compiling fpm.F90 with gfortran -if ! command -v fpm > /dev/null ; then - if ! command -v brew > /dev/null ; then - if ! command -v gfortran > /dev/null ; then - echo "Please install fpm, ensure it is in your path, and rerun script" - exit 1 - else # has gfortran, but not homebrew - install_fpm_from_source - fi - else # has homebrew - brew tap fortran-lang/fortran - brew install fortran-lang/fortran/fpm - fi -fi - -FPM_FC=${FC:-"gfortran-14"} -FPM_CC=${CC:-"gcc-14"} - -fpm test --profile release --flag "-fopenmp" - -echo "" -echo "____________________ Fiats has been set up! _______________________" -echo "" -echo "Enter the command below to the see names of example use cases that you can run:" -echo "" -echo "fpm run --example" -echo "" -echo "To run an example, execute the following command after replacing with" -echo "one of the names listed by the above command:" -echo "" -echo "fpm run --profile release --flag \"-fopenmp\" --example " -echo "" -echo "where the '--profile release' and '--flag \"-fopenmp\"' might reduce run times." -echo "Example programs print usage information if additional arguments are required." -echo "" From dc5215603bc47604f68794242e8fefb999d42f4f Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Thu, 7 Nov 2024 09:12:25 -0800 Subject: [PATCH 2/3] build(script): update program/directory names --- scripts/create-single-source-file-programs.sh | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/scripts/create-single-source-file-programs.sh b/scripts/create-single-source-file-programs.sh index 50fb3c581..6fefbdd5e 100755 --- a/scripts/create-single-source-file-programs.sh +++ b/scripts/create-single-source-file-programs.sh @@ -2,8 +2,7 @@ # Copyright (c), The Regents of the University of California # Terms of use are as specified in LICENSE.txt # ---- -# This script concatenates the Inference-Engine software stack into -# single-source-file programs. +# This script concatenates the Fiats software stack into single-source-file programs. echo "" echo "---------------------- create-single-source-file.sh ----------------------------" @@ -12,7 +11,7 @@ if [ ! -d ../build/dependencies/assert ] || [ ! -d ../build/dependencies/julienn echo "" echo "Dependencies assert and julienne were not found in ../build/dependencies." echo "Running fpm build to download the dependencies." - echo "This unavoidably builds inference-engine too." + echo "This unavoidably builds fiats too." echo "" echo "" fpm build @@ -25,7 +24,7 @@ else exit 1 fi -echo "Concatenating assert, julienne, and inference-engine." +echo "Concatenating Assert, Julienne, and Fiats." cat \ ../build/dependencies/assert/src/assert/characterizable_m.f90 \ ../build/dependencies/assert/src/assert/intrinsic_array_m.F90 \ @@ -60,45 +59,45 @@ cat \ >> single-file.F90 cat \ - ../src/inference_engine/kind_parameters_m.f90 \ - ../src/inference_engine/activation_strategy_m.f90 \ - ../src/inference_engine/differentiable_activation_strategy_m.f90 \ - ../src/inference_engine/gelu_m.f90 \ - ../src/inference_engine/relu_m.f90 \ - ../src/inference_engine/sigmoid_m.f90 \ - ../src/inference_engine/step_m.f90 \ - ../src/inference_engine/swish_m.f90 \ - ../src/inference_engine/hyperparameters_m.f90 \ - ../src/inference_engine/network_configuration_m.f90 \ - ../src/inference_engine/training_configuration_m.f90 \ - ../src/inference_engine/neuron_m.f90 \ - ../src/inference_engine/metadata_m.f90 \ - ../src/inference_engine/tensor_m.f90 \ - ../src/inference_engine/input_output_pair_m.f90 \ - ../src/inference_engine/mini_batch_m.f90 \ - ../src/inference_engine/tensor_range_m.f90 \ - ../src/inference_engine/ubounds_m.f90 \ - ../src/inference_engine/inference_engine_m_.f90 \ - ../src/inference_engine/layer_m.f90 \ - ../src/inference_engine/trainable_engine_m.F90 \ - ../src/inference_engine_m.f90 \ - ../src/inference_engine/gelu_s.f90 \ - ../src/inference_engine/relu_s.f90 \ - ../src/inference_engine/step_s.f90 \ - ../src/inference_engine/sigmoid_s.f90 \ - ../src/inference_engine/swish_s.f90 \ - ../src/inference_engine/training_configuration_s.F90 \ - ../src/inference_engine/network_configuration_s.F90 \ - ../src/inference_engine/hyperparameters_s.f90 \ - ../src/inference_engine/input_output_pair_s.f90 \ - ../src/inference_engine/neuron_s.f90 \ - ../src/inference_engine/layer_s.f90 \ - ../src/inference_engine/metadata_s.f90 \ - ../src/inference_engine/mini_batch_s.f90 \ - ../src/inference_engine/tensor_s.f90 \ - ../src/inference_engine/tensor_range_s.f90 \ - ../src/inference_engine/inference_engine_s.F90 \ - ../src/inference_engine/trainable_engine_s.F90 \ + ../src/fiats/kind_parameters_m.f90 \ + ../src/fiats/activation_strategy_m.f90 \ + ../src/fiats/differentiable_activation_strategy_m.f90 \ + ../src/fiats/gelu_m.f90 \ + ../src/fiats/relu_m.f90 \ + ../src/fiats/sigmoid_m.f90 \ + ../src/fiats/step_m.f90 \ + ../src/fiats/swish_m.f90 \ + ../src/fiats/hyperparameters_m.f90 \ + ../src/fiats/network_configuration_m.f90 \ + ../src/fiats/training_configuration_m.f90 \ + ../src/fiats/neuron_m.f90 \ + ../src/fiats/metadata_m.f90 \ + ../src/fiats/tensor_m.f90 \ + ../src/fiats/input_output_pair_m.f90 \ + ../src/fiats/mini_batch_m.f90 \ + ../src/fiats/tensor_range_m.f90 \ + ../src/fiats/ubounds_m.f90 \ + ../src/fiats/fiats_m_.f90 \ + ../src/fiats/layer_m.f90 \ + ../src/fiats/trainable_engine_m.F90 \ + ../src/fiats_m.f90 \ + ../src/fiats/gelu_s.f90 \ + ../src/fiats/relu_s.f90 \ + ../src/fiats/step_s.f90 \ + ../src/fiats/sigmoid_s.f90 \ + ../src/fiats/swish_s.f90 \ + ../src/fiats/training_configuration_s.F90 \ + ../src/fiats/network_configuration_s.F90 \ + ../src/fiats/hyperparameters_s.f90 \ + ../src/fiats/input_output_pair_s.f90 \ + ../src/fiats/neuron_s.f90 \ + ../src/fiats/layer_s.f90 \ + ../src/fiats/metadata_s.f90 \ + ../src/fiats/mini_batch_s.f90 \ + ../src/fiats/tensor_s.f90 \ + ../src/fiats/tensor_range_s.f90 \ + ../src/fiats/fiats_s.F90 \ + ../src/fiats/trainable_engine_s.F90 \ >> single-file.F90 echo "Creating concurrent-inferences.F90" From a4a63d0aad8e33e9676be05e790c5f573b33604d Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Thu, 7 Nov 2024 23:15:04 -0800 Subject: [PATCH 3/3] chore(script):update single-file program generator --- scripts/create-single-source-file-programs.sh | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/scripts/create-single-source-file-programs.sh b/scripts/create-single-source-file-programs.sh index 6fefbdd5e..69d41afb1 100755 --- a/scripts/create-single-source-file-programs.sh +++ b/scripts/create-single-source-file-programs.sh @@ -35,6 +35,7 @@ cat \ > single-file.F90 cat \ + ../build/dependencies/julienne/src/julienne/julienne_github_ci_m.f90 \ ../build/dependencies/julienne/src/julienne/julienne_bin_m.f90 \ ../build/dependencies/julienne/src/julienne/julienne_command_line_m.f90 \ ../build/dependencies/julienne/src/julienne/julienne_formats_m.F90 \ @@ -55,49 +56,47 @@ cat \ ../build/dependencies/julienne/src/julienne/julienne_test_description_s.f90 \ ../build/dependencies/julienne/src/julienne/julienne_test_s.F90 \ ../build/dependencies/julienne/src/julienne/julienne_vector_test_description_s.f90 \ + ../build/dependencies/julienne/src/julienne/julienne_github_ci_s.f90 \ ../build/dependencies/julienne/src/julienne_m.f90 \ >> single-file.F90 cat \ ../src/fiats/kind_parameters_m.f90 \ - ../src/fiats/activation_strategy_m.f90 \ - ../src/fiats/differentiable_activation_strategy_m.f90 \ - ../src/fiats/gelu_m.f90 \ - ../src/fiats/relu_m.f90 \ - ../src/fiats/sigmoid_m.f90 \ - ../src/fiats/step_m.f90 \ - ../src/fiats/swish_m.f90 \ + ../src/fiats/double_precision_file_m.f90 \ + ../src/fiats/double_precision_string_m.f90 \ + ../src/fiats/activation_m.f90 \ ../src/fiats/hyperparameters_m.f90 \ ../src/fiats/network_configuration_m.f90 \ ../src/fiats/training_configuration_m.f90 \ ../src/fiats/neuron_m.f90 \ + ../src/fiats/neural_network_m.f90 \ ../src/fiats/metadata_m.f90 \ ../src/fiats/tensor_m.f90 \ + ../src/fiats/tensor_names_m.f90 \ ../src/fiats/input_output_pair_m.f90 \ ../src/fiats/mini_batch_m.f90 \ - ../src/fiats/tensor_range_m.f90 \ - ../src/fiats/ubounds_m.f90 \ - ../src/fiats/fiats_m_.f90 \ + ../src/fiats/tensor_map_m.f90 \ ../src/fiats/layer_m.f90 \ - ../src/fiats/trainable_engine_m.F90 \ + ../src/fiats/trainable_network_m.F90 \ ../src/fiats_m.f90 \ - ../src/fiats/gelu_s.f90 \ - ../src/fiats/relu_s.f90 \ - ../src/fiats/step_s.f90 \ - ../src/fiats/sigmoid_s.f90 \ - ../src/fiats/swish_s.f90 \ + ../src/fiats/double_precision_file_s.f90 \ + ../src/fiats/double_precision_string_s.f90 \ ../src/fiats/training_configuration_s.F90 \ + ../src/fiats/activation_s.f90 \ + ../src/fiats/unmapped_network_s.f90 \ + ../src/fiats/workspace_s.f90 \ ../src/fiats/network_configuration_s.F90 \ ../src/fiats/hyperparameters_s.f90 \ ../src/fiats/input_output_pair_s.f90 \ ../src/fiats/neuron_s.f90 \ + ../src/fiats/neural_network_s.F90 \ ../src/fiats/layer_s.f90 \ ../src/fiats/metadata_s.f90 \ ../src/fiats/mini_batch_s.f90 \ ../src/fiats/tensor_s.f90 \ - ../src/fiats/tensor_range_s.f90 \ - ../src/fiats/fiats_s.F90 \ - ../src/fiats/trainable_engine_s.F90 \ + ../src/fiats/tensor_map_s.f90 \ + ../src/fiats/tensor_names_s.f90 \ + ../src/fiats/trainable_network_s.F90 \ >> single-file.F90 echo "Creating concurrent-inferences.F90"