Skip to content

Commit fc21bde

Browse files
committed
Merge release/7.0.0
2 parents 7cccbb9 + ba0f6ba commit fc21bde

File tree

140 files changed

+98975
-526193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+98975
-526193
lines changed

README.md

+38-41
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ btcli subnet register --subtensor.network finney --netuid 2 --wallet.name {your_
5050

5151
### Run the miner
5252

53+
<details>
54+
<summary>Docker Instructions (not supported during the competition running from Feb 6 - Apr 20)</summary>
5355
#### With docker compose (recommended)
5456

5557
```yaml
@@ -96,36 +98,30 @@ docker run -d \
9698
--wallet.hotkey {your_miner_hotkey_name} \
9799
--netuid 2
98100
```
101+
</details>
99102

100103
#### With pm2
101104

102105
> [!IMPORTANT]
103-
> Ensure you are within the `/neurons` directory before using the commands below to start your miner
106+
> Ensure you are within the `./neurons` directory before using the commands below to start your miner
104107
>
105108
> ```console
106109
> cd neurons
107110
> ```
108111
109-
##### Within a virtual environment
110-
111112
```console
112-
pm2 start miner.py --name miner --interpreter ../omron-venv/bin/python --kill-timeout 3000 -- \
113+
pm2 start miner.py --name miner --interpreter ../.venv/bin/python --kill-timeout 3000 -- \
113114
--netuid 2 \
114115
--wallet.name {your_miner_key_name} \
115116
--wallet.hotkey {your_miner_hotkey_name}
116117
```
117118
118-
##### Outside of a virtual environment
119-
120-
```console
121-
pm2 start miner.py --name miner --interpreter python3 --kill-timeout 3000 -- \
122-
--netuid 2 \
123-
--wallet.name {your_miner_key_name} \
124-
--wallet.hotkey {your_miner_hotkey_name}
125-
```
119+
Or run this command with `make pm2-miner WALLET_NAME={your_miner_key_name} HOTKEY_NAME={your_miner_hotkey_name}`
126120

127121
### Run the validator
128122

123+
<details>
124+
<summary>Docker Instructions (not supported during the competition running from Feb 6 - Apr 20)</summary>
129125
#### With docker compose (recommended)
130126

131127
```yaml
@@ -174,38 +170,33 @@ docker run -d \
174170
--wallet.hotkey {validator_hot_key_name} \
175171
--netuid 2
176172
```
173+
</details>
177174

178175
#### With pm2
179176

180177
> [!IMPORTANT]
181-
> Ensure you are within the `/neurons` directory before using the commands below to start your validator
178+
> Ensure you are within the `./neurons` directory before using the commands below to start your validator
182179
>
183180
> ```console
184181
> cd neurons
185182
> ```
186183
187-
##### Within a virtual environment
188-
189184
```console
190-
pm2 start validator.py --name validator --interpreter ../omron-venv/bin/python --kill-timeout 3000 -- \
185+
pm2 start validator.py --name validator --interpreter ../.venv/bin/python --kill-timeout 3000 -- \
191186
--netuid 2 \
192-
--wallet.name {validator_key_name} \
193-
--wallet.hotkey {validator_hot_key_name}
187+
--wallet.name {your_validator_key_name} \
188+
--wallet.hotkey {your_validator_hotkey_name}
194189
```
195190
196-
##### Outside of a virtual environment
197-
198-
```console
199-
pm2 start validator.py --name validator --interpreter python3 --kill-timeout 3000 -- \
200-
--netuid 2 \
201-
--wallet.name {validator_key_name} \
202-
--wallet.hotkey {validator_hot_key_name}
203-
```
191+
Or run this command with `make pm2-validator WALLET_NAME={validator_key_name} HOTKEY_NAME={validator_hot_key_name}`
204192

205193
## Miner
206194

207195
Miners contribute to this subnet by providing compute to generate output from, and prove AI model inferences. Miners receive workloads from validators in the form of input data, perform verified inferences on those inputs and respond with output along with a zero knowledge proof of inference.
208196

197+
> [!IMPORTANT]
198+
> As of February 2025, the miner **should** be run on a bare-metal MacOS machine with support for Metal GPU acceleration, to optimize for performance.
199+
209200
### Hardware requirements
210201

211202
#### Minimum
@@ -238,23 +229,29 @@ Validators are responsible for verifying model outputs as provided by miners, an
238229

239230
### Hardware requirements
240231

232+
> [!IMPORTANT]
233+
> As of February 2025, the validator **must** be run on a bare-metal MacOS machine with support for Metal GPU acceleration.
234+
235+
Though AWS instances for metal are recommended, any MacOS machine with a Metal GPU is sufficient.
236+
241237
#### Minimum
242238

243-
| Component | Requirement |
244-
| ------------ | ------------- |
245-
| CPU | 8 core 3.2GHz |
246-
| RAM | 16GB |
247-
| Network Up | 400Mbps |
248-
| Network Down | 400Mbps |
249-
| Storage | 1TB |
239+
| Component | Requirement |
240+
| ------------ | ---------------------- |
241+
| Instance | mac2-m2pro.metal (AWS) |
242+
| CPU | Apple M2 Pro (12-core) |
243+
| RAM | 32GB |
244+
| Network Up | 10Gbps |
245+
| Network Down | 10Gbps |
246+
| Storage | 2TB SSD |
250247

251248
#### Recommended
252249

253-
| Component | Recommendation |
254-
| -------------- | -------------- |
255-
| CPU | 8 core 3.4GHz |
256-
| RAM | 32GB |
257-
| Network Up | 1+Gbps |
258-
| Network Down | 1+Gbps |
259-
| Storage | 2+TB |
260-
| Storage Medium | SSD |
250+
| Component | Recommendation |
251+
| ------------ | ------------------------ |
252+
| Instance | mac2-m1ultra.metal (AWS) |
253+
| CPU | Apple M1 Ultra (20-core) |
254+
| RAM | 128GB |
255+
| Network Up | 10Gbps |
256+
| Network Down | 10Gbps |
257+
| Storage | 2TB+ SSD |

competition_circuit/.gitkeep

Whitespace-only changes.

docs/command_line_arguments.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The below arguments are specific to miner software and have no effect on validat
2121

2222
| Argument | Required | Default | Accepted Values | Description |
2323
| --------------------- | :------: | ------- | --------------- | ------------------------------------------------------------ |
24-
| `--disable-blacklist` | No | `False` | `True`, `False` | Disables request filtering and allows all incoming requests. |
24+
| `--disable-blacklist` | No | `False` | `True`, `False` | Disables request filtering and allows all incoming requests. |
2525

2626
### Validator specific arguments
2727

@@ -37,6 +37,7 @@ The below arguments are specific to validator software and have no effect on min
3737
| `--external-api-workers` | No | `1` | Integer | The number of workers for the validator's external API. |
3838
| `--external-api-host` | No | `0.0.0.0` | String | The host for the validator's external API. |
3939
| `--do-not-verify-external-signatures` | No | `False` | `True`, `False` | External PoW requests are signed by validator's (sender's) wallet. By default, these are checked to ensure legitimacy. This should only be disabled in controlled development environments. |
40+
| `--competition-sync-interval` | No | `86400` | Integer | The interval for syncing the competition in seconds. Defaults to 86400 (1 day). |
4041
| `--prometheus-monitoring` | No | `False` | `True`, `False` | Whether to enable sering of metrics for Prometheus monitoring. |
4142
| `--prometheus-port` | No | `9090` | Integer | The port for the Prometheus data source. |
4243
| `--serve-axon` | No | `False` | `True`, `False` | Whether to serve the axon displaying your API information. |
@@ -66,8 +67,8 @@ Bittensor subtensor configuration options.
6667

