openvalidators-test


Nameopenvalidators-test JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/opentensor/validators
SummaryOpenvalidators is a collection of open source validators for the Bittensor Network.
upload_time2023-06-06 18:46:40
maintainer
docs_urlNone
authorbittensor.com
requires_python>=3.8
licenseMIT
keywords bittensor validator ai machine-learning deep-learning blockchain pytorch torch neural-networks cryptocurrency
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

# **Open Validators** <!-- omit in toc -->
[![Discord Chat](https://img.shields.io/discord/308323056592486420.svg)](https://discord.gg/bittensor)
[![PyPI version](https://badge.fury.io/py/openvalidators.svg)](https://badge.fury.io/py/openvalidators)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 

---

</div>


This repository contains Bittensor Validators designed by the OpenTensor Foundation team for the community.
It offers several functionalities, such as:

- Building and running Bittensor validators
- Real-time analysis of validator performance integrated with wandb
- Offline analysis of data generated from the network
- Creation of datasets using network data for training miners 

The main goal of this repository is to facilitate the interaction with the Bittensor network by providing a set of
open-source validators to the community. The current validator implementation queries the network for responses and 
evaluations using carefully crafted prompts, that are later evaluated by a large foundation GPT-J reward model.

Additionally, the repository provides an analysis and data toolkit that allows users to analyze the data generated from
the validator's interaction with the network. By default, the validator collects various data points, such as question 
responses, evaluations, rewards and scorings by UID, and model performance data. This data is then sent to wandb, 
making it publicly accessible to the community.

The toolkit also includes scripts to analyze and extract data from specific validator runs or multiple runs, simplifying
the creation of valuable datasets for the community's miners.

To learn more about the Bittensor validation process, check out this [documentation](https://tensor-wiki.vercel.app/validating/validating).

# Usage
There are currently four main avenues for engaging with this repository:

1. [Validators](#Validators):
   - Designed for TAO holders who aim to build or run validators developed by the foundation.

2. [Real-time monitoring with wandb integration](#Real-time-monitoring-with-wandb-integration):
   - Allows users to analyze the performance of various validators runs in real-time using wandb.

3. [Network analysis](#Network-analysis)
   - Caters to individuals, researchers, and data scientists interested in analyzing the data generated from the validators' interaction with the Bittensor network.

4. [Dataset creation](#Dataset-creation)
   - Serves individuals, researchers, and developers who seek to create datasets for the community's miners.

# Install
There are two ways to use OpenTensor validators:

1. With pip:
```bash
$ pip3 install openvalidators
```

2. From source:
```bash
$ git clone https://github.com/opentensor/validators.git
$ pip3 install -e openvalidators/
```

You can test the installation by running the following command:
```bash
$ python3 validators/openvalidators/neuron.py --help
```

# Validators
Participation in Network Validation is available to TAO holders. The validation mechanism utilizes a dual proof-of-stake and proof-of-work system known as *Yuma Consensus*, which you can learn more about [here](https://tensor-wiki.vercel.app/validating/validating). To start validating, you will need to have a Bittensor wallet with a sufficient amount of TAO tokens staked.

Once you have your wallet ready for validation, you can start the foundation validator by running the following command:
```bash
$ python3 validators/openvalidators/neuron.py --wallet.name <your-wallet-name> --wallet.hotkey <your-wallet-hot-key>
```

# Real-time monitoring with wandb integration
By default, the validator sends data to wandb, allowing users to monitor running validators and access key metrics in real time, such as:
- Gating model loss
- Hardware usage
- Forward pass time
- Block duration

All the data sent to wandb is publicly available to the community at the following [link](https://wandb.ai/opentensor-dev/openvalidators).

You don't need to have a wandb account to access the data or to generate a new run,
but bear in mind that
[data generated by anonymous users will be deleted after 7 days](https://docs.wandb.ai/guides/app/features/anon#:~:text=If%20there's%20no%20account%2C%20we,be%20available%20for%207%20days)
as default wandb policy.

# Network analysis
This repository provides a set of tools to analyze the data generated by the validators, including:
- Completions 
- Rewards
- Weights
- [Prompt scoring](#Prompt-based-scoring)

A basic tutorial for downloading and analyzing wandb data can be found in [analysis](./analysis/demo.ipynb).

# Dataset creation
For the individuals who are eager to create datasets tailored specifically for the community's miners.
With convenient scripts available in the [scripts](./scripts) folder, you can effortlessly download data from specific or multiple runs 
of wandb, empowering you to curate comprehensive and valuable datasets that align with your mining objectives.
Check the [README of the data collector](./scripts/README.md) for more information.

----
## Experimental Features
### Prompt-Based Scoring
The reward mechanism for miner completions plays a crucial role in the overall quality of the network. As such, we are constantly developing and testing new methods that make the reward process **open** and **robust**. This benefits everyone. Presently, miners weights are set based on evaluations of their completions that are carried out by a reward model. This presents two major challenges:

1. Reward model evaluations are a bottleneck, owing to the large model size
2. Reward models are vulnerable to attacks, which reduces the network quality for everyone

Consequently, validators also perform *shadow scoring*, which outsources the reward mechanism to the network. This feature is currently under development, and so the prompt-based scores are only used for research purposes.

## Sentence Embedding Gating Model
Another cornerstone of the validator functionality is the use of a mixture of experts (MoE) model, which we call the gating model, to enable queries to be efficiently routed to the best-suited miners. **This incentivizes miners to become specialists, which in turn improves response quality**. It also reduces latency and addresses bandwidth issues in the network.
We are working on a new and improved gating model, based on sentence embeddings, which is expected to be a more powerful and robust router for queries. By default it is disabled, but can be enabled with the flags

```--neuron.use_custom_gating_model --gating.model_name sentence-transformers/all-distilroberta-v1```

# License

The MIT License (MIT) Copyright © 2023 Yuma Rao

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/opentensor/validators",
    "name": "openvalidators-test",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "bittensor,validator,ai,machine-learning,deep-learning,blockchain,pytorch,torch,neural-networks,cryptocurrency",
    "author": "bittensor.com",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/4c/c3/746bcf6ef7bff8be276d3eccb11dbbffaa02cde20cbfcd771514e0af9171/openvalidators-test-1.0.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# **Open Validators** <!-- omit in toc -->\n[![Discord Chat](https://img.shields.io/discord/308323056592486420.svg)](https://discord.gg/bittensor)\n[![PyPI version](https://badge.fury.io/py/openvalidators.svg)](https://badge.fury.io/py/openvalidators)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) \n\n---\n\n</div>\n\n\nThis repository contains Bittensor Validators designed by the OpenTensor Foundation team for the community.\nIt offers several functionalities, such as:\n\n- Building and running Bittensor validators\n- Real-time analysis of validator performance integrated with wandb\n- Offline analysis of data generated from the network\n- Creation of datasets using network data for training miners \n\nThe main goal of this repository is to facilitate the interaction with the Bittensor network by providing a set of\nopen-source validators to the community. The current validator implementation queries the network for responses and \nevaluations using carefully crafted prompts, that are later evaluated by a large foundation GPT-J reward model.\n\nAdditionally, the repository provides an analysis and data toolkit that allows users to analyze the data generated from\nthe validator's interaction with the network. By default, the validator collects various data points, such as question \nresponses, evaluations, rewards and scorings by UID, and model performance data. This data is then sent to wandb, \nmaking it publicly accessible to the community.\n\nThe toolkit also includes scripts to analyze and extract data from specific validator runs or multiple runs, simplifying\nthe creation of valuable datasets for the community's miners.\n\nTo learn more about the Bittensor validation process, check out this [documentation](https://tensor-wiki.vercel.app/validating/validating).\n\n# Usage\nThere are currently four main avenues for engaging with this repository:\n\n1. [Validators](#Validators):\n   - Designed for TAO holders who aim to build or run validators developed by the foundation.\n\n2. [Real-time monitoring with wandb integration](#Real-time-monitoring-with-wandb-integration):\n   - Allows users to analyze the performance of various validators runs in real-time using wandb.\n\n3. [Network analysis](#Network-analysis)\n   - Caters to individuals, researchers, and data scientists interested in analyzing the data generated from the validators' interaction with the Bittensor network.\n\n4. [Dataset creation](#Dataset-creation)\n   - Serves individuals, researchers, and developers who seek to create datasets for the community's miners.\n\n# Install\nThere are two ways to use OpenTensor validators:\n\n1. With pip:\n```bash\n$ pip3 install openvalidators\n```\n\n2. From source:\n```bash\n$ git clone https://github.com/opentensor/validators.git\n$ pip3 install -e openvalidators/\n```\n\nYou can test the installation by running the following command:\n```bash\n$ python3 validators/openvalidators/neuron.py --help\n```\n\n# Validators\nParticipation in Network Validation is available to TAO holders. The validation mechanism utilizes a dual proof-of-stake and proof-of-work system known as *Yuma Consensus*, which you can learn more about [here](https://tensor-wiki.vercel.app/validating/validating). To start validating, you will need to have a Bittensor wallet with a sufficient amount of TAO tokens staked.\n\nOnce you have your wallet ready for validation, you can start the foundation validator by running the following command:\n```bash\n$ python3 validators/openvalidators/neuron.py --wallet.name <your-wallet-name> --wallet.hotkey <your-wallet-hot-key>\n```\n\n# Real-time monitoring with wandb integration\nBy default, the validator sends data to wandb, allowing users to monitor running validators and access key metrics in real time, such as:\n- Gating model loss\n- Hardware usage\n- Forward pass time\n- Block duration\n\nAll the data sent to wandb is publicly available to the community at the following [link](https://wandb.ai/opentensor-dev/openvalidators).\n\nYou don't need to have a wandb account to access the data or to generate a new run,\nbut bear in mind that\n[data generated by anonymous users will be deleted after 7 days](https://docs.wandb.ai/guides/app/features/anon#:~:text=If%20there's%20no%20account%2C%20we,be%20available%20for%207%20days)\nas default wandb policy.\n\n# Network analysis\nThis repository provides a set of tools to analyze the data generated by the validators, including:\n- Completions \n- Rewards\n- Weights\n- [Prompt scoring](#Prompt-based-scoring)\n\nA basic tutorial for downloading and analyzing wandb data can be found in [analysis](./analysis/demo.ipynb).\n\n# Dataset creation\nFor the individuals who are eager to create datasets tailored specifically for the community's miners.\nWith convenient scripts available in the [scripts](./scripts) folder, you can effortlessly download data from specific or multiple runs \nof wandb, empowering you to curate comprehensive and valuable datasets that align with your mining objectives.\nCheck the [README of the data collector](./scripts/README.md) for more information.\n\n----\n## Experimental Features\n### Prompt-Based Scoring\nThe reward mechanism for miner completions plays a crucial role in the overall quality of the network. As such, we are constantly developing and testing new methods that make the reward process **open** and **robust**. This benefits everyone. Presently, miners weights are set based on evaluations of their completions that are carried out by a reward model. This presents two major challenges:\n\n1. Reward model evaluations are a bottleneck, owing to the large model size\n2. Reward models are vulnerable to attacks, which reduces the network quality for everyone\n\nConsequently, validators also perform *shadow scoring*, which outsources the reward mechanism to the network. This feature is currently under development, and so the prompt-based scores are only used for research purposes.\n\n## Sentence Embedding Gating Model\nAnother cornerstone of the validator functionality is the use of a mixture of experts (MoE) model, which we call the gating model, to enable queries to be efficiently routed to the best-suited miners. **This incentivizes miners to become specialists, which in turn improves response quality**. It also reduces latency and addresses bandwidth issues in the network.\nWe are working on a new and improved gating model, based on sentence embeddings, which is expected to be a more powerful and robust router for queries. By default it is disabled, but can be enabled with the flags\n\n```--neuron.use_custom_gating_model --gating.model_name sentence-transformers/all-distilroberta-v1```\n\n# License\n\nThe MIT License (MIT) Copyright \u00a9 2023 Yuma Rao\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated \ndocumentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit \npersons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE \nWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR \nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Openvalidators is a collection of open source validators for the Bittensor Network.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/opentensor/validators"
    },
    "split_keywords": [
        "bittensor",
        "validator",
        "ai",
        "machine-learning",
        "deep-learning",
        "blockchain",
        "pytorch",
        "torch",
        "neural-networks",
        "cryptocurrency"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a65f941247569811423ff55ab452d0504289b65d4d3e6770637b32516cb7a0e2",
                "md5": "2ecedb4b3e73c7130be640ee18f6afec",
                "sha256": "551f42129367dda9a96054077779b8275517efccc3b381bd0a931537dde448f3"
            },
            "downloads": -1,
            "filename": "openvalidators_test-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2ecedb4b3e73c7130be640ee18f6afec",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 37553,
            "upload_time": "2023-06-06T18:46:38",
            "upload_time_iso_8601": "2023-06-06T18:46:38.294428Z",
            "url": "https://files.pythonhosted.org/packages/a6/5f/941247569811423ff55ab452d0504289b65d4d3e6770637b32516cb7a0e2/openvalidators_test-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4cc3746bcf6ef7bff8be276d3eccb11dbbffaa02cde20cbfcd771514e0af9171",
                "md5": "bed612858517a24b9529d59651bf34f1",
                "sha256": "b52726952deda21eefd4705668211d72f0e7a09ab784a4303c2697cabe7df281"
            },
            "downloads": -1,
            "filename": "openvalidators-test-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bed612858517a24b9529d59651bf34f1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 27667,
            "upload_time": "2023-06-06T18:46:40",
            "upload_time_iso_8601": "2023-06-06T18:46:40.110303Z",
            "url": "https://files.pythonhosted.org/packages/4c/c3/746bcf6ef7bff8be276d3eccb11dbbffaa02cde20cbfcd771514e0af9171/openvalidators-test-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-06 18:46:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "opentensor",
    "github_project": "validators",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "openvalidators-test"
}
        
Elapsed time: 0.08548s