Skip to content

Commit

Permalink
Merge pull request #901 from opentensor/BIT-573-improve-validator-epo…
Browse files Browse the repository at this point in the history
…ch-responsives

[BIT-573] Improve validator epoch and responsives handling
  • Loading branch information
opentaco authored Sep 4, 2022
2 parents eae2c7e + 21a261b commit 8eb8a31
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bittensor/_neuron/text/core_validator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,12 @@ def run_epoch( self ):
epoch_start_time = time.time()

start_block = self.subtensor.block
# normal epoch duration is blocks_per_epoch if all UIDs have been queried
# try to query each UID at least once - assumes nucleus samples without replacement
# but keep maximum epoch duration at 2 * blocks_per_epoch
while (self.subtensor.block < start_block + blocks_per_epoch or
len(epoch_queried_uids) < self.metagraph.n): # ensure each UID is queried at least once - assumes nucleus samples without replacement
(self.subtensor.block < start_block + 2 * blocks_per_epoch and
len(epoch_queried_uids) < self.metagraph.n)):
start_time = time.time()

# === Forward ===
Expand Down Expand Up @@ -552,7 +556,6 @@ def neuron_stats_update(self, neuron_stats: Dict[int, Dict[str, Any]]):
responsive_uids = []
for _uid, _stats in neuron_stats.items():
stats = self.neuron_stats.setdefault(_uid, {})
responsive_uids += [_uid]

# === EMA zeroing update ===
# Push zero into EMA for synapse_keys to exponentially decay weighting keys if neuron non-responsive
Expand Down

0 comments on commit 8eb8a31

Please sign in to comment.