Skip to content

unconst/Finetensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Finetensor

Builds an incentive landscape into which miners must submit finetunned machine learning models of certain size. The models are evaluated on their ability to solve domain specific questions similar to the MMLU benchmark which are generated by scraping Wikipedia. The miner with the earliest and best overall accuracy is given all the incentive.

Installation

Setting Up the Environment

To ensure a smooth setup and avoid conflicts with other Python packages, it is recommended to use a virtual environment. Before setting up the virtual environment, ensure you have the correct version of Python installed. Additionally, running a validator for 7B parameter models requires a robust machine, specifically one equipped with a GPU having at least 40 GB of available RAM to handle the computational load efficiently.

Validator Machine Specifications

  • GPU Requirements: Minimum 40 GB of GPU RAM.
  • Examples of Suitable GPUs:
    • NVIDIA A100 (40GB or 80GB variants)
    • NVIDIA Tesla V100 (32GB, can be used in multi-GPU configurations to meet RAM requirements)
    • For more options, consider checking vendors like NVIDIA's official website or exploring cloud solutions that offer GPU instances, such as Amazon AWS EC2, Google Cloud Platform, or Microsoft Azure.

Environment Setup Steps

  1. Install pyenv for managing Python versions:

    • On macOS:
      brew install pyenv
    • On Ubuntu (Linux):
      sudo apt update && sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
      libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
      xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
      curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
    • On Windows, use WSL (Windows Subsystem for Linux) and follow the Linux instructions.
  2. Configure your shell to initialize pyenv automatically:

    • Add pyenv to the shell by adding the following lines to your profile (e.g., .bashrc, .zshrc):
      export PATH="$HOME/.pyenv/bin:$PATH"
      eval "$(pyenv init --path)"
      eval "$(pyenv virtualenv-init -)"
  3. Install Python 3.11 using pyenv:

    pyenv install 3.11.0
    pyenv global 3.11.0
  4. Install virtualenv:

    python3.11 -m pip install virtualenv
  5. Create a virtual environment:

    python3.11 -m virtualenv venv
  6. Activate the virtual environment:

    • On Windows:
      .\venv\Scripts\activate
    • On macOS and Linux:
      source venv/bin/activate
  7. Install the required packages:

    pip install -r requirements.txt
  8. Optional: Install pm2 to manage the application process:

    • If pm2 is not installed, you can install it globally using npm:
      npm install pm2@latest -g

Mining

  1. Register a UID on the subnet

See docs

  1. Train your model

Up to you

  1. Upload your model to huggingface

Use website front end

  1. Commit your model repo to the chain
    python miner.py --wallet.name <your_wallet_name> --wallet.hotkey <your_wallet_hotkey> --repo <your huggingface repo>

Remember to replace <your_wallet_name>, <your_wallet_hotkey>, and <your huggingface repo> with the actual details. The repo name is in the URL of where your model is on Huggingface.

Validating

  1. Run the validator with your wallet details:

    • You can run the validator directly:
      python validator.py --wallet.name <your_wallet_name> --wallet.hotkey <your_wallet_hotkey>
    • Alternatively, to manage the validator with pm2, use:
      pm2 start validator.py --name "validator_process" -- --wallet.name <your_wallet_name> --wallet.hotkey <your_wallet_hotkey>
  2. Check the logs of the validator process managed by pm2:

    pm2 logs validator_process
  3. Deactivate the virtual environment when done:

    deactivate
  4. Optional: Stop the pm2 process when done:

    pm2 stop validator_process

Remember to replace <your_wallet_name> and <your_wallet_hotkey> with your actual wallet details.

About

Incentivized Finetuning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages