Skip to content

Hivetensor/modded-gpt-competition

Repository files navigation

Bittensor GPT Subnet Workflow Guide

This project enables a decentralized network for training GPT models via Bittensor. Miners submit model implementations, and validators evaluate them to determine network weights.

Prerequisites

  • Python 3.8+
  • Docker + NVIDIA Container Toolkit (for GPU validation)
  • Bittensor wallet (btcli w new_coldkey, btcli w new_hotkey)
  • GitHub Personal Access Token (for validator)
  • Clone this repository
git clone [REPO_URL] && cd [REPO_NAME]
pip install -r requirements.txt

1. Configuration

Edit config.py:

# For testnet
network = "test"
netuid = 100  # Subnet UID
wallet_name = "your_wallet"
wallet_hotkey = "your_hotkey"
weight_server_url = "http://your-server:8000"

2. Miner Submission

  1. Implement Components in miner_submission.py:

    • Custom AttentionBlock
    • GPTModel architecture
    • Training Optimizer
    • LossFunction
  2. Push to GitHub repository containing:

    • miner_submission.py
    • hotkey.json (contains your Bittensor hotkey SS58 address)
  3. Submit to Chain:

python submit_to_chain.py \
  --repo yourgithub/repo \
  --wallet-name your_wallet \
  --wallet-hotkey your_hotkey \
  --network test for testnet finney for mainnet \
  --subnet-uid 100 for testnet 49 for mainnet

3. Validator Operation

  1. Start Weight Server (separate terminal):
python weight_server.py
  1. Run Validator:
export GITHUB_TOKEN=your_github_token
python main.py

Validation Process:

  1. Syncs with Bittensor chain every 10 minutes
  2. Pulls new submissions from GitHub
  3. Runs Docker containers to:
    • Generate model fingerprints
    • Check for code duplicates
    • Evaluate training performance
  4. Scores models based on validation loss
  5. Updates network weights via weight server

4. Additional Components

Weight Updates

  • Validators send scores to weight_server.py
  • Server verifies signatures and updates on-chain weights

Security Features

  • Container isolation with read-only filesystems
  • Signature verification for weight updates
  • Duplicate detection through code hashing

Monitoring

Check databases for validation results:

  • submissions.db - Current submissions
  • model_records.db - Historical validation data

Troubleshooting

  1. Docker Permissions: Ensure user in docker group
  2. GPU Access: Verify nvidia-docker installation
  3. Chain Sync: Check btt_connector.py logs for sync errors
  4. Rate Limits: Validator automatically handles GitHub API limits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published