From 5aa57bfb2a5b277b48abf167c8468a54e2baee8a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:45:20 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Dockerfile | 2 +- docker-compose.yml | 2 +- src/lightning_hivemind/strategy.py | 2 +- tests/test_strategy.py | 9 +++------ 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index df49486..e997956 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,4 +19,4 @@ RUN python3 -m pip install --break-system-packages -r tests/requirements.txt COPY . ./ -RUN python3 -m pip install --break-system-packages . \ No newline at end of file +RUN python3 -m pip install --break-system-packages . diff --git a/docker-compose.yml b/docker-compose.yml index 15d1cb0..f8e4ae6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,4 +11,4 @@ services: dockerfile: Dockerfile volumes: - ./src:/app/src - - ./tests:/app/tests \ No newline at end of file + - ./tests:/app/tests diff --git a/src/lightning_hivemind/strategy.py b/src/lightning_hivemind/strategy.py index ad6f9ae..06470e4 100644 --- a/src/lightning_hivemind/strategy.py +++ b/src/lightning_hivemind/strategy.py @@ -187,7 +187,7 @@ def __init__( wait_timeout=wait_timeout, bootstrap_timeout=bootstrap_timeout, use_relay=use_relay, - use_auto_relay=use_auto_relay + use_auto_relay=use_auto_relay, ) visible_addresses = [ diff --git a/tests/test_strategy.py b/tests/test_strategy.py index e7e72ad..15f3eeb 100644 --- a/tests/test_strategy.py +++ b/tests/test_strategy.py @@ -69,6 +69,7 @@ def configure_optimizers(self): ) trainer.fit(model) + @mock.patch.dict(os.environ, {"HIVEMIND_MEMORY_SHARING_STRATEGY": "file_descriptor"}, clear=True) def test_ipfs_integration(): class TestModel(BoringModel): @@ -82,16 +83,12 @@ def configure_optimizers(self): model = TestModel() trainer = Trainer( - strategy=HivemindStrategy( - target_batch_size=1, - use_ipfs=True, - use_relay=True, - use_auto_relay=True - ), + strategy=HivemindStrategy(target_batch_size=1, use_ipfs=True, use_relay=True, use_auto_relay=True), fast_dev_run=True, ) trainer.fit(model) + @mock.patch.dict( os.environ, {