Skip to content

leondavi/NErlNet

Repository files navigation

NErlNet

version

Nerlnet is an open-source library for research of distributed machine learning algorithms on IoT devices that gives full insights into both edge devices that run neural network models and network performance and statistics. Nerlnet can simulate distributed ML architectures and deploy them on various IoT devices.

Nerlnet library combines the following languages to achieve a stable and efficient distributed ML system platform:
• The communication layer of Nerlnet is based on an HTTP web server library, Cowboy.
• C++ OpenNN library (based on Eigen) implements the neural network on edge compute devices.
• An API-Server based on Python Flask allows the user to control experiments and ML phases executed on a Nerlnet cluster.

image image image image

A Json script defines a distributed network layout that consists the following instances:
Edge Compute Device (ECD) which is a worker that runs a neural network model.
Sensor, generates data and send it through the network.
Router that connects ECDs, sensors and other routers.
Communication with Nerlnet is done through a simple python API that can be easily used through Jupyter notebook.
The API allows the user to collect statistics insights of a distributed machine learning network:
Messages, throughput, loss, predictions, ECD performance monitor.

References and libraries:

  • OpenNN, an open-source neural networks library for machine learning.
  • Cowboy an HTTP server for Erlang/OTP.
  • NIFPP C++11 Wrapper for Erlang NIF API.
  • Rebar3, an Erlang tool that makes it easy to create, develop, and release Erlang libraries, applications, and systems in a repeatable manner.
  • Simple Cpp Logger, simple cpp logger headers-only implementation.

Nerlnet is developed by David Leon, Dr. Yehuda Ben-Shimol, and the community of Nerlnet open-source contributors.

Nerlnet Architecture:

Nerlnet Architecture

Build and Run Nerlnet:

Recommended cmake version 3.26
Minimum erlang version otp 25 (Tested 24,25,26)
Minimum gcc/g++ version 10.3.0

On every device that is a part of Nerlnet cluster the following steps should be taken:

  1. Clone this repository with its subomdules git clone --recurse-submodules <link to this repo> NErlNet
  2. Run sudo ./NerlnetInstall.sh
    2.1 With argument -i script builds and installs Erlang, latest stable, and CMake. (validate that erlang is not installed before executing installation from source) 2.2 On successful installation, NErlNet directory is accessible
        via the following path: /usr/local/lib/nerlnet-lib
  3. Run ./NerlnetBuild.sh
  4. Test Nerlnet by running: ./tests/NerlnetFullFlowTest.sh
  5. Nerlplanner is a Nerlnet tool to generate required jsons files to setup a distributed system of Nerlnet.
    To use NerlPlanner execute ./NerlPlanner.sh (support starts from version 1.3.0).
    Create json files of distributed configurations, connection map and experiment flow as follows:
  • dc_<any name>.json
  • conn_<any name>.json
  • exp_<any name>.json
  1. Run ./NerlnetRun.sh to start Nerlnet.
  2. Start Jupyter NB with ./NerlnetJupyterLaunch.sh and follow ApiServerInstance.help() and examples.

Python API and Jupyter-lab (For Api-Server):

Minimum Python version: 3.8

  1. Open a jupyter lab environment using ./NerlnetJupyterLaunch.sh -d <experiment_direcotry>
    1.1 Use -h to see the help menu of NerlnetJupyterLaunch.sh script.
    1.2 If --no-venv option is selected then required modules can be read from src_py/requirements.txt.
  2. Read the instructions of importing Api-Server within the generated readme.md file inside <experiment_directory> folder.
  3. Follow the example: https://github.com/leondavi/NErlNet/blob/master/examples/example_run.ipynb

Visit our hugging face organization page for more datasets and models of Nerlnet.
hf-logo-with-title

Social

720p_Nerlnet.Intro.mp4

nerlnet-linkedin-page

Gratitudes

Microsoft Azure

A grant of Azure credits as part of Microsoft’s Azure credits for open source projects program (2024).

Amazon AWS

A grant of AWS credits as part of AWSOpen program for open source projects (2024).

Contact Email: leondavi@post.bgu.ac.il