Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hofix: error sum of weights in root subnet if any subnet does not exist #1909

Open
roman-opentensor opened this issue May 20, 2024 · 0 comments · Fixed by #1900
Open

Hofix: error sum of weights in root subnet if any subnet does not exist #1909

roman-opentensor opened this issue May 20, 2024 · 0 comments · Fixed by #1900
Assignees
Labels
bug Something isn't working

Comments

@roman-opentensor
Copy link
Contributor

roman-opentensor commented May 20, 2024

Describe the bug

If the subnet does not exist, then the sum of the weights in the network root is not calculated, but raises an error.

To Reproduce

With bittensor version 6.12 run the code:

import bittensor as bt

sub = bt.subtensor()
meta = sub.metagraph(netuid=0, lite=False)

Expected behavior

This raises error:

│ ❱ 762 │   │   │   │   │   bittensor.utils.weight_utils.convert_root_weight_uids_and_vals_to_te   │
│   763 │   │   │   │   │   │   n_subnets, list(uids), list(values), subnets                       │
│   764 │   │   │   │   │   )                                                                      │
│   765 │   │   │   │   )                                                                          │
│                                                                                                  │
│ /home/athrun/.bittensor/bittensor/bittensor/utils/weight_utils.py:129 in                         │
│ convert_root_weight_uids_and_vals_to_tensor                                                      │
│                                                                                                  │
│   126 │   │   if uid_j in subnets:                                                               │
│   127 │   │   │   index_s = subnets.index(uid_j)                                                 │
│   128 │   │   else:                                                                              │
│ ❱ 129 │   │   │   raise Exception("Incorrect Subnet {uid_j} in {subnets}")                       │
│   130 │   │   row_weights[index_s] = float(                                                      │
│   131 │   │   │   wij                                                                            │
│   132 │   │   )  # assumes max-upscaled values (w_max = U16_MAX).                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
Exception: Incorrect Subnet {uid_j} in {subnets}

Environment

any os

@roman-opentensor roman-opentensor added the bug Something isn't working label May 20, 2024
@roman-opentensor roman-opentensor changed the title Hofix: Hofix: error sum of weights in root subnet if any subnet does not exist May 20, 2024
@roman-opentensor roman-opentensor self-assigned this May 20, 2024
@roman-opentensor roman-opentensor linked a pull request May 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant