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

remove axon + fix emission #1188

Merged
merged 2 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bittensor/_cli/commands/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def run( cli ):
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]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(\u03C4)", '\u03C4{}'.format(int(total_emission)), footer_style = "overline white", justify='right', style='green', no_wrap=True)
table.add_column("[overline white]EMISSION(\u03C4)", '\u03C4{:.5f}'.format(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]VPERMIT", justify='right', no_wrap=True)
table.add_column("[overline white]UPDATED", justify='right', no_wrap=True)
Expand Down
15 changes: 3 additions & 12 deletions bittensor/_neuron/text/core_validator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ class neuron:
bittensor dendrite object
dataset (:obj:bittensor.dendrite, `optional`):
bittensor dendrite object
axon (:obj:bittensor.axon, `optional`):
bittensor axon object
Examples::
>>> subtensor = bittensor.subtensor(network='nakamoto')
>>> validator = bittensor.neuron.text.core_validator.neuron(subtensor=subtensor)
Expand All @@ -91,7 +89,6 @@ def __init__(
metagraph: 'bittensor.Metagraph' = None,
dendrite: 'bittensor.Dendrite' = None,
dataset: 'bittensor.dataset' = None,
axon: 'bittensor.axon' = None,
netuid: int = None
):

Expand Down Expand Up @@ -123,7 +120,6 @@ def __init__(
self.config.dendrite._mock = True
self.config.metagraph._mock = True
self.config.subtensor._mock = True
self.config.axon._mock = True
print ( self.config )

# === Logging + prometheus ===
Expand All @@ -139,8 +135,7 @@ def __init__(
self.wallet = bittensor.wallet ( config = self.config ) if wallet == None else wallet
self.subtensor = subtensor
self.metagraph = bittensor.metagraph ( config = self.config ) if metagraph == None else metagraph
self.dendrite = bittensor.dendrite ( config = self.config, wallet = self.wallet, max_active_receptors = 0 ) if dendrite == None else dendrite # Dendrite should not store receptor in validator.
self.axon = bittensor.axon ( netuid=self.config.netuid, config = self.config, wallet = self.wallet ) if axon == None else axon
self.dendrite = bittensor.dendrite ( config = self.config, wallet = self.wallet, max_active_receptors = 0 ) if dendrite == None else dendrite # Dendrite should not store receptor in validator.
self.device = torch.device ( device = self.config.neuron.device )
self.nucleus = nucleus ( config = self.config, device = self.device, subtensor = self.subtensor, vlogger = self.vlogger ).to( self.device )
if self.config.subtensor.network == 'nakamoto':
Expand Down Expand Up @@ -192,7 +187,6 @@ def check_config( cls, config: 'bittensor.Config' ):
bittensor.dataset.check_config( config )
bittensor.dendrite.check_config( config )
bittensor.wandb.check_config( config )
bittensor.axon.check_config( config )
bittensor.prometheus.check_config( config )
full_path = os.path.expanduser('{}/{}/{}/netuid{}/{}'.format( config.logging.logging_dir, config.wallet.name, config.wallet.hotkey, config.netuid, config.neuron.name ))
config.neuron.full_path = os.path.expanduser(full_path)
Expand Down Expand Up @@ -236,7 +230,6 @@ def config ( cls ):
bittensor.logging.add_args( parser )
bittensor.dataset.add_args( parser )
bittensor.wandb.add_args(parser)
bittensor.axon.add_args( parser )
bittensor.prometheus.add_args( parser )
return bittensor.config( parser )

Expand Down Expand Up @@ -286,15 +279,13 @@ def __enter__(self):
)

# === Set prometheus run info ===
# Serve the prometheus with axon so we can determine where the prometheus server port is (the axon is only served for this reason.)
# TODO (Cameron) this should be it's own storage map on-chain.
# Serve the prometheus
bittensor.prometheus(
config = self.config,
wallet = self.wallet,
netuid = self.config.netuid,
port = self.config.prometheus.port if self.config.prometheus.port == bittensor.defaults.axon.port else self.config.axon.port - 1000
port = self.config.prometheus.port
)
self.axon.serve( subtensor = self.subtensor )

self.vlogger.prometheus.log_run_info(
parameters = self.nucleus.parameters(),
Expand Down