6768
| Argument | Required | Default | Accepted Values | Description |
6869
| ---------------------------- | :------: | ------------------ | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
69-
| `--subtensor.network` | No | `finney` | `finney`, `test`, `archive`, `local` | The subtensor network to connect to. Overrides `--subtensor.chain_endpoint` with a default node from the selected network. |
70-
| `--subtensor.chain_endpoint` | No | Depends on network | String | The specific blockchain endpoint to connect to. Overrides the network default endpoint if set. |
70+
| `--subtensor.network` | No | `finney` | `finney`, `test`, `archive`, `local` | The subtensor network to connect to. Overrides `--subtensor.chain_endpoint` with a default node from the selected network. |
71+
| `--subtensor.chain_endpoint` | No | Depends on network | String | The specific blockchain endpoint to connect to. Overrides the network default endpoint if set. |
7172
| `--subtensor._mock` | No | `False` | `True`, `False` | If true, uses a mocked connection to the chain for testing purposes. |
7273

7374
### Axon
@@ -82,7 +83,6 @@ Bittensor Axon configuration options.
8283
| `--axon.ip` | No | `[::]` | String | The local IP this axon binds to. |
8384
| `--axon.external_port` | No | None | Integer | The public port this axon broadcasts to the network. |
8485
| `--axon.external_ip` | No | None | String | The external IP this axon broadcasts to the network. |
85-
| `--axon.max_workers` | No | 10 | Integer | The maximum number of connection handler threads working simultaneously on this endpoint. |
8686

