-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small refactor for update batch size (#1293)
- Loading branch information
Showing
2 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2024 MosaicML LLM Foundry authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from llmfoundry.utils.config_utils import update_config_with_batch_size_info | ||
|
||
|
||
def test_update_config_with_batch_size_info(): | ||
config = {} | ||
config = update_config_with_batch_size_info(config, 1, 2, 3) | ||
|
||
assert config['n_gpus'] == 1 | ||
assert config['device_train_batch_size'] == 1 | ||
assert config['device_train_microbatch_size'] == 2 | ||
assert config['device_train_grad_accum'] == 3 | ||
assert config['device_eval_batch_size'] == 2 |