From 6cfc590716cbf52e09033ae11ebee10864ef7589 Mon Sep 17 00:00:00 2001 From: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com> Date: Fri, 22 Mar 2024 02:56:05 +0100 Subject: [PATCH] Re-enable LightningCLI test disabled due to bug in jsonargparse (#19683) --- requirements/pytorch/extra.txt | 2 +- src/lightning/pytorch/cli.py | 2 +- tests/tests_pytorch/test_cli.py | 7 ------- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/requirements/pytorch/extra.txt b/requirements/pytorch/extra.txt index 55960d7cd11cb..8df61e4834769 100644 --- a/requirements/pytorch/extra.txt +++ b/requirements/pytorch/extra.txt @@ -5,7 +5,7 @@ matplotlib>3.1, <3.9.0 omegaconf >=2.0.5, <2.4.0 hydra-core >=1.0.5, <1.4.0 -jsonargparse[signatures] >=4.27.5, <4.28.0 +jsonargparse[signatures] >=4.27.7, <4.28.0 rich >=12.3.0, <13.6.0 tensorboardX >=2.2, <2.7.0 # min version is set by torch.onnx missing attribute bitsandbytes >=0.42.0,<0.43.0 diff --git a/src/lightning/pytorch/cli.py b/src/lightning/pytorch/cli.py index 30318c072bfd2..a6854b9bf6d89 100644 --- a/src/lightning/pytorch/cli.py +++ b/src/lightning/pytorch/cli.py @@ -34,7 +34,7 @@ from lightning.pytorch.utilities.model_helpers import is_overridden from lightning.pytorch.utilities.rank_zero import rank_zero_warn -_JSONARGPARSE_SIGNATURES_AVAILABLE = RequirementCache("jsonargparse[signatures]>=4.27.5") +_JSONARGPARSE_SIGNATURES_AVAILABLE = RequirementCache("jsonargparse[signatures]>=4.27.7") if _JSONARGPARSE_SIGNATURES_AVAILABLE: import docstring_parser diff --git a/tests/tests_pytorch/test_cli.py b/tests/tests_pytorch/test_cli.py index 89c224b2fb3b8..605f4ec3845e7 100644 --- a/tests/tests_pytorch/test_cli.py +++ b/tests/tests_pytorch/test_cli.py @@ -47,7 +47,6 @@ from lightning.pytorch.utilities.exceptions import MisconfigurationException from lightning.pytorch.utilities.imports import _TORCHVISION_AVAILABLE from lightning_utilities import compare_version -from lightning_utilities.core.imports import RequirementCache from lightning_utilities.test.warning import no_warning_call from tensorboard.backend.event_processing import event_accumulator from tensorboard.plugins.hparams.plugin_data_pb2 import HParamsPluginData @@ -1482,12 +1481,6 @@ def __init__(self, activation: torch.nn.Module = lazy_instance(torch.nn.LeakyReL assert cli.model.activation is not model.activation -@pytest.mark.xfail( - # https://github.com/omni-us/jsonargparse/issues/473 - condition=(RequirementCache("jsonargparse>=4.27.6")), - strict=False, - reason="Breaking change for `lazy_instance` in jsonargparse", -) def test_ddpstrategy_instantiation_and_find_unused_parameters(mps_count_0): strategy_default = lazy_instance(DDPStrategy, find_unused_parameters=True) with mock.patch("sys.argv", ["any.py", "--trainer.strategy.process_group_backend=group"]):