Skip to content

Nerlnet is a framework for research and development of distributed machine learning models on IoT

License

Notifications You must be signed in to change notification settings

leondavi/NErlNet

This branch is 2 commits ahead of, 437 commits behind master.

Folders and files

NameName
Last commit message
Last commit date
Mar 21, 2024
Feb 16, 2024
May 27, 2023
Mar 25, 2024
Apr 2, 2024
Mar 27, 2024
Mar 28, 2024
Apr 2, 2024
Mar 22, 2024
Nov 14, 2023
Mar 1, 2024
Mar 1, 2024
Sep 8, 2023
Jul 5, 2023
Mar 7, 2024
Sep 12, 2023
Jun 14, 2023
Mar 7, 2024
Apr 23, 2023
Jan 10, 2024
Nov 21, 2023
Sep 12, 2023
Feb 16, 2024
Mar 12, 2024

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.

Introducing Nerlnet

720p_Nerlnet.Intro.mp4

Nerlnet Architecture:

Nerlnet Architecture

Build and Run Nerlnet:

Recommended cmake version 3.26
Minimum erlang version otp 25
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
  6. Run ./NerlnetRun.sh to start Nerlnet.
  7. Use API-Server to load generated jsons (step 4) and execute Nerlnet experiment.

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

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

Gratitudes

Microsoft

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).