Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BIT-540] Choose responsive UIDs for setting weights in validator + validator save/load #872

Merged
merged 8 commits into from
Aug 12, 2022

Conversation

opentaco
Copy link
Contributor

@opentaco opentaco commented Aug 9, 2022

BIT-540 Choose responsive UIDs for setting weights in validator

Prefer current epoch's responsive UIDs, randomly sample min_allowed_weights number of UIDs to set weights to.

Discard max_allowed_ratio in favor of filtering non-zero weights, expecting consensus-levels (number of validators setting weights for UID) to be equal on average for responsive nodes. This means max_allowed_ratio is no longer strictly required for boosting consensus.

If there are less than min_allowed_weights non-zero weights, then set_weights should fail.


BIT-536 Validator save and load from filesystem

  1. Uses core_server save/load format and args.
  2. Saves neuron_stats and associated hotkeys.
  3. Checks for hotkey changes and updates neuron_stats / neuron_hotkeys (and saves).

Prefer current epoch's responsive UIDs, randomly sample min_allowed_weights number of UIDs to set weights to.

Discard max_allowed_ratio in favor of filtering non-zero weights, expecting consensus-levels (number of validators setting weights for UID) to be equal on average for responsive nodes. This means max_allowed_ratio is no longer strictly required for boosting consensus.

If there are less than min_allowed_weights non-zero weights, then set_weights should fail.
@opentaco opentaco changed the base branch from master to Synapse August 9, 2022 15:17
@opentaco opentaco changed the base branch from Synapse to master August 9, 2022 15:18
Return a k length list of unique elements chosen from the population sequence or set. Used for random sampling without replacement (so no uid duplicates expected).
Uses save and load format of core_server.
@opentaco opentaco changed the title [BIT-540] Choose responsive UIDs for setting weights in validator [BIT-540] Choose responsive UIDs for setting weights in validator + validator save/load Aug 11, 2022
Copy link
Contributor

@Eugene-hu Eugene-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

neuron_weights = neuron_weights[neuron_weights > 0] # filter to non-zero weights

# === Slice min_allowed_weights UIDs ===
sample_uids = preferred_uids[:min_allowed_weights] # slice to min_allowed_weights
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually i have always been confused, cause min_allowed_weight is just the minimum network requirement,
so shouldnt we set it to max(min_allowed_weight, len(responsive_uids)) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously and currently validators always fixed the number of weights set to min_allowed_weight, likely because the demands on subtensor are more predictable then and because validators operate more similarly the consensus is improved.

@opentaco opentaco merged commit e2ca6a9 into master Aug 12, 2022
@ifrit98 ifrit98 deleted the BIT-540-validator-weight-setting-improvement branch May 24, 2023 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants