From 7735684b82c0e52ed1f2bac650d2450d06e40587 Mon Sep 17 00:00:00 2001 From: Martin Wistuba Date: Tue, 2 Jul 2024 12:29:20 +0200 Subject: [PATCH 1/6] upgrade dependencies --- .github/workflows/run_unit_tests.yml | 2 +- doc/requirements.txt | 10 +++++----- pyproject.toml | 10 +++++----- requirements.txt | 26 +++++++++++++------------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index 5842e0e3..bcd28fa2 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - name: Checkout diff --git a/doc/requirements.txt b/doc/requirements.txt index c85b1e92..cc805761 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,10 +1,10 @@ -docutils==0.20.1 -Sphinx==7.2.6 +docutils==0.21.2 +Sphinx==7.3.7 sphinx-copybutton==0.5.2 -sphinx-hoverxref==1.3.0 +sphinx-hoverxref==1.4.0 sphinxext-opengraph==0.9.1 -pydata-sphinx-theme==0.14.4 -sphinx-autodoc-typehints==1.25.2 +pydata-sphinx-theme==0.15.4 +sphinx-autodoc-typehints==2.2.2 sphinx-paramlinks==0.6.0 # Temporarily added diff --git a/pyproject.toml b/pyproject.toml index d11f6740..bea00963 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", ] -requires-python = ">=3.8, <3.11" +requires-python = ">=3.8, <3.12" dynamic = ["version", "readme", "dependencies"] [project.optional-dependencies] @@ -25,13 +25,13 @@ benchmark = [ "wild-time-data==0.1.1", ] dev = [ - "black==23.12.0", + "black==24.4.2", "avalanche_lib==0.3.1", "wild-time-data==0.1.1", "torch>=1.10.0, <1.12.2", # PyTest Dependencies - "pytest==7.4.3", - "pytest-cov==4.1.0", + "pytest==8.2.2", + "pytest-cov==5.0.0", "pytest-helpers-namespace==2021.12.29", ] @@ -45,7 +45,7 @@ dependencies = {file = ["requirements.txt"]} [tool.black] line-length = 100 -target-version = ["py38", "py39", "py310"] +target-version = ["py38", "py39", "py310", "py311"] include = '\.pyi?$' [tool.pytest.ini_options] diff --git a/requirements.txt b/requirements.txt index 6eb08184..1731581a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,17 @@ -numpy>=1.17.2, <1.26.3 +numpy>=1.17.2, <2.0.1 torch>=1.10.0, <1.13.2 -pandas>=1.4.0, <2.1.5 -boto3>=1.26.0, <1.34.3 -requests>=2.31.0, <2.31.1 -sagemaker>=2.112.0, <2.200.2 -syne-tune[aws,gpsearchers]>=0.6.0, <0.10.1 -pytorch-lightning>=1.8.0, <1.9.5 -Pillow>=10.2, <10.2.1 +pandas>=1.4.0, <2.2.3 +boto3>=1.26.0, <1.34.138 +requests>=2.32.0, <2.32.4 +sagemaker>=2.218.0, <2.224.3 +syne-tune[aws,gpsearchers]>=0.6.0, <0.13.1 +pytorch-lightning>=1.8.0, <1.9.6 +Pillow>=10.3.0, <10.4.1 tabulate>=0.9.0, <0.9.1 tensorboardX>=2.5.0, <2.6.3 torchmetrics>=0.11.0, <0.11.5 -torchvision>=0.13.0, <0.16.3 -deepspeed>=0.9.0, <0.12.6 -datasets>=2.9.0, <2.15.1 -transformers>=4.36.0, <4.36.3 -scipy>=1.10.0, <1.12.1 +torchvision>=0.13.0, <0.18.2 +deepspeed>=0.9.0, <0.14.5 +datasets>=2.9.0, <2.20.1 +transformers>=4.38.0, <4.42.4 +scipy>=1.10.0, <1.14.1 From b7e5cb6d8705524bf0ef6300cf9060414a871531 Mon Sep 17 00:00:00 2001 From: Martin Wistuba Date: Tue, 2 Jul 2024 12:30:22 +0200 Subject: [PATCH 2/6] black --- src/renate/updaters/avalanche/model_updater.py | 8 +++++--- src/renate/updaters/experimental/er.py | 6 +++--- src/renate/updaters/model_updater.py | 6 +++--- test/renate/benchmark/test_experimentation_config.py | 6 +++--- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/renate/updaters/avalanche/model_updater.py b/src/renate/updaters/avalanche/model_updater.py index d1692b7f..d07e5bdc 100644 --- a/src/renate/updaters/avalanche/model_updater.py +++ b/src/renate/updaters/avalanche/model_updater.py @@ -79,9 +79,11 @@ def _load_learner( optimizer, scheduler_config = optimizer[0], scheduler_config[0] lr_scheduler_plugin = LRSchedulerPlugin( scheduler=scheduler_config["scheduler"], - step_granularity="iteration" - if scheduler_config["interval"] == "step" - else scheduler_config["interval"], + step_granularity=( + "iteration" + if scheduler_config["interval"] == "step" + else scheduler_config["interval"] + ), ) plugins.append(lr_scheduler_plugin) else: diff --git a/src/renate/updaters/experimental/er.py b/src/renate/updaters/experimental/er.py index e9fe4018..708760bf 100644 --- a/src/renate/updaters/experimental/er.py +++ b/src/renate/updaters/experimental/er.py @@ -194,9 +194,9 @@ def _update_memory_buffer(self, step_output: STEP_OUTPUT) -> None: outputs = step_output["outputs"] metadata = {"outputs": outputs.detach().cpu()} for i, intermediate_representation in enumerate(step_output["intermediate_representation"]): - metadata[ - f"intermediate_representation_{i}" - ] = intermediate_representation.detach().cpu() + metadata[f"intermediate_representation_{i}"] = ( + intermediate_representation.detach().cpu() + ) # Some datasets have problems using tensors as subset indices, convert to list of ints. train_data_idx = [int(idx) for idx in step_output["train_data_idx"]] dataset = Subset(self._train_dataset, train_data_idx) diff --git a/src/renate/updaters/model_updater.py b/src/renate/updaters/model_updater.py index 734e6229..4b768744 100644 --- a/src/renate/updaters/model_updater.py +++ b/src/renate/updaters/model_updater.py @@ -293,9 +293,9 @@ def __init__( self._learner_kwargs["mask_unused_classes"] = mask_unused_classes if learning_rate_scheduler is not None: self._learner_kwargs["learning_rate_scheduler"] = learning_rate_scheduler - self._learner_kwargs[ - "learning_rate_scheduler_interval" - ] = learning_rate_scheduler_interval + self._learner_kwargs["learning_rate_scheduler_interval"] = ( + learning_rate_scheduler_interval + ) self._model = model self._learner_state_file: Optional[str] = None if input_state_folder is not None: diff --git a/test/renate/benchmark/test_experimentation_config.py b/test/renate/benchmark/test_experimentation_config.py index 3cd076d1..98e6a08d 100644 --- a/test/renate/benchmark/test_experimentation_config.py +++ b/test/renate/benchmark/test_experimentation_config.py @@ -51,9 +51,9 @@ def test_model_fn(model_name, expected_model_class): num_outputs=2, num_hidden_layers=1 if model_name == "MultiLayerPerceptron" else None, hidden_size=1 if model_name == "MultiLayerPerceptron" else None, - pretrained_model_name_or_path="distilbert-base-uncased" - if model_name == "HuggingFaceTransformer" - else None, + pretrained_model_name_or_path=( + "distilbert-base-uncased" if model_name == "HuggingFaceTransformer" else None + ), ) assert isinstance(model, expected_model_class) From d478369d8a19e9f09aaad5daf2eaf5b463bdedbf Mon Sep 17 00:00:00 2001 From: Martin Wistuba Date: Tue, 2 Jul 2024 14:41:56 +0200 Subject: [PATCH 3/6] upgrade dependencies --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1731581a..21cccdd4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ Pillow>=10.3.0, <10.4.1 tabulate>=0.9.0, <0.9.1 tensorboardX>=2.5.0, <2.6.3 torchmetrics>=0.11.0, <0.11.5 -torchvision>=0.13.0, <0.18.2 +torchvision>=0.13.0, <0.16.3 deepspeed>=0.9.0, <0.14.5 datasets>=2.9.0, <2.20.1 transformers>=4.38.0, <4.42.4 From d67fe071b3b0c761253a3c263a9130b25b320c30 Mon Sep 17 00:00:00 2001 From: Martin Wistuba Date: Tue, 2 Jul 2024 14:41:56 +0200 Subject: [PATCH 4/6] upgrade dependencies --- .github/workflows/run_unit_tests.yml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index bcd28fa2..1ed3d280 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10"] steps: - name: Checkout diff --git a/requirements.txt b/requirements.txt index 1731581a..21cccdd4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ Pillow>=10.3.0, <10.4.1 tabulate>=0.9.0, <0.9.1 tensorboardX>=2.5.0, <2.6.3 torchmetrics>=0.11.0, <0.11.5 -torchvision>=0.13.0, <0.18.2 +torchvision>=0.13.0, <0.16.3 deepspeed>=0.9.0, <0.14.5 datasets>=2.9.0, <2.20.1 transformers>=4.38.0, <4.42.4 From 4d59915ee8c04f60fd57b61c30d917f6141e60bf Mon Sep 17 00:00:00 2001 From: Martin Wistuba Date: Tue, 2 Jul 2024 14:54:28 +0200 Subject: [PATCH 5/6] upgrade dependencies --- pyproject.toml | 4 ++-- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bea00963..4393432f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", ] -requires-python = ">=3.8, <3.12" +requires-python = ">=3.8, <3.11" dynamic = ["version", "readme", "dependencies"] [project.optional-dependencies] @@ -45,7 +45,7 @@ dependencies = {file = ["requirements.txt"]} [tool.black] line-length = 100 -target-version = ["py38", "py39", "py310", "py311"] +target-version = ["py38", "py39", "py310"] include = '\.pyi?$' [tool.pytest.ini_options] diff --git a/requirements.txt b/requirements.txt index 21cccdd4..1731581a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ Pillow>=10.3.0, <10.4.1 tabulate>=0.9.0, <0.9.1 tensorboardX>=2.5.0, <2.6.3 torchmetrics>=0.11.0, <0.11.5 -torchvision>=0.13.0, <0.16.3 +torchvision>=0.13.0, <0.18.2 deepspeed>=0.9.0, <0.14.5 datasets>=2.9.0, <2.20.1 transformers>=4.38.0, <4.42.4 From f531d3d98052fb5f4cf9a3566795afb6d20276f8 Mon Sep 17 00:00:00 2001 From: Martin Wistuba Date: Tue, 2 Jul 2024 14:55:56 +0200 Subject: [PATCH 6/6] bump version --- src/renate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renate/__init__.py b/src/renate/__init__.py index 77746254..afd713d7 100644 --- a/src/renate/__init__.py +++ b/src/renate/__init__.py @@ -14,4 +14,4 @@ _renate_logger.addHandler(_handler) _renate_logger.propagate = False -__version__ = "0.5.1" +__version__ = "0.5.2"