8787
### Logging
8888

@@ -94,5 +94,5 @@ Bittensor logging configuration options.
9494
| ----------------------- | :------: | -------------------- | --------------- | ------------------------------------------ |
9595
| `--logging.debug` | No | `False` | `True`, `False` | Turn on bittensor debugging information. |
9696
| `--logging.trace` | No | `False` | `True`, `False` | Turn on bittensor trace level information. |
97-
| `--logging.record_log` | No | `False` | `True`, `False` | Turns on logging to file. |
97+
| `--logging.record_log` | No | `False` | `True`, `False` | Turns on logging to file. |
9898
| `--logging.logging_dir` | No | `~/.bittensor/logs/` | String | Logging default root directory. |

docs/competitions.md

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Omron Competitions Framework
2+
3+
🥩 **Competitions Overview**
4+
Omron's competition system drives innovation in zkML performance by creating structured challenges where miners optimize circuits for specific tasks. Competitions leverage Omron's Proof-of-Inference mechanism([1](https://docs.omron.ai/intro-to-omron)) to verify miner submissions while maintaining computational integrity.
5+
6+
## Competition Lifecycle
7+
8+
### Phases
9+
10+
1. **Pending**
11+
12+
- Competition scheduled but not yet active
13+
- Baseline model and evaluation criteria published
14+
- Miners prepare circuits using competition template
15+
16+
2. **Active**
17+
18+
- Open submission period (typically 7-14 days)
19+
- Real-time leaderboard tracking
20+
- Continuous circuit evaluation
21+
22+
3. **Completed**
23+
24+
- Final scores calculated
25+
- Rewards distributed
26+
- SOTA circuit preserved for future benchmarking
27+
28+
4. **Inactive**
29+
- Between competition periods
30+
- Historical data analysis
31+
- Preparation for next challenge
32+
33+
## Miner Participation
34+
35+
### Requirements
36+
37+
- Submit optimized zk-circuits matching competition template
38+
- Meet minimum hardware specs([2](https://docs.omron.ai/miner-validator-resources))
39+
40+
### Submission Process
41+
42+
1. Clone competition circuit template
43+
2. Optimize model while maintaining I/O spec
44+
3. Generate verification artifacts:
45+
- `settings.json
46+
- `model.compiled`
47+
- `vk.key`
48+
- `pk.key`
49+
4. Commit circuit to the blockchain
50+
51+
## Evaluation Criteria
52+
53+
| Metric | Weight | Description |
54+
| ------------- | ------ | ----------------------------------- |
55+
| Accuracy | 40% | Output similarity vs baseline model |
56+
| Proof Size | 30% | Byte size of generated ZK proofs |
57+
| Response Time | 30% | End-to-end proof generation latency |
58+
59+
> [!CAUTION]
60+
> Should any proofs fail to verify, the miner will be assigned a zero score.
61+
62+
## Competition Management
63+
64+
### Key Features
65+
66+
- Automatic state transitions
67+
- Real-time metrics tracking
68+
- Fraud detection via proof verification
69+
70+
### Monitoring
71+
72+
- WandB integration for performance tracking
73+
- Public leaderboard on Omron dashboard
74+
- Daily score snapshots
75+
76+
## Risks
77+
78+
- Invalid proofs result in immediate disqualification
79+
- Late submissions not accepted after end timestamp
80+
81+
**Links**
82+
[Technical Roadmap](https://docs.omron.ai/technical-roadmap)[Miner Setup](https://docs.omron.ai/miner-validator-resources)[zkML Documentation](https://docs.omron.ai/custom_circuit_integrations)

docs/running_on_mainnet.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ Run the following command to start a miner on mainnet
1414

1515
```console
1616
cd neurons
17-
pm2 start miner.py --name miner --interpreter python3 -- \
17+
pm2 start miner.py --name miner --interpreter ../.venv/bin/python -- \
1818
--netuid 2 \
1919
--wallet.name {your_miner_key_name} \
2020
--wallet.hotkey {your_miner_hotkey_name}
2121
```
2222

23+
Or run this command with `make pm2-miner WALLET_NAME={your_miner_key_name} HOTKEY_NAME={your_miner_hotkey_name}`
24+
2325
[View all acceptable CLI arguments →]
2426

2527
## Validating
@@ -28,12 +30,14 @@ Run the following command to start a validator on mainnet
2830

2931
```console
3032
cd neurons
31-
pm2 start validator.py --name validator --interpreter python3 -- \
33+
pm2 start validator.py --name validator --interpreter ../.venv/bin/python -- \
3234
--netuid 2 \
3335
--wallet.name {your_validator_key_name} \
3436
--wallet.hotkey {your_validator_hotkey_name}
3537
```
3638

39+
Or run this command with `make pm2-validator WALLET_NAME={validator_key_name} HOTKEY_NAME={validator_hot_key_name}`
40+
3741
[View all acceptable CLI arguments →]
3842

3943
[View all acceptable CLI arguments →]: ./command_line_arguments.md

docs/running_on_staging.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
This tutorial will guide you through setting up a local subtensor chain, creating a subnetwork, and connecting your mechanism to it.
44

5+
> [!TIP]
6+
> The devcontainer provided in this repository already takes care of everything in this tutorial for you.
7+
58
### 1. Install substrate dependencies
69

710
Begin by installing the required dependencies for running a substrate node.

docs/running_on_testnet.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ Run the following command to start a miner on testnet
1414

1515
```console
1616
cd neurons
17-
pm2 start miner.py --name miner --interpreter python3 -- \
17+
pm2 start miner.py --name miner --interpreter ../.venv/bin/python -- \
1818
--netuid 118 \
1919
--wallet.name {your_miner_key_name} \
2020
--wallet.hotkey {your_miner_hotkey_name} \
2121
--subtensor.network test
2222
```
2323

24+
Or run this command with `make pm2-test-miner WALLET_NAME={your_miner_key_name} HOTKEY_NAME={your_miner_hotkey_name}`
25+
2426
[View all acceptable CLI arguments →]
2527

2628
## Validating
@@ -29,13 +31,15 @@ Run the following command to start a validator on testnet
2931

3032
```console
3133
cd neurons
32-
pm2 start validator.py --name validator --interpreter python3 -- \
34+
pm2 start validator.py --name validator --interpreter ../.venv/bin/python -- \
3335
--netuid 118 \
3436
--wallet.name {your_validator_key_name} \
3537
--wallet.hotkey {your_validator_hotkey_name} \
3638
--subtensor.network test
3739
```
3840

41+
Or run this command with `make pm2-test-validator WALLET_NAME={validator_key_name} HOTKEY_NAME={validator_hot_key_name}`
42+
3943
[View all acceptable CLI arguments →]
4044

4145
[View all acceptable CLI arguments →]: ./command_line_arguments.md

makefile

+46
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,49 @@ test-validator:
100100
--wallet.hotkey $(WALLET_HOTKEY) \
101101
--netuid 118 \
102102
--subtensor.network test
103+
104+
pm2-setup:
105+
INSTALL_PATH="." ./setup.sh
106+
107+
pm2-stop:
108+
pm2 stop omron-miner || true
109+
pm2 stop omron-validator || true
110+
111+
pm2-miner:
112+
uv sync --locked --no-dev
113+
cd neurons; \
114+
pm2 start miner.py --name omron-miner --interpreter ../.venv/bin/python --kill-timeout 3000 -- \
115+
--wallet.path $(WALLET_PATH) \
116+
--wallet.name $(WALLET_NAME) \
117+
--wallet.hotkey $(WALLET_HOTKEY) \
118+
--netuid $(NETUID)
119+
120+
pm2-validator:
121+
uv sync --locked --no-dev
122+
cd neurons; \
123+
pm2 start validator.py --name omron-validator --interpreter ../.venv/bin/python --kill-timeout 3000 -- \
124+
--wallet.path $(WALLET_PATH) \
125+
--wallet.name $(WALLET_NAME) \
126+
--wallet.hotkey $(WALLET_HOTKEY) \
127+
--netuid $(NETUID)
128+
129+
pm2-test-miner:
130+
uv sync --locked --no-dev
131+
cd neurons; \
132+
pm2 start miner.py --name omron-miner --interpreter ../.venv/bin/python --kill-timeout 3000 -- \
133+
--wallet.path $(WALLET_PATH) \
134+
--wallet.name $(WALLET_NAME) \
135+
--wallet.hotkey $(WALLET_HOTKEY) \
136+
--netuid 118 \
137+
--subtensor.network test \
138+
--disable-blacklist
139+
140+
pm2-test-validator:
141+
uv sync --locked --no-dev
142+
cd neurons; \
143+
pm2 start validator.py --name omron-validator --interpreter ../.venv/bin/python --kill-timeout 3000 -- \
144+
--wallet.path $(WALLET_PATH) \
145+
--wallet.name $(WALLET_NAME) \
146+
--wallet.hotkey $(WALLET_HOTKEY) \
147+
--netuid 118 \
148+
--subtensor.network test

0 commit comments

Comments
 (0)