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

Add initial support for connecting via libp2p #238

Merged
merged 84 commits into from
Jun 1, 2021
Merged

Conversation

MaximKsh
Copy link
Collaborator

No description provided.

dvmazur and others added 25 commits April 13, 2021 09:59
* add setup.py prototype

* refactor
* Add p2p daemon

* Test p2p daemon exits correctly

* Impose restriction on elapsed time

Co-authored-by: Ilya Kobelev <[email protected]>
Co-authored-by: justheuristic <[email protected]>
* copytree implementation for py37 compatibility (#162)

* copytree implementation for py37 compatibility

* Running tests for python3.7

* Increment version

* Python3.7 notions

* Remove pickle.loads in averager (#160)

* Security update: remove pickle.loads in averager
* add py37 to circleci config

Co-authored-by: Alexander Borzunov <[email protected]>
Co-authored-by: Max Ryabinin <[email protected]>

* Support edge cases for DHT key/subkey/value, add tests, update .gitignore for pb2 (#167)

* fix bug with subkey equals zero
* add autogenerated protobuf files to .gitignore
* test store and get "tricky" values in dht

* Fix the remaining tests for py37 (#166)

* DecentralizedAverager is now compatible with python37's acyncio exception
    * the problem was: grpc.aio with python37 raised concurrent.futures.CancelledError in some cases;
    * we relied on isinstance(asyncio.CancelledError, Exception) == False
    * but isinstance(concurrent.futures.CancelledError, Exception) == True
*  DecentralizedAverager now shuts down if dereferenced in the main process
    * though it won't shutdown if dereferenced in forks for obvious reasons
* HIVEMIND_THREADS now actually works
* test_averaging now shuts down dht and averager instances to avoid leaking processes

Co-authored-by: Max Ryabinin <[email protected]>
Co-authored-by: Max Ryabinin <[email protected]>

* Move Averager metadata serialization out of user scope (#168)

* move metadata serialization outside user scope
* test_overcrowded: reduce the default number of peers

* Handle edge cases in DecentralizedAverager (#171)

* move metadata serialization outside user scope
* retry averager.step on network errors
* raise AllreduceException on partial tensor
* test split/combine tensors, combine corrupted stream

Co-authored-by: Max Ryabinin <[email protected]>

* Fix a typo in quickstart.md (#174)

* Serialize DHTID source with msgpack (#172)

* Change DHTID serializer

* Remove unused serializers

* Add msgpack tuple serialization

* Move CLI server launch script to hivemind/hivemind_cli (#173)

* Cast environment variables to correct types

* Compiling libp2p daemon on setup (#153)

* add setup.py prototype

* refactor

* feat: add p2p daemon (#164)

* Add p2p daemon

* Test p2p daemon exits correctly

* Impose restriction on elapsed time

Co-authored-by: Ilya Kobelev <[email protected]>

* compare golang versions using packaging.version

* fix typo

Co-authored-by: justheuristic <[email protected]>

* move p2pd executable to hivemind/hivemind_cli

Co-authored-by: Alexey Bukhtiyarov <[email protected]>
Co-authored-by: justheuristic <[email protected]>
Co-authored-by: Alexander Borzunov <[email protected]>
Co-authored-by: Max Ryabinin <[email protected]>
Co-authored-by: Michael Diskin <[email protected]>
Co-authored-by: romakail <[email protected]>
Co-authored-by: Ilya <[email protected]>
Co-authored-by: Ilya Kobelev <[email protected]>
* Rename ProtoCompileInstall and ProtoCompileDevelop to Install and Develop
* Install LibP2P-Daemon on setup install and setup develop
* Install Golang in Circle CI builds
* Add P2PD binary to gitignore
* Extend P2P api

* Add tests for new api

* Add p2pclient dependencies

* Test P2P from different processes

* Fix typo in tests

* Add default initialization

* Fix daemon ports assignment

* Replace del with __del__ in tests

* Read from input stream with receive_exactly

Co-authored-by: Ilya Kobelev <[email protected]>
* Add unary handler

* Add P2PContext to unary handler parameters

Co-authored-by: Ilya Kobelev <[email protected]>
* #183 p2p daemon pybinding

* #183 rename py bindings dir, fix imports and migrate tests

* #183 move pb to hivemind.proto

* #183 fix p2p tests

* #183 remove config.py, move constants to classes

* add docstrings and minor fixes
* #204 P2P replica mode

* #204 rename replica->replicate
* add setup.py prototype

* refactor
* Add p2p daemon

* Test p2p daemon exits correctly

* Impose restriction on elapsed time

Co-authored-by: Ilya Kobelev <[email protected]>
Co-authored-by: justheuristic <[email protected]>
* copytree implementation for py37 compatibility (#162)

* copytree implementation for py37 compatibility

* Running tests for python3.7

* Increment version

* Python3.7 notions

* Remove pickle.loads in averager (#160)

* Security update: remove pickle.loads in averager
* add py37 to circleci config

Co-authored-by: Alexander Borzunov <[email protected]>
Co-authored-by: Max Ryabinin <[email protected]>

* Support edge cases for DHT key/subkey/value, add tests, update .gitignore for pb2 (#167)

* fix bug with subkey equals zero
* add autogenerated protobuf files to .gitignore
* test store and get "tricky" values in dht

* Fix the remaining tests for py37 (#166)

* DecentralizedAverager is now compatible with python37's acyncio exception
    * the problem was: grpc.aio with python37 raised concurrent.futures.CancelledError in some cases;
    * we relied on isinstance(asyncio.CancelledError, Exception) == False
    * but isinstance(concurrent.futures.CancelledError, Exception) == True
*  DecentralizedAverager now shuts down if dereferenced in the main process
    * though it won't shutdown if dereferenced in forks for obvious reasons
* HIVEMIND_THREADS now actually works
* test_averaging now shuts down dht and averager instances to avoid leaking processes

Co-authored-by: Max Ryabinin <[email protected]>
Co-authored-by: Max Ryabinin <[email protected]>

* Move Averager metadata serialization out of user scope (#168)

* move metadata serialization outside user scope
* test_overcrowded: reduce the default number of peers

* Handle edge cases in DecentralizedAverager (#171)

* move metadata serialization outside user scope
* retry averager.step on network errors
* raise AllreduceException on partial tensor
* test split/combine tensors, combine corrupted stream

Co-authored-by: Max Ryabinin <[email protected]>

* Fix a typo in quickstart.md (#174)

* Serialize DHTID source with msgpack (#172)

* Change DHTID serializer

* Remove unused serializers

* Add msgpack tuple serialization

* Move CLI server launch script to hivemind/hivemind_cli (#173)

* Cast environment variables to correct types

* Compiling libp2p daemon on setup (#153)

* add setup.py prototype

* refactor

* feat: add p2p daemon (#164)

* Add p2p daemon

* Test p2p daemon exits correctly

* Impose restriction on elapsed time

Co-authored-by: Ilya Kobelev <[email protected]>

* compare golang versions using packaging.version

* fix typo

Co-authored-by: justheuristic <[email protected]>

* move p2pd executable to hivemind/hivemind_cli

Co-authored-by: Alexey Bukhtiyarov <[email protected]>
Co-authored-by: justheuristic <[email protected]>
Co-authored-by: Alexander Borzunov <[email protected]>
Co-authored-by: Max Ryabinin <[email protected]>
Co-authored-by: Michael Diskin <[email protected]>
Co-authored-by: romakail <[email protected]>
Co-authored-by: Ilya <[email protected]>
Co-authored-by: Ilya Kobelev <[email protected]>
* Rename ProtoCompileInstall and ProtoCompileDevelop to Install and Develop
* Install LibP2P-Daemon on setup install and setup develop
* Install Golang in Circle CI builds
* Add P2PD binary to gitignore
* Extend P2P api

* Add tests for new api

* Add p2pclient dependencies

* Test P2P from different processes

* Fix typo in tests

* Add default initialization

* Fix daemon ports assignment

* Replace del with __del__ in tests

* Read from input stream with receive_exactly

Co-authored-by: Ilya Kobelev <[email protected]>
* Add unary handler

* Add P2PContext to unary handler parameters

Co-authored-by: Ilya Kobelev <[email protected]>
* #183 p2p daemon pybinding

* #183 rename py bindings dir, fix imports and migrate tests

* #183 move pb to hivemind.proto

* #183 fix p2p tests

* #183 remove config.py, move constants to classes

* add docstrings and minor fixes
* #204 P2P replica mode

* #204 rename replica->replicate
@MaximKsh MaximKsh requested review from mryab and justheuristic and removed request for borzunov April 20, 2021 20:14
@MaximKsh MaximKsh marked this pull request as ready for review April 20, 2021 20:15
functools.partial(
_check_connection, p2pd_tuple_0=p2pd_tuple_0, p2pd_tuple_1=p2pd_tuple_1
)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\n

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[converted to suggestion below]

add newline

Co-authored-by: justheuristic <[email protected]>
@MaximKsh MaximKsh merged commit aea7a38 into master Jun 1, 2021
@MaximKsh MaximKsh deleted the libp2p-onlyp2p branch June 1, 2021 14:14
@borzunov borzunov mentioned this pull request Jun 30, 2021
24 tasks
@borzunov borzunov mentioned this pull request Jul 11, 2021
31 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants