Skip to content
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
34 changes: 34 additions & 0 deletions docs/validator_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- [`--neuron.sample_size INTEGER`](#--neuronsample_size-integer)
- [`--neuron.timeout INTEGER`](#--neurontimeout-integer)
- [`--neuron.nprocs INTEGER`](#--neuronnprocs-integer)
- [`--neuron.use_multiprocess INTEGER`](#--neuronuse_multiprocess-integer)
- [`--neuron.vpermit_tao_limit INTEGER`](#--neuronvpermit_tao_limit-integer)
- [`--wallet.hotkey TEXT`](#--wallethotkey-text)
- [`--wallet.name TEXT`](#--walletname-text)
Expand Down Expand Up @@ -721,6 +722,39 @@ pm2 start validator.config.js -- --neuron.vpermit_tao_limit 1000

<sup>[Back to top ^][table-of-contents]</sup>

#### `--neuron.use_multiprocess INTEGER`

Wether to use multiple processes for the validator dendrite.

Default: `1`

Example to disable multiprocess:

```js
// validator.config.js
module.exports = {
apps: [
{
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--neuron.use_multiprocess 0",
env: {
PYTHONPATH: ".",
},
},
],
};
```

Alternatively, you can add the args directly to the command:

```shell
pm2 start validator.config.js -- --neuron.nprocs 8
```

<sup>[Back to top ^][table-of-contents]</sup>

#### `--wallet.hotkey TEXT`

The hotkey of the wallet.
Expand Down
15 changes: 11 additions & 4 deletions synth/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def is_cuda_available():
return "cpu"


def check_config(cls, config: "bt.Config"):
def check_config(_, config: "bt.Config"):
r"""Checks/validates the config namespace object."""
bt.logging.check_config(config)

Expand All @@ -67,7 +67,7 @@ def check_config(cls, config: "bt.Config"):
bt.logging.register_primary_logger(events_logger.name)


def add_args(cls, parser):
def add_args(_, parser):
"""
Adds relevant arguments to the parser for operation.
"""
Expand Down Expand Up @@ -110,7 +110,7 @@ def add_args(cls, parser):
)


def add_miner_args(cls, parser):
def add_miner_args(_, parser):
"""Add miner specific arguments to the parser."""

parser.add_argument(
Expand Down Expand Up @@ -178,7 +178,7 @@ def add_miner_args(cls, parser):
)


def add_validator_args(cls, parser: argparse.ArgumentParser):
def add_validator_args(_, parser: argparse.ArgumentParser):
"""Add validator specific arguments to the parser."""

parser.add_argument(
Expand All @@ -202,6 +202,13 @@ def add_validator_args(cls, parser: argparse.ArgumentParser):
default=8,
)

parser.add_argument(
"--neuron.use_multiprocess",
type=int,
help="The number of processes to run for the validator dendrite.",
default=1,
)

parser.add_argument(
"--neuron.sample_size",
type=int,
Expand Down
3 changes: 1 addition & 2 deletions synth/validator/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,9 @@ async def query_available_miners_and_save_responses(

axons = [base_neuron.metagraph.axons[uid] for uid in miner_uids]

use_multiprocess = True
start_time = time.time()

if use_multiprocess:
if base_neuron.config.neuron.use_multiprocess == 1:
synapses = sync_forward_multiprocess(
base_neuron.dendrite.keypair,
base_neuron.dendrite.uuid,
Expand Down