VLab Architecture
This section describes the distributed VLab architecture, its components and their interaction. The following diagram provides an overview of the architecture, it is composed of the main components:
- User : The end-user who interacts with the dAIEdge-VLab through the web interface or the API.
- Host: The host machines that are connected to the targets, run the benchmarking jobs and the different services needed to maintain the dAIEdge-VLab. One or more host machines run the API and the web interface, while others are dedicated to run the benchmarks and act as entry points for the dAIEdge-VLab.
- Target: The hardware boards that are connected to the host machines and run the actual benchmarks.
Explore the architecture
Each of these components is described in more detail on its own page :
Web interface
At the top level of its architecture, the dAIEdge-VLab provides a benchmarking solution to end-users through a web interface. Using the interface, users can run some inference benchmark using only random data. A benchmark requires that the user upload one pre-trained model, select a target, select an inference engine available for the target, and launch the benchmark accordingly. The results will display after the benchmark is done.
For a deeper understanding, we recommend familiarizing yourself with the web interface.
dAIEdge-VLab API
The main API is used by the web interface to interact with the dAIEdge-VLab. It provides the necessary endpoints to launch benchmarks, retrieve results, and manage the targets. This API provides much more functionalities than what is accessible through the web interface. It gives access to perform inference benchmark with a specific dataset, benchmark on-device training capabilities, and more.
Target and host machine
At the lower level of the architecture, hardware boards —referred to as targets— are configured to enable model benchmarking. A target must be able to run inferences for the previously uploaded model and collect some performance metrics, this could involve the installation of an inference engine such as TFLite or ONNX Runtime.
To execute the necessary scripts for running VLab benchmarking steps, a target is connected to a host machine on which the scripts are executed.
For targets that cannot support the installation of benchmarking tools natively, such as MCUs, the host gathers the metrics from the target and generates a benchmark report.
See Targets & Integration Model for the full picture of what a target is and how it is integrated.
Target repository and Docker image
The scripts for running VLab benchmarking steps are not stored directly on the host machine but reside in a separate target repository. When a benchmark is executed, this repository’s Docker image is pulled onto the host machine and run. Since the benchmarking process is the same for all targets, the target repository follows a strict folder structure, the implementation of the scripts themselves is target-dependent.
See Targets & Integration Model for a detailed walkthrough of the target repository and the Docker image.
dAIEdge-VLab Benchmarking Job
At the mid-level of the architecture, launching a benchmark with a specific configuration (model, inference engine, target) creates a Nomad batch job with the corresponding variables/tags (model, inference engine, target). This job is a general pipeline that can sequentially execute the benchmarking scripts of any target that follows the target folder structure. It resides in a docker image, but when a benchmark is launched, the job runs on the host machine of the specified target.
Check out the dAIEdge-VLab benchmark pipeline script for a better understanding.
Nomad and Docker container
All the hosts are running Nomad to create a cluster, interconnected as described in the Communication pattern page. Each target available on a given host is advertised to the rest of the cluster by the edgedevice plugin, which lets the leader of the cluster know if the resource is busy or not and schedule jobs accordingly, as detailed in the Scheduler page.
When a benchmark is triggered, the leader of the Nomad cluster will automatically select an available target that matches the constraints described in the job and schedule the benchmark job on it. Once the job is started, the base image that contains the benchmarking pipeline is used. This container then uses the Docker image specified in the target configuration file to execute the different scripts. The dAIEdge-VLab benchmarking job executes the scripts described in the target repository.
Benchmark lifecycle
Let’s have an overview of the interactions between the elements of the architecture during the benchmarking process.
- An end-user launches a benchmark from the web interface, providing a pre-trained model, an inference engine, and a target.
- The configuration and file provided by the user are sent to the dAIEdge-VLab API.
- The API creates a Nomad batch job with the provided configuration and file and submits it to the Nomad cluster.
- The Nomad leader schedules the job on an available target that matches the constraints.
- Nomad pulls the docker image with the benchmarking script execution pipeline and starts a Docker container on the host machine.
- Nomad pulls the files provided by the user from the API and stores them in the Docker container automatically.
- The Docker container pulls the target docker image and target repository (if not already in the docker image), then it runs the benchmarking scripts using the environment variables inferred by the Nomad job.
- The benchmarking scripts send the model onto the target device, benchmark it, post process the data and generate the appropriate artifacts. The artifacts.
- Then, once the benchmark is done, the artifacts are sent back to the API.
- The API stores the artifacts (on the shared DB or the Blockchain) and makes them available to the user through the web interface.