From 834a63340858c0661b7cee9803087a693a397667 Mon Sep 17 00:00:00 2001 From: Felix Dangel Date: Wed, 26 Nov 2025 18:07:14 -0500 Subject: [PATCH 1/4] [FMT] Apply latest black --- test/core/derivatives/activation_settings.py | 2 +- test/core/derivatives/pooling_settings.py | 2 +- .../extensions/firstorder/batch_l2_grad/batchl2grad_settings.py | 2 +- .../firstorder/sum_grad_squared/sumgradsquared_settings.py | 2 +- test/utils/evaluation_mode.py | 2 +- test/utils/test_conv_settings.py | 2 +- test/utils/test_conv_transpose_settings.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/core/derivatives/activation_settings.py b/test/core/derivatives/activation_settings.py index a8dacbad9..d3646be2a 100644 --- a/test/core/derivatives/activation_settings.py +++ b/test/core/derivatives/activation_settings.py @@ -6,7 +6,7 @@ "input_fn" (callable): Used for specifying input function Optional entries: - "target_fn" (callable): Fetches the groundtruth/target classes + "target_fn" (callable): Fetches the groundtruth/target classes of regression/classification task "loss_function_fn" (callable): Loss function used in the model "device" [list(torch.device)]: List of devices to run the test on. diff --git a/test/core/derivatives/pooling_settings.py b/test/core/derivatives/pooling_settings.py index 0c0627fae..07d7ef66b 100644 --- a/test/core/derivatives/pooling_settings.py +++ b/test/core/derivatives/pooling_settings.py @@ -5,7 +5,7 @@ "input_fn" (callable): Used for specifying input function Optional entries: - "target_fn" (callable): Fetches the groundtruth/target classes + "target_fn" (callable): Fetches the groundtruth/target classes of regression/classification task "loss_function_fn" (callable): Loss function used in the model "device" [list(torch.device)]: List of devices to run the test on. diff --git a/test/extensions/firstorder/batch_l2_grad/batchl2grad_settings.py b/test/extensions/firstorder/batch_l2_grad/batchl2grad_settings.py index 16e02930c..cc1f7cee0 100644 --- a/test/extensions/firstorder/batch_l2_grad/batchl2grad_settings.py +++ b/test/extensions/firstorder/batch_l2_grad/batchl2grad_settings.py @@ -1,6 +1,6 @@ """Test configurations to test batch_l2_grad -The tests are taken from `test.extensions.firstorder.firstorder_settings`, +The tests are taken from `test.extensions.firstorder.firstorder_settings`, but additional custom tests can be defined here by appending it to the list. """ diff --git a/test/extensions/firstorder/sum_grad_squared/sumgradsquared_settings.py b/test/extensions/firstorder/sum_grad_squared/sumgradsquared_settings.py index 3b3d465d6..2565135d1 100644 --- a/test/extensions/firstorder/sum_grad_squared/sumgradsquared_settings.py +++ b/test/extensions/firstorder/sum_grad_squared/sumgradsquared_settings.py @@ -1,6 +1,6 @@ """Test configurations to test sum_grad_square -The tests are taken from `test.extensions.firstorder.firstorder_settings`, +The tests are taken from `test.extensions.firstorder.firstorder_settings`, but additional custom tests can be defined here by appending it to the list. """ diff --git a/test/utils/evaluation_mode.py b/test/utils/evaluation_mode.py index f41ba2f57..a8b315894 100644 --- a/test/utils/evaluation_mode.py +++ b/test/utils/evaluation_mode.py @@ -24,7 +24,7 @@ def initialize_training_false_recursive(module: Module) -> Module: def initialize_batch_norm_eval( - module: Union[BatchNorm1d, BatchNorm2d, BatchNorm3d] + module: Union[BatchNorm1d, BatchNorm2d, BatchNorm3d], ) -> Union[BatchNorm1d, BatchNorm2d, BatchNorm3d]: """Initializes a BatchNorm module in evaluation mode. diff --git a/test/utils/test_conv_settings.py b/test/utils/test_conv_settings.py index bf073726d..33d2392e0 100644 --- a/test/utils/test_conv_settings.py +++ b/test/utils/test_conv_settings.py @@ -7,7 +7,7 @@ Optional entries: - "target_fn" (callable): Fetches the groundtruth/target classes + "target_fn" (callable): Fetches the groundtruth/target classes of regression/classification task "loss_function_fn" (callable): Loss function used in the model "device" [list(torch.device)]: List of devices to run the test on. diff --git a/test/utils/test_conv_transpose_settings.py b/test/utils/test_conv_transpose_settings.py index 34986e42b..1f69e7bec 100644 --- a/test/utils/test_conv_transpose_settings.py +++ b/test/utils/test_conv_transpose_settings.py @@ -4,7 +4,7 @@ "input_fn" (callable): Used for specifying input function Optional entries: - "target_fn" (callable): Fetches the groundtruth/target classes + "target_fn" (callable): Fetches the groundtruth/target classes of regression/classification task "loss_function_fn" (callable): Loss function used in the model "device" [list(torch.device)]: List of devices to run the test on. From 1bb6682234d4b67d7927a129a191368e5fb47b49 Mon Sep 17 00:00:00 2001 From: Felix Dangel Date: Wed, 26 Nov 2025 18:10:47 -0500 Subject: [PATCH 2/4] [REQ] Allow using newer pytest --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bb920a114..e26a0c87c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ requires-python = ">=3.9" test = [ "scipy", "numpy<2", - "pytest>=4.5.0,<5.0.0", + "pytest", "pytest-benchmark>=3.2.2,<4.0.0", "pytest-optional-tests>=0.1.1", "pytest-cov", From ded1be9dbc3af16b599032e0818baa510c114bf4 Mon Sep 17 00:00:00 2001 From: Felix Dangel Date: Wed, 26 Nov 2025 18:14:58 -0500 Subject: [PATCH 3/4] [REQ] Allow using newer pytest-benchmark --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e26a0c87c..f7215c9df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ test = [ "scipy", "numpy<2", "pytest", - "pytest-benchmark>=3.2.2,<4.0.0", + "pytest-benchmark", "pytest-optional-tests>=0.1.1", "pytest-cov", "coveralls", From 15d1c459a3ab309193f3c75ae2c8859df5f86d6b Mon Sep 17 00:00:00 2001 From: Felix Dangel Date: Wed, 26 Nov 2025 18:27:39 -0500 Subject: [PATCH 4/4] [DOC] Update changelog --- changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.md b/changelog.md index 55bb6d221..3af3cab0e 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Internal +- Fix CI (apply latest `black`, use latest `pytest` and `pytest-benchmark`) + ([PR](https://github.com/f-dangel/backpack/pull/348)) - Improve efficiency of Hessian-vector product ([PR](https://github.com/f-dangel/backpack/pull/341))