Skip to content
On-device Training (TYPE3)

On-device Training (TYPE3)

In this mode, the target run an on device training experiment and extrat some key metrics. The target get as input a model, a test dataset, a train dataset and some parameters for the on device trainging. All these parameters are sotred in a .json file. The variable $ODT_CONFIG_FILENAME contain the name of this file.

Usefull environment variables

The following environment variables are provided to the docker container running the target scripts. These are the only variables that are usefull for the implementation of the TYPE3 benchmarking service.

Variable name Description
$TARGET The target name
$RUNTIME The runtime name
$BENCHMARK_TYPE TYPE3
$MODEL_FILENAME Provide the file name of the model provided by the user. Note that a timestamp is added to it automatically to ensure uniqueness.
$ODT_CONFIG_FILENAME Provide the file name of the on device training configuration file.

Pipeline simulation

You can simulate the pipeline locally by running the scripts in the correct order. This can be useful to test your implementation before pushing it to the repository and running it on the dAIEdge-VLab.

export FUNCTIONS_PATH=`pwd`/exit_functions.sh
export LOG_PATH=`pwd`

export TARGET="jetsonorinnano_ort"
export RUNTIME="ORT"
export NB_INFERENCE=20
export BENCHMARK_TYPE="TYPE3"
export MODEL_FILENAME="mnist-12.onnx"
export DATASET_FILENAME="dataset_mnist.bin"
export ODT_CONFIG_FILENAME="config.json"
export FUNCTIONS_PATH=`pwd`
export LOG_PATH=`pwd`
export WORKSPACE_PATH=`pwd`

# This emulates the variable passed to the container from the target.json ENV filed.
# https://vlab.daiedge.eu/doc/dev/v4/target_dot_json/
#
# Modify their value accordning to your experiment

export BOARD_USER="jetsonorinnano"
export BOARD_IP="192.168.2.20"
export BOARD_PASSWORD="1234"

# This emulates what the execution of the "pipeline" inside your container.
# https://vlab.daiedge.eu/doc/dev/v4/pipeline/

mkdir $LOG_PATH
touch $LOG_PATH/error.log
touch $LOG_PATH/user.log

exit_if_error_log_filled() {
    if [ -s "$LOG_PATH/error.log" ]; then
        echo "Errors detected in error.log. Exiting."
        exit 1
    fi
}

./AI_Support/support.sh;
exit_if_error_log_filled

./AI_Build/build.sh;
exit_if_error_log_filled

./AI_Deploy/deploy.sh;
exit_if_error_log_filled

./AI_Manager/manager.sh;
exit_if_error_log_filled

Generated artifacts

The following artifacts are generated by the dAIEdge-VLab after the execution of the pipeline:

  • Benchmark report : report.json (odt version)
  • Log files : user.log & error.log
  • New Model : trained_model.extension (the extension depends on the format of the model used for training, e.g., .onnx, .pt, etc.)