Skip to main content

Client for interacting with the Impulse Labs protocol

Project description

Impulse Contracts Client

A Python client for interacting with the Impulse protocol, a decentralized computing platform for machine learning jobs.

Overview

The Impulse Contracts Client provides two main executables:

  • impulse-node: For node operators to participate in the Impulse network
  • impulse-client: For users to submit and monitor jobs on the network

Installation

Requirements

  • Python 3.11
  • An Ethereum wallet address
  • Impulse tokens
  • ETH for gas fees
  • RPC endpoint for the blockchain

Installing via pip

pip install impulse-contracts-client
export PATH=$HOME/.local/bin:$PATH  # Add Python bin to PATH

Ubuntu-specific setup

If Python 3.11 is not already installed:

sudo apt upgrade -y python3
sudo update-alternatives --config python  # (select version 3.11)
python --version  # (confirm version == 3.11)
python -m pip install impulse-contracts-client && export PATH=/home/$USER/.local/bin:$PATH

Configuration

Both clients create a $HOME/.impulse directory for storing state:

  • Node artifacts and configuration
  • Client state and job information
  • Logs and temporary files

Node Client (impulse-node)

Features

  • Interacts with smart contracts for leader election, job assignment, and incentives
  • Executes machine learning jobs upon assignment
  • Automatically manages node's stake on the node escrow (i.e. top-up)
  • Registers node to the Impulse network

Requirements

  • A whitelisted Ethereum address
  • Impulse tokens transferred to the address
  • The impulse artifacts password
  • Some ETH for gas costs
  • Compatible GPU hardware

Supported GPU Hardware

  • 1, 2, 4, or 8x NVIDIA A100 (40GB or 80GB)
  • 8x NVIDIA H100 (80GB)

Running the Node

impulse-node

User Client (impulse-client)

Features

  • Submits machine learning jobs to the Impulse network
  • Monitors job execution and retrieves results
  • Manages user's balance on the job escrow contract

Basic Usage

Top up your balance for paying for jobs:

impulse-client topup

Submitting Jobs

Example dummy job:

impulse-client create-job --args '{"shuffle": true, "use_lora": true, "use_qlora": false, "batch_size": 4, "dataset_id": "gs://imp-dev-pipeline-zen-datasets/0ca98b07-9366-4a31-8c83-569961c90294/2024-12-17_21-57-21_text2sql.jsonl", "num_epochs": 1, "job_config_name": "llm_dummy"}' --model llm_dummy --ft_type "LORA" --monitor

Example LLaMA 3.2 1B LoRA job:

impulse-client create-job --args '{"shuffle": true, "use_lora": true, "use_qlora": false, "batch_size": 4, "dataset_id": "gs://imp-dev-pipeline-zen-datasets/0ca98b07-9366-4a31-8c83-569961c90294/2024-12-17_21-57-21_text2sql.jsonl", "num_epochs": 1, "job_config_name": "llm_llama3_2_1b"}' --model llm_llama3_2_1b --ft_type "LORA"

Monitoring Jobs

Monitor all submitted jobs:

impulse-client monitor-all

Development

For development setup and contributing guidelines, see DEVEL.md.

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

impulse_contracts_client-0.3.2.tar.gz (43.8 kB view details)

Uploaded Source

Built Distribution

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

impulse_contracts_client-0.3.2-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file impulse_contracts_client-0.3.2.tar.gz.

File metadata

  • Download URL: impulse_contracts_client-0.3.2.tar.gz
  • Upload date:
  • Size: 43.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for impulse_contracts_client-0.3.2.tar.gz
Algorithm Hash digest
SHA256 16aafc982e98caa71306e187733d76bc3d6af51bfc6e0f77a12b6b6b02abc833
MD5 7cd117020ac8ccf5a8888a6bf8bca20e
BLAKE2b-256 9d79062916fa4a37304e491c4039aa604b6022703dd5f71183bb6be2a771e0bc

See more details on using hashes here.

File details

Details for the file impulse_contracts_client-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for impulse_contracts_client-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 77f0a9f785da0dbf1ea75b7fb161f8a3576b7fe7112c2ae2daf608db2fbfaf52
MD5 465deff75c08d4ab8a4e0e1fc2c8fcf8
BLAKE2b-256 8d8d1bc41b845e55382306a3e1320369fea942e679349e58fc2c41f378e9d8ee

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