Skip to content

Commit

Permalink
Merge branch 'main' into update-version
Browse files Browse the repository at this point in the history
  • Loading branch information
irenedea authored Aug 13, 2024
2 parents 5c06aec + 7c47e70 commit 19536ad
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llmfoundry/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

"""The LLM Foundry Version."""

__version__ = '0.11.0.dev'
__version__ = '0.12.0.dev0'
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
extra_deps = {}

extra_deps['dev'] = [
'coverage[toml]==7.4.4',
'coverage[toml]==7.6.1',
'pre-commit>=3.4.0,<4',
'pytest>=7.2.1,<8',
'pytest_codeblocks>=0.16.1,<0.17',
'pytest_codeblocks>=0.16.1,<0.18',
'pytest-cov>=4,<6',
'pyright==1.1.256',
'toml>=0.10.2,<0.11',
Expand Down
32 changes: 32 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright 2024 MosaicML LLM Foundry authors
# SPDX-License-Identifier: Apache-2.0

import copy
from typing import Any, Dict, List

import catalogue
Expand Down Expand Up @@ -70,3 +71,34 @@ def dummy_transform(config: Dict[str, Any]) -> Dict[str, Any]:

del catalogue.REGISTRY[
('llmfoundry', 'config_transforms', 'dummy_transform')]


def test_logged_cfg():
config = DictConfig({
'global_train_batch_size': 1,
'device_train_microbatch_size': 1,
'model': {},
'scheduler': {},
'max_seq_len': 128,
'train_loader': {},
'max_duration': 1,
'tokenizer': {},
'eval_interval': 1,
'seed': 1,
'optimizer': {},
'variables': {},
},)
logged_config, _ = make_dataclass_and_log_config(
config,
TrainConfig,
TRAIN_CONFIG_KEYS,
transforms='all',
)
expected_config = copy.deepcopy(config)
expected_config.update({
'n_gpus': 1,
'device_train_batch_size': 1,
'device_train_grad_accum': 1,
'device_eval_batch_size': 1,
})
assert expected_config == logged_config

0 comments on commit 19536ad

Please sign in to comment.