Skip to content

Commit

Permalink
[Fix] comment out addition of new neuron fields (#1081)
Browse files Browse the repository at this point in the history
comment out addition of new neuron fields
  • Loading branch information
camfairchild authored Feb 1, 2023
1 parent 92e3346 commit c04403c
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 64 deletions.
16 changes: 8 additions & 8 deletions bittensor/_cli/commands/metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def run (cli):
TABLE_DATA = []
total_stake = 0.0
total_rank = 0.0
total_validator_trust = 0.0
# total_validator_trust = 0.0
total_trust = 0.0
total_consensus = 0.0
total_weight_consensus = 0.0
# total_weight_consensus = 0.0
total_incentive = 0.0
total_dividends = 0.0
total_emission = 0
Expand All @@ -54,11 +54,11 @@ def run (cli):
'{:.5f}'.format( metagraph.ranks[uid]),
'{:.5f}'.format( metagraph.trust[uid]),
'{:.5f}'.format( metagraph.consensus[uid]),
'{:.5f}'.format( metagraph.weight_consensus[uid]),
# '{:.5f}'.format( metagraph.weight_consensus[uid]),
'{:.5f}'.format( metagraph.incentive[uid]),
'{:.5f}'.format( metagraph.dividends[uid]),
'{}'.format( int(metagraph.emission[uid] * 1000000000)),
'{:.5f}'.format( metagraph.validator_trust[uid]),
# '{:.5f}'.format( metagraph.validator_trust[uid]),
'*' if metagraph.validator_permit[uid] else '',
str((metagraph.block.item() - metagraph.last_update[uid].item())),
str( metagraph.active[uid].item() ),
Expand All @@ -68,10 +68,10 @@ def run (cli):
]
total_stake += metagraph.stake[uid]
total_rank += metagraph.ranks[uid]
total_validator_trust += metagraph.validator_trust[uid]
# total_validator_trust += metagraph.validator_trust[uid]
total_trust += metagraph.trust[uid]
total_consensus += metagraph.consensus[uid]
total_weight_consensus += metagraph.weight_consensus[uid]
# total_weight_consensus += metagraph.weight_consensus[uid]
total_incentive += metagraph.incentive[uid]
total_dividends += metagraph.dividends[uid]
total_emission += int(metagraph.emission[uid] * 1000000000)
Expand All @@ -86,11 +86,11 @@ def run (cli):
table.add_column("[overline white]RANK", '{:.5f}'.format(total_rank), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]TRUST", '{:.5f}'.format(total_trust), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]CONSENSUS", '{:.5f}'.format(total_consensus), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]WCONSENSUS", '{:.5f}'.format(total_weight_consensus), footer_style = "overline white", justify='right', style='green', no_wrap=True)
# table.add_column("[overline white]WCONSENSUS", '{:.5f}'.format(total_weight_consensus), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]INCENTIVE", '{:.5f}'.format(total_incentive), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]DIVIDENDS", '{:.5f}'.format(total_dividends), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]EMISSION(\u03C1)", '\u03C1{}'.format(int(total_emission)), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]VTRUST", '{:.5f}'.format(total_validator_trust), footer_style = "overline white", justify='right', style='green', no_wrap=True)
# table.add_column("[overline white]VTRUST", '{:.5f}'.format(total_validator_trust), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]VAL", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]UPDATED", justify='right', no_wrap=True)
table.add_column("[overline white]ACTIVE", justify='right', style='green', no_wrap=True)
Expand Down
18 changes: 9 additions & 9 deletions bittensor/_cli/commands/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def run( cli ):
total_rank = 0.0
total_trust = 0.0
total_consensus = 0.0
total_validator_trust = 0.0
total_weight_consensus = 0.0
# total_validator_trust = 0.0
# total_weight_consensus = 0.0
total_incentive = 0.0
total_dividends = 0.0
total_emission = 0
Expand All @@ -128,8 +128,8 @@ def run( cli ):
rank = nn.rank
trust = nn.trust
consensus = nn.consensus
validator_trust = nn.validator_trust
weight_consensus = nn.weight_consensus
# validator_trust = nn.validator_trust
# weight_consensus = nn.weight_consensus
incentive = nn.incentive
dividends = nn.dividends
emission = int(nn.emission * 1000000000)
Expand All @@ -144,11 +144,11 @@ def run( cli ):
'{:.5f}'.format(rank),
'{:.5f}'.format(trust),
'{:.5f}'.format(consensus),
'{:.5f}'.format(weight_consensus),
# '{:.5f}'.format(weight_consensus),
'{:.5f}'.format(incentive),
'{:.5f}'.format(dividends),
'{}'.format(emission),
'{:.5f}'.format(validator_trust),
# '{:.5f}'.format(validator_trust),
'*' if validator_permit else '',
str(last_update),
bittensor.utils.networking.int_to_ip( nn.axon_info.ip) + ':' + str(nn.axon_info.port) if nn.axon_info.port != 0 else '[yellow]none[/yellow]',
Expand All @@ -158,11 +158,11 @@ def run( cli ):
total_rank += rank
total_trust += trust
total_consensus += consensus
total_weight_consensus += weight_consensus
# total_weight_consensus += weight_consensus
total_incentive += incentive
total_dividends += dividends
total_emission += emission
total_validator_trust += validator_trust
# total_validator_trust += validator_trust
TABLE_DATA.append(row)

