From 6481ac52c50ddf392152a600de81e0b39c17e169 Mon Sep 17 00:00:00 2001 From: Eugene Date: Tue, 21 Mar 2023 08:55:37 -0700 Subject: [PATCH 1/2] remove axon + fix emission --- bittensor/_cli/commands/overview.py | 2 +- .../_neuron/text/core_validator/__init__.py | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/bittensor/_cli/commands/overview.py b/bittensor/_cli/commands/overview.py index 31ccabf89e..b89dd62aa0 100644 --- a/bittensor/_cli/commands/overview.py +++ b/bittensor/_cli/commands/overview.py @@ -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) diff --git a/bittensor/_neuron/text/core_validator/__init__.py b/bittensor/_neuron/text/core_validator/__init__.py index 1e5136669e..eb3f4a5a6a 100644 --- a/bittensor/_neuron/text/core_validator/__init__.py +++ b/bittensor/_neuron/text/core_validator/__init__.py @@ -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) @@ -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 ): @@ -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 === @@ -139,9 +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.device = torch.device ( device = self.config.neuron.device ) + 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': self.dataset = (bittensor.dataset(config=self.config, batch_size=self.subtensor.validator_batch_size, @@ -192,7 +186,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) @@ -236,7 +229,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 ) @@ -286,15 +278,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(), From 8500f769b55c3c8a9bdbcc41995b9077c75d47d1 Mon Sep 17 00:00:00 2001 From: Eugene Date: Tue, 21 Mar 2023 08:57:17 -0700 Subject: [PATCH 2/2] small fix spacing --- bittensor/_neuron/text/core_validator/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bittensor/_neuron/text/core_validator/__init__.py b/bittensor/_neuron/text/core_validator/__init__.py index eb3f4a5a6a..c0a11357cc 100644 --- a/bittensor/_neuron/text/core_validator/__init__.py +++ b/bittensor/_neuron/text/core_validator/__init__.py @@ -135,7 +135,8 @@ 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.device = torch.device ( device = self.config.neuron.device ) + 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': self.dataset = (bittensor.dataset(config=self.config, batch_size=self.subtensor.validator_batch_size,