Lightning-AI / Lightning-AI/litgpt

`jsonargparse==4.42.0` causing `test_config_help` failure

Open
#2,150 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.7k
Forks
1.5k
Avg merge
15h 37m
Merged PRs (30d)
1

Description

`jsonargparse==4.42.0` is causing `test_config_help` failure while it passes untill `4.41.0`

```python

(litgpt) ⚡ fix/tests_config_hub ~/litgpt uv pip install jsonargparse==4.41.0
(litgpt) ⚡ fix/tests_config_hub ~/litgpt pytest tests/test_config_hub.py::test_config_help
============================================ test session starts =============================================
platform linux -- Python 3.12.11, pytest-8.4.2, pluggy-1.6.0
benchmark: 5.1.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /teamspace/studios/this_studio/litgpt
configfile: pyproject.toml
plugins: benchmark-5.1.0, anyio-4.11.0, timeout-2.4.0, rerunfailures-16.1, dependency-0.6.0
collected 46 items

tests/test_config_hub.py .............................................. [100%]

======================================= 46 passed, 6 warnings in 9.67s =======================================
```

```python
(litgpt) ⚡ fix/tests_config_hub ~/litgpt uv pip install jsonargparse==4.42.0
(litgpt) ⚡ fix/tests_config_hub ~/litgpt pytest tests/test_config_hub.py::test_config_help
.....
error: Parser key "model_config":
Does not validate against any of the Union subtypes
Subtypes: [, ]
Errors:
- Expected a
- Problem with given class_path 'litgpt.Config':
__args__
Given value type:
Given value: {'name': 'stories15M', 'hf_config': {}, 'scale_embeddings': False, 'block_size': 256, 'padded_vocab_size': 32000, 'n_layer': 6, 'n_head': 6, 'n_query_groups': 6, 'n_embd': 288, 'head_size': 48, 'rotary_percentage': 1.0, 'parallel_residual': False, 'bias': False, 'norm_class_name': 'RMSNorm', 'mlp_class_name': 'LLaMAMLP', 'intermediate_size': 768}
========================================== short test summary info ===========================================
FAILED tests/test_config_hub.py::test_config_help[litgpt/pretrain.py-pretrain/tinystories.yaml] - SystemExit: 2
FAILED tests/test_config_hub.py::test_config_help[litgpt/pretrain.py-https://raw.githubusercontent.com/Lightning-AI/litgpt/main/config_hub/pretrain/tinystorie

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/test_config_hub.py::test_config_help and reproduce the failure using jsonargparse 4.42.0, then compare it with 4.41.0. The work is done when the test_config_help cases pass with jsonargparse 4.42.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.