Skip to content

Commit af0b61c

Browse files
authored
Thykof/mod 1764 synth high frequency (#178)
* remove blacklist.validator_exceptions * remove mypy from precommit * update validator guide: nprocs:2 * rework round_time_to_minutes * change some logs to trace * fixup use_multiprocess * wip HFT * Revert "wip HFT" This reverts commit 887b320. * fix unit test with numba * clean temp code of step1 * install numba * refactor forward with scheduler * high frequency * crps for HTF * split smoothed scores * combine smoothed scores * lint * smoothed_score_coefficient * improvements * hardcode parameters unless softmaxbeta for 1h prompt * Revert "skip score during cloudflare outage (#189)" This reverts commit 42bf3b1. * fix forward tests * fix migration default value * schedule HFT
1 parent d261679 commit af0b61c

36 files changed

+575
-627
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,3 @@ repos:
88
rev: 7.1.2
99
hooks:
1010
- id: flake8
11-
- repo: https://github.com/pre-commit/mirrors-mypy
12-
rev: v1.15.0
13-
hooks:
14-
- id: mypy
15-
exclude: ^(docs/|example-plugin/)

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ validator_coldkey_name = validator-base
1515
validator_hotkey_name = default
1616

1717
ewma_window_days = 10
18-
ewma_cutoff_days = 10
1918

2019
# Python virtual environment
2120
venv_python=bt_venv/bin/python3
@@ -34,4 +33,3 @@ validator:
3433
--logging.$(logging_level) \
3534
--neuron.axon_off true \
3635
--ewma.window_days $(ewma_window_days) \
37-
--ewma.cutoff_days $(ewma_cutoff_days)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""add column rewards prompt_name
2+
3+
Revision ID: 2b28a1b95303
4+
Revises: a9227b0cb10b
5+
Create Date: 2025-11-27 17:57:01.394792
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
from alembic import op
12+
import sqlalchemy as sa
13+
14+
15+
# revision identifiers, used by Alembic.
16+
revision: str = "2b28a1b95303"
17+
down_revision: Union[str, None] = "a9227b0cb10b"
18+
branch_labels: Union[str, Sequence[str], None] = None
19+
depends_on: Union[str, Sequence[str], None] = None
20+
21+
22+
def upgrade() -> None:
23+
op.add_column(
24+
"miner_rewards",
25+
sa.Column("prompt_name", sa.Text, server_default="low"),
26+
)
27+
28+
29+
def downgrade() -> None:
30+
op.drop_column("miner_rewards", "prompt_name")

docs/miner_reference.md

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -166,39 +166,6 @@ pm2 start miner.config.js -- --blacklist.validator_min_stake 1000
166166

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

169-
#### `--blacklist.validator_exceptions INTEGER INTEGER INTEGER ...`
170-
171-
Optional list of validator exceptions (e.g., --blacklist.validator_exceptions 0 1 128 162 34 49 38).
172-
173-
Default: `[]`
174-
175-
Example:
176-
177-
```js
178-
// miner.config.js
179-
module.exports = {
180-
apps: [
181-
{
182-
name: "miner",
183-
interpreter: "python3",
184-
script: "./neurons/miner.py",
185-
args: "--blacklist.validator_exceptions 0 1 128 162 34 49 38",
186-
env: {
187-
PYTHONPATH: ".",
188-
},
189-
},
190-
],
191-
};
192-
```
193-
194-
Alternatively, you can add the args directly to the command:
195-
196-
```shell
197-
pm2 start miner.config.js -- --blacklist.validator_exceptions 0 1 128 162 34 49 38
198-
```
199-
200-
<sup>[Back to top ^][table-of-contents]</sup>
201-
202169
#### `--logging.debug`
203170

204171
Turn on bittensor debugging information.

docs/validator_guide.md

Lines changed: 13 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
- [5. Options](#5-options)
1010
- [5.1. Common Options](#51-common-options)
1111
- [`--axon.port INTEGER`](#--axonport-integer)
12-
- [`--ewma.cutoff_days INTEGER`](#--ewmacutoff_days-integer)
13-
- [`--ewma.window_days INTEGER`](#--ewmawindow_days-float)
12+
- [`--ewma.window_days INTEGER`](#--ewmawindow_days-integer)
13+
- [`--softmax.beta FLOAT`](#--softmaxbeta-float)
1414
- [`--logging.debug`](#--loggingdebug)
1515
- [`--logging.info`](#--logginginfo)
1616
- [`--logging.trace`](#--loggingtrace)
@@ -25,7 +25,6 @@
2525
- [`--neuron.sample_size INTEGER`](#--neuronsample_size-integer)
2626
- [`--neuron.timeout INTEGER`](#--neurontimeout-integer)
2727
- [`--neuron.nprocs INTEGER`](#--neuronnprocs-integer)
28-
- [`--neuron.use_multiprocess INTEGER`](#--neuronuse_multiprocess-integer)
2928
- [`--neuron.vpermit_tao_limit INTEGER`](#--neuronvpermit_tao_limit-integer)
3029
- [`--wallet.hotkey TEXT`](#--wallethotkey-text)
3130
- [`--wallet.name TEXT`](#--walletname-text)
@@ -284,45 +283,6 @@ pm2 start validator.test.config.js -- --axon.port 8091
284283

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

287-
#### `--ewma.cutoff_days INTEGER`
288-
289-
The number of days against which to run the moving average, (e.g. 1).
290-
291-
Default: `2`
292-
293-
Example:
294-
295-
```js
296-
// validator.config.js
297-
module.exports = {
298-
apps: [
299-
{
300-
name: "validator",
301-
interpreter: "python3",
302-
script: "./neurons/validator.py",
303-
args: "--ewma.cutoff_days 10",
304-
env: {
305-
PYTHONPATH: ".",
306-
},
307-
},
308-
],
309-
};
310-
```
311-
312-
Alternatively, you can add the args directly to the command:
313-
314-
```shell
315-
pm2 start validator.config.js -- --ewma.cutoff_days 10
316-
```
317-
318-
for testnet it's:
319-
320-
```shell
321-
pm2 start validator.test.config.js -- --ewma.cutoff_days 10
322-
```
323-
324-
<sup>[Back to top ^][table-of-contents]</sup>
325-
326286
#### `--ewma.window_days INTEGER`
327287

328288
The window in days for the rolling average, (e.g. 10).
@@ -358,9 +318,9 @@ pm2 start validator.config.js -- --ewma.window_days 10
358318

359319
#### `--softmax.beta FLOAT`
360320

361-
Negative beta to give higher weight to lower scores.
321+
Negative beta to give higher weight to lower scores for the 1h prompt
362322

363-
Default: `-0.002`
323+
Default: `-0.05`
364324

365325
Example:
366326

@@ -372,7 +332,7 @@ module.exports = {
372332
name: "validator",
373333
interpreter: "python3",
374334
script: "./neurons/validator.py",
375-
args: "--softmax.beta -0.003",
335+
args: "--softmax.beta -0.05",
376336
env: {
377337
PYTHONPATH: ".",
378338
},
@@ -384,7 +344,7 @@ module.exports = {
384344
Alternatively, you can add the args directly to the command:
385345

386346
```shell
387-
pm2 start validator.config.js -- --softmax.beta -0.003
347+
pm2 start validator.config.js -- --softmax.beta -0.05
388348
```
389349

390350
<sup>[Back to top ^][table-of-contents]</sup>
@@ -808,9 +768,9 @@ pm2 start validator.config.js -- --neuron.timeout 120
808768

809769
#### `--neuron.nprocs INTEGER`
810770

811-
The number of processes to run for the validator dendrite, (e.g. 8).
771+
The number of processes to run for the validator dendrite, (e.g. 2).
812772

813-
Default: `8`
773+
Default: `2`
814774

815775
Example:
816776

@@ -819,10 +779,10 @@ Example:
819779
module.exports = {
820780
apps: [
821781
{
822-
name: "validator",
823-
interpreter: "python3",
824-
script: "./neurons/validator.py",
825-
args: "--neuron.nprocs 8",
782+
name: 'validator',
783+
interpreter: 'python3',
784+
script: './neurons/validator.py',
785+
args: '--neuron.nprocs 2',
826786
env: {
827787
PYTHONPATH: ".",
828788
},
@@ -834,7 +794,7 @@ module.exports = {
834794
Alternatively, you can add the args directly to the command:
835795

836796
```shell
837-
pm2 start validator.config.js -- --neuron.nprocs 8
797+
pm2 start validator.config.js -- --neuron.nprocs 2
838798
```
839799

840800
<sup>[Back to top ^][table-of-contents]</sup>
@@ -872,39 +832,6 @@ pm2 start validator.config.js -- --neuron.vpermit_tao_limit 1000
872832

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

875-
#### `--neuron.use_multiprocess INTEGER`
876-
877-
Wether to use multiple processes for the validator dendrite.
878-
879-
Default: `1`
880-
881-
Example to disable multiprocess:
882-
883-
```js
884-
// validator.config.js
885-
module.exports = {
886-
apps: [
887-
{
888-
name: "validator",
889-
interpreter: "python3",
890-
script: "./neurons/validator.py",
891-
args: "--neuron.use_multiprocess 0",
892-
env: {
893-
PYTHONPATH: ".",
894-
},
895-
},
896-
],
897-
};
898-
```
899-
900-
Alternatively, you can add the args directly to the command:
901-
902-
```shell
903-
pm2 start validator.config.js -- --neuron.nprocs 8
904-
```
905-
906-
<sup>[Back to top ^][table-of-contents]</sup>
907-
908835
#### `--wallet.hotkey TEXT`
909836

910837
The hotkey of the wallet.

entrypoint-validator.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ validator_coldkey_name=validator
1010
validator_hotkey_name=default
1111

1212
ewma_window_days=10
13-
ewma_cutoff_days=10
14-
softmax_beta=-0.1
13+
softmax_beta=-0.05
1514

1615
log_id_prefix=my_validator_name
1716

@@ -23,7 +22,6 @@ python3.10 ./neurons/validator.py \
2322
--logging.debug \
2423
--neuron.axon_off true \
2524
--ewma.window_days $ewma_window_days \
26-
--ewma.cutoff_days $ewma_cutoff_days \
2725
--softmax.beta $softmax_beta \
2826
--neuron.vpermit_tao_limit $vpermit_tao_limit \
2927
--gcp.log_id_prefix $log_id_prefix \

neurons/miner.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,12 @@ async def blacklist(self, synapse: Simulation) -> typing.Tuple[bool, str]:
106106
uid = self.metagraph.hotkeys.index(synapse.dendrite.hotkey)
107107
stake = self.metagraph.S[uid]
108108
bt.logging.info(f"Requesting UID: {uid} | Stake at UID: {stake}")
109-
bt.logging.debug(
110-
f"Whitelisted validators: {self.config.blacklist.validator_exceptions}"
111-
)
112-
113-
if uid in self.config.blacklist.validator_exceptions:
109+
if stake <= self.config.blacklist.validator_min_stake:
110+
# Ignore requests if the stake is below minimum
114111
bt.logging.info(
115-
f"Requesting UID: {uid} whitelisted as a validator"
112+
f"Hotkey: {synapse.dendrite.hotkey}: stake below minimum threshold of {self.config.blacklist.validator_min_stake}"
116113
)
117-
else:
118-
if stake <= self.config.blacklist.validator_min_stake:
119-
# Ignore requests if the stake is below minimum
120-
bt.logging.info(
121-
f"Hotkey: {synapse.dendrite.hotkey}: stake below minimum threshold of {self.config.blacklist.validator_min_stake}"
122-
)
123-
return True, "Stake below minimum threshold"
114+
return True, "Stake below minimum threshold"
124115

125116
if self.config.blacklist.force_validator_permit:
126117
# If the config is set to force validator permit, then we should only allow requests from validators.
@@ -182,7 +173,7 @@ def load_state(self):
182173
def set_weights(self):
183174
pass
184175

185-
async def forward_validator(self):
176+
def forward_validator(self):
186177
pass
187178

188179
def print_info(self):

0 commit comments

Comments
 (0)