Examples

Subnet examples

Inference

Inference Subnet

Built on top of the template

This subnet is a decentralized and open version of OpenAI, where anyone can run models for the company in return for TENSOR, or validate those that are running the models. There are two roles, Hosters and Validators. Hosters are responsible for hosting the model, and validators are responsible for validating hosters once per epoch.

Roles

  • Hoster: Hosts the model and performs inference for clients.

  • Validator: Validates hoster nodes.

Specs

  • Proof-of-stake.

  • Ed25519 signature authentication between RPC methods.

  • Built for blazing-fast and decentralized inference.

Consensus

Both hosters and validators use a commit-reveal schema for consensus. Consensus takes place directly in the subnet itself through the decentralized storage, and the scores are submitted to the blockchain.

On each epoch, the chosen subnet validator (chosen by blockchain nodes) uploads their scores for both hosters and validators from the previous epoch to the blockchain and submits a randomized tensor (prompt) to the DHT. If no tensor is submitted by a certain point in the epoch, any node can take over this task.

Commit-reveal is used to ensure that no nodes are able to copy scores from each other. Due to randomized tensors being used, scores can differ from epoch to epoch slightly.

Hoster

  • Hosters get the random tensor from the DHT and run inference with it.

  • A commit of the output is stored in the DHT as a hash during the commit phase of the epoch.

  • In the reveal phase of the epoch, they store the salt in the DHT that was used to commit.

Validator

  • Validators then get all hosters' commit-reveals to unhash and validate them.

  • Validators use this data to score each hoster by computing the accuracy for each hoster based on proximity to the mean output. The node does this by comparing each successful hoster's output tensor to the mean tensor of all valid outputs using the L2 norm. Scores are inversely proportional to the distance from the mean — the closer a hoster's output is to the average, the higher the score.

  • Each validator commits the scores to the DHT as a hash in the current epoch.

  • In the following epoch, they store the salt of the commit to the DHT.

    • These reveals are used to score the validators in the next epoch.

Since every node has access to the same data, the scores are expected to be identical for all validators. Therefore, there are no discrepancies.

Client

This example enables and allows nodes to enter as client that build frontend chat interfaces using their client_peer_id's connected to their on-chain subnet node as their proof-of-stake. These clients are not added to other nodes routing tables but are able to call inference on hosters.

DSN

Decentralized Subnet

This subnet is the first installment of the Hypertensor subnet standards. It is a fully decentralized and fault-tolerant AI subnet where each node hosts a chain of AI model transformer blocks.

Roles

  • Validator: Hosts a chain of transformer blocks and serves inference to clients.

Specs

  • Proof-of-stake.

  • Ed25519 signature authentication between RPC methods.

  • Advanced Pytorch wrappers for decentralized inference.

  • Built for decentralized and fault-tolerant AI.

Last updated