Skip to main content

A role-oriented programming model for distributed ML

Project description

RoleML

A programming model for edge distributed ML

PyPI Version PyPI Downloads GitHub License Last Commit Python Version


Edge AI aims to enable distributed machine learning (DML) on edge resources to fulfill the need for data privacy and low latency. Meanwhile, the challenge of device heterogeneity and discrepancy in data distribution requires more sophisticated DML architectures that differ in topology and communication strategy. This calls for a standardized and general programming interface and framework that provides support for easy development and testing of various DML architectures. Existing frameworks like FedML are designed for specific architectures (e.g. Federated Learning) and do not support users to customize new architectures on them.

RoleML is introduced as a novel, general-purpose role-oriented programming model for the development of DML architectures. RoleML breaks a DML architecture into a series of interactive components and represents them with a unified abstraction named role. Each role defines its behavior with three types of message channels, and uses elements to specify the workloads in a modular manner and decouple them from the distributed training workflow. Powered by a runtime system, RoleML allows developers to flexibly and dynamically assign roles to different computation nodes, simplifying the implementation of complex architectures. We further provide an automatic role offloading mechanism based on containerization to enhance the reliability of DML applications.

Installation

You can install RoleML via pip:

pip install roleml-ai[starter]

The [starter] extra is recommended for beginners. This will include dependencies for the gRPC communication backend, as well as a profiling tool viztracer for performance analysis.

Other extras available include:

  • grpc: support for gRPC communication backend.
  • http: support for HTTP communication backend.
  • profiling: a profiling tool named viztracer, which is required to run the bundled profiling helper scripts.
  • containerization: support for containerized mode powered by Docker (requires Python 3.11 or higher).

Alternatively, if you wish to customize the RoleML package, you can clone this repository and make an editable installation:

pip install -e path/to/roleml/source/directory[grpc]    # + dependencies for gRPC backend

The list of available extras may change. Please check pyproject.toml for any latest update.

For a minimal installation (without communication backend dependencies):

# PyPI installation
pip install roleml-ai
# editable installation
pip install -e path/to/roleml/source/directory

Other Dependencies

To run the examples in the examples directory, PyTorch is required. Please refer to its official website for installation commands.

Getting Started

  • Run a helloworld application (requires Jupyter)
  • RoleML in 100 minutes is a Jupyter notebook to help you learn RoleML while constructing a Federated Learning (FL) application.
  • Also see the built-in examples in the examples directory. Besides FL, Gossip Learning (GL), E-Tree Learning (EL), and more are included.
  • Detailed documents can be found in the docs directory.

Changelog

See CHANGELOG.md.

Cite This Project

A technical paper describing the system is published on the Middleware 2024 conference. If you find this repository useful, please cite the paper in your work:

Yuesheng Tan, Lei Yang, Wenhao Li, and Yuda Wu. 2024. RoleML: a Role-Oriented Programming Model for Customizable Distributed Machine Learning on Edges. In Proceedings of the 25th International Middleware Conference (Middleware '24). Association for Computing Machinery, New York, NY, USA, 279–291. https://doi.org/10.1145/3652892.3700765

@inproceedings {roleml,
  title = {RoleML: a Role-Oriented Programming Model for Customizable Distributed Machine Learning on Edges},
  author = {Tan, Yuesheng and Yang, Lei and Li, Wenhao and Wu, Yuda},
  year = {2024},
  isbn = {9798400706233},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  booktitle = {Proceedings of the 25th International Middleware Conference},
  pages = {279–291},
  series = {Middleware '24}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roleml_ai-0.3.1.tar.gz (135.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roleml_ai-0.3.1-py3-none-any.whl (197.0 kB view details)

Uploaded Python 3

File details

Details for the file roleml_ai-0.3.1.tar.gz.

File metadata

  • Download URL: roleml_ai-0.3.1.tar.gz
  • Upload date:
  • Size: 135.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for roleml_ai-0.3.1.tar.gz
Algorithm Hash digest
SHA256 913d50b952ee0afe42d77ba9f25b52acc36c6d817161d58639f11fe1604f77ef
MD5 bb56a302eaea7604c2fe60648bfcb45f
BLAKE2b-256 5db02e43298a748563b1a7ec95efde29d076e6545fabd9d58cc69447b2ac96c7

See more details on using hashes here.

File details

Details for the file roleml_ai-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: roleml_ai-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 197.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for roleml_ai-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 200e46c0dd8c99520f10b502793ab3fd32981044d77068b7ce3d0ebd4ce6c024
MD5 7c1a0d2dec33b85c05e01fe520ab38e2
BLAKE2b-256 4b988c8a43bd298deac37c150eeacb6240c4aa94add8dce0d5d46056d15732ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page