Skip to content

Commit

Permalink
comment out set_weights
Browse files Browse the repository at this point in the history
  • Loading branch information
derekawender committed Feb 24, 2025
1 parent ab3c4b7 commit 9362ae6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion neurons/backtest_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, positions_at_t_f, start_time_ms, secrets, scoring_func, rebui

self.weight_setter = SubtensorWeightSetter(self.metagraph, position_manager=self.position_manager, is_backtesting=True)
self.position_locks = PositionLocks(hotkey_to_positions=positions_at_t_f)
self.plagiarism_detector = PlagiarismDetector(btm.metagraph)
self.plagiarism_detector = PlagiarismDetector(self.metagraph)
self.miner_statistics_manager = MinerStatisticsManager(position_manager=self.position_manager, subtensor_weight_setter=self.weight_setter, plagiarism_detector=self.plagiarism_detector)

self.init_order_queue_and_current_positions(self.start_time_ms, positions_at_t_f, rebuild_all_positions=rebuild_all_positions)
Expand Down
12 changes: 5 additions & 7 deletions vali_objects/utils/subtensor_weight_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ def compute_weights_default(self, current_time: int) -> tuple[list[tuple[str, fl
filtered_ledger = self.perf_ledger_manager.filtered_ledger_for_scoring(hotkeys=hotkeys_to_compute_weights_for)
filtered_positions, _ = self.position_manager.filtered_positions_for_scoring(hotkeys=hotkeys_to_compute_weights_for)

# synced_ledger, synced_positions = self.sync_ledger_positions(
# filtered_ledger,
# filtered_positions
# )

if len(filtered_ledger) == 0:
bt.logging.info("No returns to set weights with. Do nothing for now.")
return [], []
Expand Down Expand Up @@ -100,8 +95,8 @@ def compute_weights_default(self, current_time: int) -> tuple[list[tuple[str, fl
bt.logging.info(f"transformed list: {transformed_list}")
if block_reg_failures:
bt.logging.info(f"Miners with registration blocks after target DTAO block: {block_reg_failures}")

self._set_subtensor_weights(wallet, subtensor, transformed_list, netuid)
if not self.is_backtesting:
self._set_subtensor_weights(wallet, subtensor, netuid)
return checkpoint_results, transformed_list
def _store_weights(self, checkpoint_results: list[tuple[str, float]], transformed_list: list[tuple[str, float]]):
self.checkpoint_results = checkpoint_results
Expand All @@ -111,6 +106,9 @@ def _store_weights(self, checkpoint_results: list[tuple[str, float]], transforme
def set_weights(self, wallet, netuid, subtensor, current_time: int = None, scoring_function: callable = None, scoring_func_args: dict = None):
if not self.refresh_allowed(ValiConfig.SET_WEIGHT_REFRESH_TIME_MS):
return
#TODO remove this
if self.is_backtesting:
return [], []
bt.logging.info("running set weights")
if scoring_func_args is None:
scoring_func_args = {'current_time': current_time}
Expand Down

0 comments on commit 9362ae6

Please sign in to comment.