Skip to content

AnsibleBat/decentralized-gpu-ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decentralized GPU-ML

A decentralized GPU-sharing system for machine learning workloads that enables peer-to-peer resource sharing, secure execution, and incentive mechanisms for GPU providers.

Overview

This project creates a network of nodes that can share GPU resources for machine learning tasks. Users can submit ML tasks to the network, and GPU providers earn rewards for executing these tasks. The system uses a decentralized architecture to ensure fairness, security, and efficiency.

Tech Stack

  • Rust (v2021) - Core programming language
  • libp2p (v0.55.0) - Peer-to-peer networking framework
    • TCP transport
    • Noise protocol for encryption
    • Kademlia DHT for peer discovery
    • YAMUX for stream multiplexing
  • Tokio (v1.44.2) - Asynchronous runtime
  • Serde (v1.0.219) - Serialization/deserialization
  • TOML (v0.8) - Configuration format
  • PyO3 (v0.24.1, optional) - Python integration for ML workloads
  • Bollard (v0.18.1, optional) - Docker API for containerized execution
  • Wasmtime (v31.0.0, optional) - WebAssembly sandbox for secure execution
  • Tracing (v0.1) - Logging and diagnostics

Key Features

  • P2P Resource Discovery - Find available GPU resources across the network
  • Smart Task Scheduling - Match ML tasks to optimal GPU providers
  • Economic Incentives - Reward system for GPU providers based on contribution
  • Secure Execution - Sandboxed environments for ML tasks
  • Distributed Ledger - Track resource contributions and payments
  • Multiple Execution Backends:
    • Native (Python)
    • Containerized (Docker)
    • WebAssembly (for lightweight tasks)

Project Structure

decentralized-gpu-ml/
├── config/               # Configuration files
├── src/
│   ├── bin/              # Binary executables
│   │   ├── node.rs       # Node implementation
│   │   └── cli.rs        # Command-line interface
│   ├── network/          # P2P networking
│   │   ├── p2p.rs        # libp2p implementation
│   │   ├── discovery.rs  # Peer discovery
│   │   ├── ledger.rs     # Network ledger
│   │   └── rewards.rs    # Network rewards
│   ├── scheduler/        # Task scheduling
│   │   ├── dispatcher.rs # Task dispatcher
│   │   └── task.rs       # Task management
│   ├── ml/               # Machine learning
│   │   ├── executor.rs   # ML task execution
│   │   ├── ledger.rs     # ML ledger
│   │   └── rewards.rs    # ML rewards
│   ├── incentives/       # Economic incentives
│   │   ├── node.rs       # Node incentives
│   │   ├── task.rs       # Task incentives
│   │   └── transaction.rs # Transactions
│   ├── models/           # Data models
│   └── utils/            # Utilities
│       ├── config.rs     # Configuration
│       └── logging.rs    # Logging
└── examples/             # Example implementations

Getting Started

Prerequisites

  • Rust (latest stable)
  • GPU with CUDA support (for GPU providers)
  • Docker (optional, for containerized execution)

Installation

  1. Clone the repository:

    git clone https://github.com/onchana01/decentralized-gpu-ml.git
    cd decentralized-gpu-ml
    
  2. Build the project:

    cargo build --release
    
  3. Enable optional features:

    # For Python ML integration
    cargo build --release --features ml-python
    
    # For Docker container support
    cargo build --release --features ml-docker
    
    # For WebAssembly sandbox
    cargo build --release --features sandbox-wasm
    

Usage

Running a Node

To start a node with the default configuration:

cargo run --bin node

Or with a custom configuration:

cargo run --bin node -- --config /path/to/config.toml

Using the CLI

The CLI allows interaction with the network:

# Submit a new ML task
cargo run --bin cli -- submit --model resnet50 --data /path/to/data

# Query available GPU resources
cargo run --bin cli -- list-resources

# Check task status
cargo run --bin cli -- status --task-id <task_id>

Configuration

The system uses TOML files for configuration:

  • config/node.toml - Node configuration
  • config/network.toml - Network configuration

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For Docker container support

cargo run --bin node --features ml-docker

For WebAssembly sandbox

cargo run --bin node --features sandbox-wasm

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published