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

Release/3.3.4 #927

Merged
merged 33 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
782dc3e
[feature] external axon flags (#887)
Sep 5, 2022
4772122
[fix] fixes unstake with max-stake flag (#905)
Sep 6, 2022
a778fb8
Merge remote-tracking branch 'origin/master' into nobunaga
Eugene-hu Sep 6, 2022
0afe907
local train bug fix (#906)
Eugene-hu Sep 7, 2022
4bfb69b
[feature] [CUDA solver] Add multi-GPU and ask for CUDA during btcli r…
Sep 9, 2022
7f9d1f4
[Docs] Update old docs link to new link. Change discord invite to cus…
Sep 14, 2022
c62a81d
Fix for test_neuron.py (#917)
Eugene-hu Sep 14, 2022
f9da8f1
[feature] add --seed option to regen_hotkey (#916)
Sep 15, 2022
816a00c
circle ci version update and fix (#920)
Eugene-hu Sep 20, 2022
f34283c
Add test_phrases_split unit test
opentaco Sep 20, 2022
46b580c
Update unravel_topk_token_phrases with faster implementation
opentaco Sep 20, 2022
d6c3a97
Merge branch 'nobunaga' into feature/BIT-574/deserialization_speed_up_v2
opentaco Sep 20, 2022
cc84c75
Rename test_phrases_split to test_random_topk_token_phrases
opentaco Sep 21, 2022
73256bd
Merge remote-tracking branch 'origin/feature/BIT-574/deserialization_…
opentaco Sep 21, 2022
2415446
Unit tests cleanup (#922)
Eugene-hu Sep 21, 2022
946ac4f
Merge branch 'nobunaga' into feature/BIT-574/deserialization_speed_up_v2
opentaco Sep 22, 2022
e5a41eb
Merge pull request #921 from opentensor/feature/BIT-574/deserializati…
opentaco Sep 22, 2022
e9d8275
Deactivate test_random_topk_token_phrases unit test
opentaco Sep 23, 2022
58adeae
Create topk_tensor on origin device
opentaco Sep 23, 2022
e988cd9
Merge pull request #925 from opentensor/feature/BIT-587/deactivate-un…
opentaco Sep 23, 2022
9b5190f
Merge branch 'nobunaga' into feature/BIT-588/device_unravel_topk_toke…
opentaco Sep 23, 2022
1a2aad9
Merge pull request #926 from opentensor/feature/BIT-588/device_unrave…
opentaco Sep 23, 2022
3990a28
Normalization Update (#909)
Eugene-hu Sep 23, 2022
e9a847d
Adding development workflow documentation and script for bumping the …
eduardogr Sep 23, 2022
7efa4fa
Updated version 3.3.4
Eugene-hu Sep 23, 2022
0ff949a
Merge remote-tracking branch 'origin/master' into release/3.3.4
Eugene-hu Sep 23, 2022
00bc477
Revert "Normalization Update (#909)"
Eugene-hu Sep 26, 2022
0e71a4a
Merge remote-tracking branch 'origin/nobunaga' into release/3.3.4
Eugene-hu Sep 26, 2022
89111b6
version update
Eugene-hu Sep 26, 2022
c85814f
memory fix to release (#932)
isabella618033 Sep 29, 2022
4bacd91
use force on set_start_method
camfairchild Sep 30, 2022
b533538
[fix] Enable the stake blacklist (#931)
Oct 3, 2022
e7240ef
[Fix] use with env to reset start method after (#935)
Oct 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ workflows:
- build-and-test:
matrix:
parameters:
python-version: ["3.7", "3.8", "3.9", "3.10.5"]
python-version: ["3.7.14", "3.8.14", "3.9.13", "3.10.6"]
- unit-tests-all-python-versions:
requires:
- build-and-test
Expand Down
29 changes: 14 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

The following is a set of guidelines for contributing to Bittensor, which are hosted in the [Opentensor Organization](https://github.com/opentensor) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

#### Table Of Contents
## Table Of Contents

[I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)

[What should I know before I get started?](#what-should-i-know-before-i-get-started)

[How Can I Contribute?](#how-can-i-contribute)
* [Reporting Bugs](#reporting-bugs)
* [Suggesting Enhancements](#suggesting-enhancements)
* [Your First Code Contribution](#your-first-code-contribution)
* [Pull Requests](#pull-requests)
1. [I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
1. [What should I know before I get started?](#what-should-i-know-before-i-get-started)
1. [How Can I Contribute?](#how-can-i-contribute)
1. [Reporting Bugs](#reporting-bugs)
1. [Suggesting Enhancements](#suggesting-enhancements)
1. [Your First Code Contribution](#your-first-code-contribution)
1. [Pull Requests](#pull-requests)
1. [Development-Workflow](#development-workflow)

## I don't want to read this whole thing I just have a question!!!

Expand Down Expand Up @@ -122,10 +121,10 @@ The process described here has several goals:

Please follow these steps to have your contribution considered by the maintainers:

1. Follow all instructions in [the template](https://github.com/opentensor/bittensor/blob/master/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md)
2. Follow the [styleguides](#styleguides)
3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing <details><summary>What if the status checks are failing?</summary>If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.</details>
1. Before the PR.
1. Read the [development workflow](./DEVELOPMENT_WORKFLOW.md) defined for this repository in order to agree on the ways of working.
1. While coding, please, add tests relevant to the fixed bug or new feature.
1. To create the PR follow all instructions in [the template](https://github.com/opentensor/bittensor/blob/master/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md)
1. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing <details><summary>What if the status checks are failing?</summary>If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.</details>

While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.


164 changes: 164 additions & 0 deletions DEVELOPMENT_WORKFLOW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Development Workflow

## Table of contents

1. [Main branches](#main-branches)
1. [Development model](#development-model)
1. [Supporting branches](#supporting-branches)
1. [Feature branches](#feature-branches)
1. [Release branches](#release-branches)
1. [Hotfix branches](#hotfix-branches)
1. [Git operations](#git-operations)
1. [Create a feature branch](#create-a-feature-branch)
1. [Merge feature branch into nobunaga](#merge-feature-branch-into-nobunaga)
1. [Create release branch](#create-release-branch)
1. [Finish a release branch](#finish-a-release-branch)
1. [Create a hotfix branch](#create-a-hotfix-branch)
1. [Finishing a hotfix branch](#finishing-a-hotfix-branch)

## Main branches

The repo holds two main branches with an infinite lifetime:
- master
- nobunaga

We consider `origin/master` to be the main branch where the source code of HEAD always reflects a **__production-ready__** state.

We consider `origin/nobunaga` to be the main branch where the source code of HEAD always reflects a state with the **__latest delivered development__** changes for the next release. Some would call this the `"integration branch"`. This is where any automatic nightly builds would be built from.

## Development model

### Supporting branches

Each of these branches have a specific purpose and are bound to strict rules as to which branches may be their originating branch and which branches must be their merge targets. We will walk through them in a minute

#### Feature branches

- May branch off from: `nobunaga`
- Must merge back into: `nobunaga`
- Branch naming convention:
- Anything except master, nobunaga, nakamoto, release/* or hotfix/*
- Suggested: `feature/<ticket>/<descriptive-sentence>`

Feature branches are used to develop new features for the upcoming or a distant future release. When starting development of a feature, the target release in which this feature will be incorporated may well be unknown at that point.

The essence of a feature branch is that it exists as long as the feature is in development, but will eventually be merged back into `nobunaga` (to definitely add the new feature to the upcoming release) or discarded (in case of a disappointing experiment).

#### Release branches

- May branch off from: `nobunaga`
- Must merge back into: `nobunaga` and `master`
- Branch naming convention:
- Suggested format `release/3.4.0/optional-descriptive-message`

Release branches support preparation of a new production release. Furthermore, they allow for minor bug fixes and preparing meta-data for a release (e.g.: version number, configuration, etc.). By doing all of this work on a release branch, the `nobunaga` branch is cleared to receive features for the next big release.

This new branch may exist there for a while, until the release may be rolled out definitely. During that time, bug fixes may be applied in this branch, rather than on the `nobunaga` branch. Adding large new features here is strictly prohibited. They must be merged into `nobunaga`, and therefore, wait for the next big release.

#### Hotfix branches

- May branch off from: `master`
- Must merge back into: `nobunaga` and `master`
- Branch naming convention:
- Suggested format: `hotfix/3.3.4/optional-descriptive-message`

Hotfix branches are very much like release branches in that they are also meant to prepare for a new production release, albeit unplanned. They arise from the necessity to act immediately upon an undesired state of a live production version. When a critical bug in a production version must be resolved immediately, a hotfix branch may be branched off from the corresponding tag on the master branch that marks the production version.

The essence is that work of team members, on the `nobunaga` branch, can continue, while another person is preparing a quick production fix.

### Git operations

#### Create a feature branch

1. Branch from the **nobunaga** branch.
1. Command: `git checkout -b feature/my-feature nobunaga`

> Try to rebase frequently with the updated nobunaga branch so you do not face big conflicts before submitting your pull request. Remember, syncing your changes with other developers could also help you avoid big conflicts.

#### Merge feature branch into nobunaga

In other words, integrate your changes into a branch that will be tested and prepared for release.

- Switch branch to nobunaga: `git checkout nobunaga`
- Merging feature branch into nobunaga: `git merge --no-ff feature/my-feature`
- Pushing changes to nobunaga: `git push origin nobunaga`
- Delete feature branch: `git branch -d feature/my-feature`

This operation is done by Github when merging a PR.

So, what you have to keep in mind is:
- Open the PR against the `nobunaga` branch.
- After merging a PR you just have to delete your feature branch.

#### Create release branch

- Create branch from nobunaga: `git checkout -b release/3.4.0/optional-descriptive-message nobunaga`
- Updating version with major or minor: `./scripts/update_version.sh major|minor`
- Commit file changes with new version: `git commit -a -m "Updated version to 3.4.0"`

#### Finish a release branch

In other words, releasing stable code and generating a new version for bittensor.

- Switch branch to master: `git checkout master`
- Merging release branch into master: `git merge --no-ff release/3.4.0/optional-descriptive-message`
- Tag changeset: `git tag -a v3.4.0 -m "Releasing v3.4.0: some comment about it"`
- Pushing changes to master: `git push origin master`
- Pushing tags to origin: `git push origin --tags`

To keep the changes made in the __release__ branch, we need to merge those back into `nobunaga`:

- Switch branch to nobunaga: `git checkout nobunaga`.
- Merging release branch into nobunaga: `git merge --no-ff release/3.4.0/optional-descriptive-message`

This step may well lead to a merge conflict (probably even, since we have changed the version number). If so, fix it and commit.

After this the release branch may be removed, since we don’t need it anymore:

- `git branch -d release/3.4.0/optional-descriptive-message`

#### Create the hotfix branch

- Create branch from master:`git checkout -b hotfix/3.3.4/optional-descriptive-message master`
- Update patch version: `./scripts/update_version.sh patch`
- Commit file changes with new version: `git commit -a -m "Updated version to 3.3.4"`

Then, fix the bug and commit the fix in one or more separate commits:
- `git commit -m "Fixed critical production issue"`

#### Finishing a hotfix branch

When finished, the bugfix needs to be merged back into `master`, but also needs to be merged back into `nobunaga`, in order to safeguard that the bugfix is included in the next release as well. This is completely similar to how release branches are finished.

First, update master and tag the release.

- Switch branch to master: `git checkout master`
- Merge changes into master: `git merge --no-ff hotfix/3.3.4/optional-descriptive-message`
- Tag new version: `git tag -a v3.3.4 -m "Releasing v3.3.4: some comment about the hotfix"`
- Pushing changes to master: `git push origin master`
- Pushing tags to origin: `git push origin --tags`

Next, include the bugfix in `nobunaga`, too:

- Switch branch to nobunaga: `git checkout nobunaga`
- Merge changes into nobunaga: `git merge --no-ff hotfix/3.3.4/optional-descriptive-message`
- Pushing changes to origin/nobunaga: `git push origin nobunaga`

The one exception to the rule here is that, **when a release branch currently exists, the hotfix changes need to be merged into that release branch, instead of** `nobunaga`. Back-merging the bugfix into the __release__ branch will eventually result in the bugfix being merged into `develop` too, when the release branch is finished. (If work in develop immediately requires this bugfix and cannot wait for the release branch to be finished, you may safely merge the bugfix into develop now already as well.)

Finally, we remove the temporary branch:

- `git branch -d hotfix/3.3.4/optional-descriptive-message`

## TODO

- Changing the name of the develop branch from nobunaga to `integration`
- Because sometimes nobunaga are going to have a release branch.
- Knowing if master and nobunaga are different
- Knowing what is in nobunaga that is not merge yet
- Document with not released developments
- When merged into nobunaga, generate the information exposing what's merged into nobunaga but not release.
- When merged into master, generate github release and release notes.
- CircleCI job
- Merge nobunaga into master and release version (needed to release code)
- Build and Test bittensor (needed to merge PRs)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div align="center">

# **Bittensor** <!-- omit in toc -->
[![Discord Chat](https://img.shields.io/discord/308323056592486420.svg)](https://discord.gg/3rUr6EcvbB)
[![Discord Chat](https://img.shields.io/discord/308323056592486420.svg)](https://discord.gg/bittensor)
[![PyPI version](https://badge.fury.io/py/bittensor.svg)](https://badge.fury.io/py/bittensor)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

---

### Internet-scale Neural Networks <!-- omit in toc -->

[Discord](https://discord.gg/3rUr6EcvbB) • [Docs](https://app.gitbook.com/@opentensor/s/bittensor/) • [Network](https://www.bittensor.com/metagraph) • [Research](https://drive.google.com/file/d/1VnsobL6lIAAqcA1_Tbm8AYIQscfJV4KU) • [Code](https://github.com/opentensor/BitTensor)
[Discord](https://discord.gg/bittensor) • [Docs](https://docs.bittensor.com/) • [Network](https://www.bittensor.com/network) • [Research](https://drive.google.com/file/d/1VnsobL6lIAAqcA1_Tbm8AYIQscfJV4KU) • [Code](https://github.com/opentensor/BitTensor)

</div>

Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.4
2 changes: 1 addition & 1 deletion bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from rich.console import Console

# Bittensor code and protocol version.
__version__ = '3.3.3'
__version__ = '3.3.4'
version_split = __version__.split(".")
__version_as_int__ = (100 * int(version_split[0])) + (10 * int(version_split[1])) + (1 * int(version_split[2]))

Expand Down
20 changes: 19 additions & 1 deletion bittensor/_axon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
# The MIT License (MIT)
# Copyright © 2021 Yuma Rao
# Copyright © 2022 Opentensor Foundation

# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation
Expand Down Expand Up @@ -65,6 +66,8 @@ def __new__(
server: 'grpc._Server' = None,
port: int = None,
ip: str = None,
external_ip: str = None,
external_port: int = None,
max_workers: int = None,
maximum_concurrent_rpcs: int = None,
blacklist: 'Callable' = None,
Expand Down Expand Up @@ -101,6 +104,10 @@ def __new__(
Binding port.
ip (:type:`str`, `optional`):
Binding ip.
external_ip (:type:`str`, `optional`):
The external ip of the server to broadcast to the network.
external_port (:type:`int`, `optional`):
The external port of the server to broadcast to the network.
max_workers (:type:`int`, `optional`):
Used to create the threadpool if not passed, specifies the number of active threads servicing requests.
maximum_concurrent_rpcs (:type:`int`, `optional`):
Expand All @@ -120,6 +127,8 @@ def __new__(
config = copy.deepcopy(config)
config.axon.port = port if port != None else config.axon.port
config.axon.ip = ip if ip != None else config.axon.ip
config.axon.external_ip = external_ip if external_ip != None else config.axon.external_ip
config.axon.external_port = external_port if external_port != None else config.axon.external_port
config.axon.max_workers = max_workers if max_workers != None else config.axon.max_workers
config.axon.maximum_concurrent_rpcs = maximum_concurrent_rpcs if maximum_concurrent_rpcs != None else config.axon.maximum_concurrent_rpcs
config.axon.forward_timeout = forward_timeout if forward_timeout != None else config.axon.forward_timeout
Expand Down Expand Up @@ -174,6 +183,8 @@ def __new__(
server = server,
ip = config.axon.ip,
port = config.axon.port,
external_ip=config.axon.external_ip, # don't use internal ip if it is None, we will try to find it later
external_port=config.axon.external_port or config.axon.port, # default to internal port if external port is not set
forward = forward_text,
backward = backward_text,
synapses = synapses,
Expand Down Expand Up @@ -214,9 +225,13 @@ def add_args( cls, parser: argparse.ArgumentParser, prefix: str = None ):
prefix_str = '' if prefix == None else prefix + '.'
try:
parser.add_argument('--' + prefix_str + 'axon.port', type=int,
help='''The port this axon endpoint is served on. i.e. 8091''', default = bittensor.defaults.axon.port)
help='''The local port this axon endpoint is bound to. i.e. 8091''', default = bittensor.defaults.axon.port)
parser.add_argument('--' + prefix_str + 'axon.ip', type=str,
help='''The local ip this axon binds to. ie. [::]''', default = bittensor.defaults.axon.ip)
parser.add_argument('--' + prefix_str + 'axon.external_port', type=int, required=False,
help='''The public port this axon broadcasts to the network. i.e. 8091''', default = bittensor.defaults.axon.external_port)
parser.add_argument('--' + prefix_str + 'axon.external_ip', type=str, required=False,
help='''The external ip this axon broadcasts to the network to. ie. [::]''', default = bittensor.defaults.axon.external_ip)
parser.add_argument('--' + prefix_str + 'axon.max_workers', type=int,
help='''The maximum number connection handler threads working simultaneously on this endpoint.
The grpc server distributes new worker threads to service requests up to this number.''', default = bittensor.defaults.axon.max_workers)
Expand Down Expand Up @@ -253,6 +268,8 @@ def add_defaults(cls, defaults):
defaults.axon = bittensor.Config()
defaults.axon.port = os.getenv('BT_AXON_PORT') if os.getenv('BT_AXON_PORT') != None else 8091
defaults.axon.ip = os.getenv('BT_AXON_IP') if os.getenv('BT_AXON_IP') != None else '[::]'
defaults.axon.external_port = os.getenv('BT_AXON_EXTERNAL_PORT') if os.getenv('BT_AXON_EXTERNAL_PORT') != None else None
defaults.axon.external_ip = os.getenv('BT_AXON_EXTERNAL_IP') if os.getenv('BT_AXON_EXTERNAL_IP') != None else None
defaults.axon.max_workers = os.getenv('BT_AXON_MAX_WORERS') if os.getenv('BT_AXON_MAX_WORERS') != None else 10
defaults.axon.maximum_concurrent_rpcs = os.getenv('BT_AXON_MAXIMUM_CONCURRENT_RPCS') if os.getenv('BT_AXON_MAXIMUM_CONCURRENT_RPCS') != None else 400

Expand All @@ -267,6 +284,7 @@ def check_config(cls, config: 'bittensor.Config' ):
""" Check config for axon port and wallet
"""
assert config.axon.port > 1024 and config.axon.port < 65535, 'port must be in range [1024, 65535]'
assert config.axon.external_port is None or (config.axon.external_port > 1024 and config.axon.external_port < 65535), 'external port must be in range [1024, 65535]'
bittensor.wallet.check_config( config )

@classmethod
Expand Down
Loading