Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/coverage-toml--7.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mvpatel2000 authored Aug 12, 2024
2 parents 5f87526 + d3c01a0 commit 0b7c69b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
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'
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 0b7c69b

Please sign in to comment.