total_neurons = len(neurons)
Expand All @@ -182,7 +182,7 @@ def run( cli ):
table.add_column("[overline white]INCENTIVE", '{:.5f}'.format(total_incentive), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]DIVIDENDS", '{:.5f}'.format(total_dividends), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]EMISSION(\u03C1)", '\u03C1{}'.format(int(total_emission)), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]VTRUST", '{:.5f}'.format(total_validator_trust), footer_style="overline white", justify='right', style='green', no_wrap=True)
# table.add_column("[overline white]VTRUST", '{:.5f}'.format(total_validator_trust), footer_style="overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]VAL", justify='right', no_wrap=True)
table.add_column("[overline white]UPDATED", justify='right', no_wrap=True)
table.add_column("[overline white]AXON", justify='left', style='dim blue', no_wrap=True)
Expand Down
16 changes: 8 additions & 8 deletions bittensor/_metagraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def from_neurons( network: str, netuid: int, neurons: List['bittensor.NeuronInfo
ranks = [ 0 for _ in range(n_total) ]
trust = [ 0 for _ in range(n_total) ]
consensus = [ 0 for _ in range(n_total) ]
validator_trust = [ 0 for _ in range(n_total) ]
weight_consensus = [ 0 for _ in range(n_total) ]
# validator_trust = [ 0 for _ in range(n_total) ]
# weight_consensus = [ 0 for _ in range(n_total) ]
incentive = [ 0 for _ in range(n_total) ]
emission = [ 0 for _ in range(n_total) ]
dividends = [ 0 for _ in range(n_total) ]
Expand All @@ -157,8 +157,8 @@ def from_neurons( network: str, netuid: int, neurons: List['bittensor.NeuronInfo
ranks[n.uid] = n.rank
trust[n.uid] = n.trust
consensus[n.uid] = n.consensus
validator_trust[n.uid] = n.validator_trust
weight_consensus[n.uid] = n.weight_consensus
# validator_trust[n.uid] = n.validator_trust
# weight_consensus[n.uid] = n.weight_consensus
incentive[n.uid] = n.incentive
dividends[n.uid] = n.dividends
emission[n.uid] = n.emission
Expand Down Expand Up @@ -187,8 +187,8 @@ def from_neurons( network: str, netuid: int, neurons: List['bittensor.NeuronInfo
tranks = torch.tensor( ranks, dtype=torch.float32 )
ttrust = torch.tensor( trust, dtype=torch.float32 )
tconsensus = torch.tensor( consensus, dtype=torch.float32 )
tvalidator_trust = torch.tensor( validator_trust, dtype=torch.float32 )
tweight_consensus = torch.tensor( weight_consensus, dtype=torch.float32 )
# tvalidator_trust = torch.tensor( validator_trust, dtype=torch.float32 )
# tweight_consensus = torch.tensor( weight_consensus, dtype=torch.float32 )
tincentive = torch.tensor( incentive, dtype=torch.float32 )
temission = torch.tensor( emission, dtype=torch.float32 )
tdividends = torch.tensor( dividends, dtype=torch.float32 )
Expand All @@ -209,8 +209,8 @@ def from_neurons( network: str, netuid: int, neurons: List['bittensor.NeuronInfo
metagraph.ranks = torch.nn.Parameter( tranks, requires_grad=False )
metagraph.trust = torch.nn.Parameter( ttrust, requires_grad=False )
metagraph.consensus = torch.nn.Parameter( tconsensus, requires_grad=False )
metagraph.validator_trust = torch.nn.Parameter( tvalidator_trust, requires_grad=False )
metagraph.weight_consensus = torch.nn.Parameter( tweight_consensus, requires_grad=False )
# metagraph.validator_trust = torch.nn.Parameter( tvalidator_trust, requires_grad=False )
# metagraph.weight_consensus = torch.nn.Parameter( tweight_consensus, requires_grad=False )
metagraph.incentive = torch.nn.Parameter( tincentive, requires_grad=False )
metagraph.emission = torch.nn.Parameter( temission, requires_grad=False )
metagraph.dividends = torch.nn.Parameter( tdividends, requires_grad=False )
Expand Down
24 changes: 15 additions & 9 deletions bittensor/_metagraph/metagraph_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def clear( self ) -> 'Metagraph':
self.ranks = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.trust = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.consensus = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.validator_trust = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.weight_consensus = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
# self.validator_trust = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
# self.weight_consensus = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.incentive = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.emission = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.dividends = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
Expand Down Expand Up @@ -133,13 +133,15 @@ def T(self) -> torch.FloatTensor:
def Cw(self) -> torch.FloatTensor:
""" Weight consensus
"""
return self.weight_consensus
raise NotImplementedError
# return self.weight_consensus

@property
def Tv(self) -> torch.FloatTensor:
""" Validator trust
"""
return self.validator_trust
raise NotImplementedError
# return self.validator_trust

@property
def D(self) -> torch.FloatTensor:
Expand Down Expand Up @@ -310,8 +312,8 @@ def load_from_state_dict(self, state_dict:dict ) -> 'Metagraph':
self.ranks = torch.nn.Parameter( state_dict['ranks'], requires_grad=False )
self.trust = torch.nn.Parameter( state_dict['trust'], requires_grad=False )
self.consensus = torch.nn.Parameter( state_dict['consensus'], requires_grad=False )
self.validator_trust = torch.nn.Parameter( state_dict['validator_trust'], requires_grad=False )
self.weight_consensus = torch.nn.Parameter( state_dict['weight_consensus'], requires_grad=False )
# self.validator_trust = torch.nn.Parameter( state_dict['validator_trust'], requires_grad=False )
# self.weight_consensus = torch.nn.Parameter( state_dict['weight_consensus'], requires_grad=False )
self.incentive = torch.nn.Parameter( state_dict['incentive'], requires_grad=False )
self.emission = torch.nn.Parameter( state_dict['emission'], requires_grad=False )
self.dividends = torch.nn.Parameter( state_dict['dividends'], requires_grad=False )
Expand Down Expand Up @@ -349,7 +351,11 @@ def sync ( self, netuid: int, subtensor: 'bittensor.Subtensor' = None, block: Op
def to_dataframe(self):
try:
index = self.uids.tolist()
columns = [ 'uid', 'active', 'stake', 'rank', 'trust', 'consensus', 'validator_trust', 'weight_consensus', 'incentive', 'dividends', 'emission']
columns = [ 'uid', 'active', 'stake', 'rank', 'trust', 'consensus',
# 'validator_trust', 'weight_consensus',
'incentive', 'dividends', 'emission'
]

dataframe = pandas.DataFrame(columns = columns, index = index)
for uid in self.uids.tolist():
v = {
Expand All @@ -359,8 +365,8 @@ def to_dataframe(self):
'rank': self.ranks[uid].item(),
'trust': self.trust[uid].item(),
'consensus': self.consensus[uid].item(),
'validator_trust': self.validator_trust[uid].item(),
'weight_consensus': self.weight_consensus[uid].item(),
# 'validator_trust': self.validator_trust[uid].item(),
# 'weight_consensus': self.weight_consensus[uid].item(),
'incentive': self.incentive[uid].item(),
'dividends': self.dividends[uid].item(),
'emission': self.emission[uid].item()
Expand Down
12 changes: 6 additions & 6 deletions bittensor/_metagraph/metagraph_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def __init__( self ):
tranks = torch.tensor( [1.0/2000 for _ in range (2000) ], dtype=torch.float32 )
ttrust = torch.tensor( [ 1.0 for _ in range (2000) ], dtype=torch.float32 )
tconsensus = torch.tensor( [1.0 for _ in range (2000) ], dtype=torch.float32 )
tvalidator_trust = torch.tensor( [ 1.0 for _ in range (2000) ], dtype=torch.float32 )
tweight_consensus = torch.tensor( [1.0 for _ in range (2000) ], dtype=torch.float32 )
# tvalidator_trust = torch.tensor( [ 1.0 for _ in range (2000) ], dtype=torch.float32 )
# tweight_consensus = torch.tensor( [1.0 for _ in range (2000) ], dtype=torch.float32 )
tincentive = torch.tensor( [1.0/2000 for _ in range (2000) ], dtype=torch.float32 )
temission = torch.tensor( [1.0/2000 for _ in range (2000) ], dtype=torch.float32 )
tdividends = torch.tensor( [1.0/2000 for _ in range (2000) ], dtype=torch.float32 )
Expand All @@ -66,8 +66,8 @@ def __init__( self ):
self.ranks = torch.nn.Parameter( tranks, requires_grad=False )
self.trust = torch.nn.Parameter( ttrust, requires_grad=False )
self.consensus = torch.nn.Parameter( tconsensus, requires_grad=False )
self.validator_trust = torch.nn.Parameter( tvalidator_trust, requires_grad=False )
self.weight_consensus = torch.nn.Parameter( tweight_consensus, requires_grad=False )
# self.validator_trust = torch.nn.Parameter( tvalidator_trust, requires_grad=False )
# self.weight_consensus = torch.nn.Parameter( tweight_consensus, requires_grad=False )
self.incentive = torch.nn.Parameter( tincentive, requires_grad=False )
self.emission = torch.nn.Parameter( temission, requires_grad=False )
self.dividends = torch.nn.Parameter( tdividends, requires_grad=False )
Expand All @@ -91,8 +91,8 @@ def clear( self ) -> 'Metagraph':
self.ranks = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.trust = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.consensus = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.validator_trust = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.weight_consensus = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
# self.validator_trust = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
# self.weight_consensus = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.incentive = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.emission = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
self.dividends = torch.nn.Parameter( torch.tensor( [], dtype=torch.float32), requires_grad=False )
Expand Down
8 changes: 4 additions & 4 deletions bittensor/_neuron/text/core_server/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ def backward_callback(inputs_x:torch.FloatTensor, grads_dy:torch.FloatTensor, sy
'rank': nn.rank,
'trust': nn.trust,
'consensus': nn.consensus,
'validator_trust': nn.validator_trust,
'weight_consensus': nn.weight_consensus,
# 'validator_trust': nn.validator_trust,
# 'weight_consensus': nn.weight_consensus,
'incentive': nn.incentive,
'emission': nn.emission,
}
Expand All @@ -453,8 +453,8 @@ def backward_callback(inputs_x:torch.FloatTensor, grads_dy:torch.FloatTensor, sy
prometheus_guages.labels("rank").set( nn.rank )
prometheus_guages.labels("trust").set( nn.trust )
prometheus_guages.labels("consensus").set( nn.consensus )
prometheus_guages.labels("validator_trust").set( nn.validator_trust )
prometheus_guages.labels("weight_consensus").set( nn.weight_consensus )
# prometheus_guages.labels("validator_trust").set( nn.validator_trust )
# prometheus_guages.labels("weight_consensus").set( nn.weight_consensus )
prometheus_guages.labels("incentive").set( nn.incentive )
prometheus_guages.labels("emission").set( nn.emission )

Expand Down
Loading

0 comments on commit c04403c

Please sign in to comment.