|] | | | | ____/ | | | || | \ | | \ | |] || |_____ | /_____ | | | | | | _| | _|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/unconst/boltzmann/master/run.sh)"
This repository implements an incentive system for decentralized training on the Bittensor network.
BOLTZMANN is a framework where miners collaboratively train a shared model by processing specific subsets of data, and validators ensure the quality and integrity of these contributions. The incentive landscape is designed to reward miners for effectively training on their designated data subsets, promoting efficient and collaborative model improvement in a trustless environment.
The incentive mechanism in boltzmann ensures that miners are rewarded for authentic and beneficial contributions to the model's training. By basing rewards on the cosine similarity between the miners' updates and the validators' gradients, we promote alignment of miners' efforts with the overall training objectives.
The cosine similarity between the miner's delta and the validator's gradient is calculated as:
$$ s_i = \frac{\delta_i \cdot \hat{g}_i}{|\delta_i| |\hat{g}_i|} $$
The reward for miner $i$ is directly proportional to the cosine similarity score:
$$ R_i = \alpha \cdot s_i $$
Where $\alpha$ is a scaling factor determined by the network's economic parameters.
Clone the Repository
git clone https://github.com/unconst/boltzmann.git
cd boltzmann
Set Up AWS Credentials
Configure your AWS credentials to allow read and write access to your S3 bucket:
export AWS_ACCESS_KEY_ID=your_access_key_id
export AWS_SECRET_ACCESS_KEY=your_secret_access_key
Ensure that your S3 bucket has the necessary permissions for read and write operations.
Install Dependencies
It's recommended to use a virtual environment:
python3 -m venv venv
source venv/bin/activate
Install the required Python packages:
pip install -r requirements.txt
Configure Environment Variables
Create a .env file or export the environment variables required by the project.
Register on Bittensor Subnet
The system runs on a Bittensor subnet. You need to register your miner and validator.
# Replace <> with your actual wallet names and hotkeys.
btcli register --wallet.name <wallet_name> --wallet.hotkey <hotkey_name> --subtensor.network test --netuid 220
python3 miner.py \
--wallet.name <wallet_name> \
--wallet.hotkey <hotkey_name> \
--subtensor.network test \
--netuid 220 \
--bucket <your_s3_bucket_name> \
--device cuda
python3 validator.py \
--wallet.name <wallet_name> \
--wallet.hotkey <hotkey_name> \
--subtensor.network test \
--netuid 220 \
--bucket <your_s3_bucket_name> \
--device cuda
Given the computational intensity of training and validating neural networks, it is highly recommended to use machines equipped with high-performance GPUs like NVIDIA A100 or better. Adequate CPU resources and memory are also necessary to handle data loading and preprocessing tasks.
Contributions to the boltzmann project are welcome. Please open issues and submit pull requests for improvements and fixes.
This project is licensed under the MIT License © 2024 Chakana.tech. See the LICENSE file for details.
Note: The mathematical formulations and mechanisms described are integral to ensuring the security and efficiency of the decentralized training process. By participating as a miner or validator, you contribute to a collaborative effort to advance decentralized machine learning.
Jupyter Notebook
68.7%
Python
25.1%
Shell
6.2%
|] | | | | ____/ | | | || | \ | | \ | |] || |_____ | /_____ | | | | | | _| | _|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/unconst/boltzmann/master/run.sh)"
This repository implements an incentive system for decentralized training on the Bittensor network.
BOLTZMANN is a framework where miners collaboratively train a shared model by processing specific subsets of data, and validators ensure the quality and integrity of these contributions. The incentive landscape is designed to reward miners for effectively training on their designated data subsets, promoting efficient and collaborative model improvement in a trustless environment.
The incentive mechanism in boltzmann ensures that miners are rewarded for authentic and beneficial contributions to the model's training. By basing rewards on the cosine similarity between the miners' updates and the validators' gradients, we promote alignment of miners' efforts with the overall training objectives.
The cosine similarity between the miner's delta and the validator's gradient is calculated as:
$$ s_i = \frac{\delta_i \cdot \hat{g}_i}{|\delta_i| |\hat{g}_i|} $$
The reward for miner $i$ is directly proportional to the cosine similarity score:
$$ R_i = \alpha \cdot s_i $$
Where $\alpha$ is a scaling factor determined by the network's economic parameters.
Clone the Repository
git clone https://github.com/unconst/boltzmann.git
cd boltzmann
Set Up AWS Credentials
Configure your AWS credentials to allow read and write access to your S3 bucket:
export AWS_ACCESS_KEY_ID=your_access_key_id
export AWS_SECRET_ACCESS_KEY=your_secret_access_key
Ensure that your S3 bucket has the necessary permissions for read and write operations.
Install Dependencies
It's recommended to use a virtual environment:
python3 -m venv venv
source venv/bin/activate
Install the required Python packages:
pip install -r requirements.txt
Configure Environment Variables
Create a .env file or export the environment variables required by the project.
Register on Bittensor Subnet
The system runs on a Bittensor subnet. You need to register your miner and validator.
# Replace <> with your actual wallet names and hotkeys.
btcli register --wallet.name <wallet_name> --wallet.hotkey <hotkey_name> --subtensor.network test --netuid 220
python3 miner.py \
--wallet.name <wallet_name> \
--wallet.hotkey <hotkey_name> \
--subtensor.network test \
--netuid 220 \
--bucket <your_s3_bucket_name> \
--device cuda
python3 validator.py \
--wallet.name <wallet_name> \
--wallet.hotkey <hotkey_name> \
--subtensor.network test \
--netuid 220 \
--bucket <your_s3_bucket_name> \
--device cuda
Given the computational intensity of training and validating neural networks, it is highly recommended to use machines equipped with high-performance GPUs like NVIDIA A100 or better. Adequate CPU resources and memory are also necessary to handle data loading and preprocessing tasks.
Contributions to the boltzmann project are welcome. Please open issues and submit pull requests for improvements and fixes.
This project is licensed under the MIT License © 2024 Chakana.tech. See the LICENSE file for details.
Note: The mathematical formulations and mechanisms described are integral to ensuring the security and efficiency of the decentralized training process. By participating as a miner or validator, you contribute to a collaborative effort to advance decentralized machine learning.
Jupyter Notebook
68.7%
Python
25.1%
Shell
6.2%