Package: openvalidators
Open ValidatorsThis repository contains Bittensor Validators designed by the OpenTensor Foundation team for the community.
It offers several functionalities, such as:Building and running Bittensor validatorsReal-time analysis of validator performance integrated with wandbOffline analysis of data generated from the networkCreation of datasets using network data for training minersThe 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 thisdocumentation.UsageThere are currently four main avenues for engaging with this repository:Validators:Designed for TAO holders who aim to build or run validators developed by the foundation.Real-time monitoring with wandb integration:Allows users to analyze the performance of various validators runs in real-time using wandb.Network analysisCaters to individuals, researchers, and data scientists interested in analyzing the data generated from the validators' interaction with the Bittensor network.Dataset creationServes individuals, researchers, and developers who seek to create datasets for the community's miners.InstallThere are two ways to use OpenTensor validators:With pip:$pip3installopenvalidatorsFrom source:$gitclonehttps://github.com/opentensor/validators.git
$pip3install-eopenvalidators/You can test the installation by running the following command:$python3validators/openvalidators/neuron.py--helpValidatorsParticipation in Network Validation is available to TAO holders. The validation mechanism utilizes a dual proof-of-stake and proof-of-work system known asYuma Consensus, which you can learn more abouthere. 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:$python3validators/openvalidators/neuron.py--wallet.name<your-wallet-name>--wallet.hotkey<your-wallet-hot-key>Real-time monitoring with wandb integrationBy default, the validator sends data to wandb, allowing users to monitor running validators and access key metrics in real time, such as:Gating model lossHardware usageForward pass timeBlock durationAll the data sent to wandb is publicly available to the community at the followinglink.You don't need to have a wandb account to access the data or to generate a new run,
but bear in mind thatdata generated by anonymous users will be deleted after 7 daysas default wandb policy.Network analysisThis repository provides a set of tools to analyze the data generated by the validators, including:CompletionsRewardsWeightsPrompt scoringA basic tutorial for downloading and analyzing wandb data can be found inanalysis.Dataset creationFor the individuals who are eager to create datasets tailored specifically for the community's miners.
With convenient scripts available in thescriptsfolder, 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 theREADME of the data collectorfor more information.Experimental FeaturesPrompt-Based ScoringThe 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 processopenandrobust. 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:Reward model evaluations are a bottleneck, owing to the large model sizeReward models are vulnerable to attacks, which reduces the network quality for everyoneConsequently, validators also performshadow 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 ModelAnother 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-v1LicenseThe MIT License (MIT) Copyright © 2023 Yuma RaoPermission 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.