Skip to content

Commit 04090ba

Browse files
authored
Merge pull request #333 from macrocosm-os/staging
remove miner serving flag Features/remove miner serving #332
2 parents 5c296cf + 74e72d1 commit 04090ba

File tree

6 files changed

+4
-21
lines changed

6 files changed

+4
-21
lines changed

folding/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from .protocol import JobSubmissionSynapse
22
from .validators.protein import Protein
33

4-
__version__ = "1.4.4"
4+
__version__ = "1.4.5"
55
version_split = __version__.split(".")
66
__spec_version__ = (10000 * int(version_split[0])) + (100 * int(version_split[1])) + (1 * int(version_split[2]))
77

folding/miners/folding_miner.py

-4
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,7 @@ def forward(self, synapse: JobSubmissionSynapse) -> JobSubmissionSynapse:
280280
)
281281

282282
logger.warning(f"❗ Removing miner from job pool ❗")
283-
284283
event["condition"] = "cpu_limit_reached"
285-
synapse.miner_serving = False
286-
287284
return check_synapse(self=self, synapse=synapse, event=event)
288285

289286
# The set of RUNNING simulations.
@@ -327,7 +324,6 @@ def forward(self, synapse: JobSubmissionSynapse) -> JobSubmissionSynapse:
327324
# If the state is failed, we should not return the files.
328325
if state == "failed":
329326
synapse.miner_state = state
330-
synapse.miner_serving = False
331327
event["condition"] = "failed_simulation"
332328
event["state"] = state
333329
logger.warning(

folding/protocol.py

-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class JobSubmissionSynapse(bt.Synapse):
4141
- pdb_id: A Protein id, which contains the necessary details of the protein to be folded.
4242
- md_inputs: A dictionary containing the input files for the openmm simulation.
4343
- system_config: A dictionary containing the system configuration for the simulation.
44-
- miner_serving: A boolean value which determines if the miner can serve the request.
4544
- md_output: A dictionary containing the output files of the openmm simulation.
4645
- miner_seed: An integer value which is the seed for the simulation.
4746
- miner_state: A string value which is the state of the miner.
@@ -52,9 +51,6 @@ class JobSubmissionSynapse(bt.Synapse):
5251
md_inputs: dict # Right now this is just a "em.cpt" file.
5352
system_config: dict = {}
5453

55-
# Miner can decide if they are serving the request or not.
56-
miner_serving: bool = True
57-
5854
best_submitted_energy: typing.Optional[float] = None
5955

6056
# Optional request output, filled by receiving axon.

folding/utils/ops.py

-3
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ def get_response_info(responses: List[JobSubmissionSynapse]) -> Dict:
289289
response_status_codes = []
290290
response_returned_files = []
291291
response_returned_files_sizes = []
292-
response_miners_serving = []
293292

294293
for resp in responses:
295294
if resp.dendrite.process_time != None:
@@ -301,15 +300,13 @@ def get_response_info(responses: List[JobSubmissionSynapse]) -> Dict:
301300
response_status_codes.append(str(resp.dendrite.status_code))
302301
response_returned_files.append(list(resp.md_output.keys()))
303302
response_returned_files_sizes.append(list(map(len, resp.md_output.values())))
304-
response_miners_serving.append(resp.miner_serving)
305303

306304
return {
307305
"response_times": response_times,
308306
"response_status_messages": response_status_messages,
309307
"response_status_codes": response_status_codes,
310308
"response_returned_files": response_returned_files,
311309
"response_returned_files_sizes": response_returned_files_sizes,
312-
"response_miners_serving": response_miners_serving,
313310
}
314311

315312

neurons/validator.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,6 @@ async def update_job(self, job: Job):
281281
top_reward = 0.80
282282
apply_pipeline = False
283283

284-
# There could be hotkeys that have decided to stop serving. We need to remove them from the store.
285-
serving_hotkeys = []
286-
for ii, state in enumerate(job.event["response_miners_serving"]):
287-
if state:
288-
serving_hotkeys.append(job.hotkeys[ii])
289-
290284
energies = torch.Tensor(job.event["energies"])
291285
rewards = torch.zeros(len(energies)) # one-hot per update step
292286

@@ -299,10 +293,10 @@ async def update_job(self, job: Job):
299293

300294
best_index = np.argmin(energies)
301295
best_loss = energies[best_index].item() # item because it's a torch.tensor
302-
best_hotkey = serving_hotkeys[best_index]
296+
best_hotkey = job.hotkeys[best_index]
303297

304298
await job.update(
305-
hotkeys=serving_hotkeys,
299+
hotkeys=job.hotkeys,
306300
loss=best_loss,
307301
hotkey=best_hotkey,
308302
)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "folding"
3-
version = "1.4.4"
3+
version = "1.4.5"
44
description = "Macrocosmos Subnet 25: Folding"
55
authors = ["Brian McCrindle <[email protected]>", "Sergio Champoux <[email protected]>", "Szymon Fonau <[email protected]>"]
66

0 commit comments

Comments
 (0)