Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output eval logging batch #961

Merged
merged 50 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
dbf5535
Skip flaky lion8b test (#598)
dblalock Sep 15, 2023
315afb5
add eval output logging
bmosaicml Sep 19, 2023
215b802
add back tasks
bmosaicml Sep 19, 2023
ebef847
foo
bmosaicml Sep 19, 2023
467ac3a
add rlhf prompts
bmosaicml Sep 19, 2023
ef91472
add rlhf prompts
bmosaicml Sep 19, 2023
c1db48c
add rlhf prompts
bmosaicml Sep 19, 2023
ff63cfd
add rlhf prompts
bmosaicml Sep 19, 2023
0dc30b0
add rlhf prompts
bmosaicml Sep 20, 2023
6d93ba6
fix prompt
bmosaicml Sep 20, 2023
5254833
fix prompt
bmosaicml Sep 20, 2023
af32824
modify mcli
bmosaicml Nov 15, 2023
29c297a
Merge branch 'main' into output_eval_logging
bmosaicml Nov 15, 2023
91c6c71
test
bmosaicml Nov 27, 2023
b28fd6e
test
bmosaicml Nov 27, 2023
1e6e923
fix
bmosaicml Nov 27, 2023
e386107
Merge branch 'main' into output_eval_logging
bmosaicml Dec 15, 2023
b028545
Merge branch 'main' into output_eval_logging
bmosaicml Dec 15, 2023
4a8e9c3
Merge branch 'output_eval_logging' of github.com:mosaicml/llm-foundry…
bmosaicml Jan 22, 2024
6eee1d4
fix merge
maxisawesome Feb 2, 2024
f962e49
wip
maxisawesome Feb 5, 2024
2d420c1
merge
maxisawesome Feb 8, 2024
7160d38
reset files, wip commit
maxisawesome Feb 8, 2024
afe16c5
rm small changes
maxisawesome Feb 8, 2024
6a227d3
reduce changes
maxisawesome Feb 8, 2024
5e69fd9
reduce changes
maxisawesome Feb 8, 2024
53aca19
.
maxisawesome Feb 8, 2024
73757ba
wip
maxisawesome Feb 9, 2024
f5b3cb2
rm batch keys
maxisawesome Feb 12, 2024
286b12d
Merge branch 'main' into output_eval_logging_batch
maxisawesome Feb 23, 2024
d8d80e9
revert init device
maxisawesome Feb 23, 2024
d865d78
Merge branch 'main' into output_eval_logging_batch
maxisawesome Feb 23, 2024
3d09bb5
Merge branch 'main' into output_eval_logging_batch
maxisawesome Feb 26, 2024
0be6e2d
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 9, 2024
a295147
linting
maxisawesome Mar 11, 2024
cbc033d
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 11, 2024
f9839c8
add import
maxisawesome Mar 11, 2024
5e2072d
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 11, 2024
1275bdb
fix import
maxisawesome Mar 11, 2024
fa5c715
Merge branch 'output_eval_logging_batch' of github.com:maxisawesome/l…
maxisawesome Mar 11, 2024
f12afd5
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 12, 2024
373a678
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 15, 2024
87f10ee
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 19, 2024
af25a96
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 21, 2024
443f763
add eval_output_logging to registry
maxisawesome Mar 21, 2024
904af64
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 25, 2024
f0c11fc
readd import
maxisawesome Mar 25, 2024
fc1c359
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 27, 2024
27d8e54
pyright + linting
maxisawesome Mar 27, 2024
5fd90b4
Merge branch 'main' into output_eval_logging_batch
maxisawesome Mar 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions llmfoundry/callbacks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright 2022 MosaicML LLM Foundry authors
# SPDX-License-Identifier: Apache-2.0

from composer.callbacks import (EarlyStopper, Generate, LRMonitor,
MemoryMonitor, MemorySnapshot, OOMObserver,
OptimizerMonitor, RuntimeEstimator,
from composer.callbacks import (EarlyStopper, EvalOutputLogging, Generate,
LRMonitor, MemoryMonitor, MemorySnapshot,
OOMObserver, OptimizerMonitor, RuntimeEstimator,
SpeedMonitor)

from llmfoundry.callbacks.async_eval_callback import AsyncEval
Expand Down Expand Up @@ -33,6 +33,7 @@
callbacks.register('mono_checkpoint_saver', func=MonolithicCheckpointSaver)
callbacks.register('scheduled_gc', func=ScheduledGarbageCollector)
callbacks.register('oom_observer', func=OOMObserver)
callbacks.register('eval_output_logging', func=EvalOutputLogging)

callbacks_with_config.register('async_eval', func=AsyncEval)
callbacks_with_config.register('curriculum_learning', func=CurriculumLearning)
Expand Down
19 changes: 16 additions & 3 deletions scripts/eval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import pandas as pd
import torch
from composer.core import Callback
from composer.loggers.logger_destination import LoggerDestination
from composer.trainer import Trainer
from composer.utils import dist, get_device, reproducibility
Expand All @@ -23,8 +24,9 @@

install()
from llmfoundry.utils.builders import (add_metrics_to_eval_loaders,
build_composer_model, build_evaluators,
build_logger, build_tokenizer)
build_callback, build_composer_model,
build_evaluators, build_logger,
build_tokenizer)
from llmfoundry.utils.config_utils import (log_config, pop_config,
process_init_device)
from llmfoundry.utils.registry_utils import import_file
Expand All @@ -49,6 +51,7 @@ def evaluate_model(
eval_gauntlet_df: Optional[pd.DataFrame],
eval_subset_num_batches: int,
icl_subset_num_batches: Optional[int],
callback_configs: Optional[DictConfig],
metadata: Optional[Dict[str, str]],
logged_config: DictConfig,
should_log_config: bool = True,
Expand All @@ -73,7 +76,12 @@ def evaluate_model(
icl_subset_num_batches=icl_subset_num_batches,
)

callbacks = []
# Callbacks
callbacks: List[Callback] = [
build_callback(str(name), callback_cfg)
for name, callback_cfg in callback_configs.items()
] if callback_configs else []

if eval_gauntlet_callback is not None:
callbacks.append(eval_gauntlet_callback)

Expand Down Expand Up @@ -238,6 +246,10 @@ def main(cfg: DictConfig) -> Tuple[List[Trainer], pd.DataFrame]:

# Pop out interpolation variables.
pop_config(cfg, 'model_name_or_path', must_exist=False, default_value=None)
callback_configs: Optional[DictConfig] = pop_config(cfg,
'callbacks',
must_exist=False,
default_value=None)

# Warn for unused parameters
for key in cfg:
Expand Down Expand Up @@ -296,6 +308,7 @@ def main(cfg: DictConfig) -> Tuple[List[Trainer], pd.DataFrame]:
python_log_level=python_log_level,
precision=precision,
eval_gauntlet_df=eval_gauntlet_df,
callback_configs=callback_configs,
eval_subset_num_batches=eval_subset_num_batches,
icl_subset_num_batches=icl_subset_num_batches,
metadata=metadata,
Expand Down
Loading