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

[DO NOT MERGE] prototyping #1072

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d23e5d7
copy launcher.py from composer repo
ygong1 Mar 14, 2024
48a7ccc
case 1 can run successfully
ygong1 Mar 20, 2024
fbf6783
set up the credential to work with datbricks environment
ygong1 Mar 22, 2024
717568c
add sync logic
ygong1 Mar 22, 2024
ca72575
fix the log artifact upload bug
ygong1 Mar 22, 2024
9acc479
aa
ygong1 Mar 22, 2024
18bd472
bb
ygong1 Mar 22, 2024
0368cca
cc
ygong1 Mar 22, 2024
24db5fa
dd
ygong1 Mar 22, 2024
4c08f3b
remove packaging
ygong1 Mar 22, 2024
d8ba721
temprarily avoid displaying the button so that it can be runnable by …
ygong1 Mar 22, 2024
766a638
add more debuggin infor
ygong1 Mar 22, 2024
46734a1
cc
ygong1 Mar 22, 2024
f28cfbc
dd
ygong1 Mar 22, 2024
0737de7
add support for retry and preemption
shitaoli-db Mar 25, 2024
69375ab
use mcli style status
shitaoli-db Mar 25, 2024
518d60c
Merge branch 'prototype' of github.com:ygong1/llm-foundry into protot…
shitaoli-db Mar 26, 2024
3abd4fa
revert some change
shitaoli-db Mar 26, 2024
1359e58
make it works in job workflow
ygong1 Mar 27, 2024
4cd30cd
port shitao's change https://github.com/ygong1/llm-foundry/pull/1/files
ygong1 Mar 27, 2024
9dc842f
Merge branch 'prototype' of github.com:ygong1/llm-foundry into protot…
shitaoli-db Mar 27, 2024
461cb23
chagne
ygong1 Mar 27, 2024
a090962
aa
ygong1 Mar 27, 2024
b245134
init
shitaoli-db Mar 27, 2024
c62de3b
Merge branch 'prototype' of github.com:ygong1/llm-foundry into protot…
shitaoli-db Mar 27, 2024
aee64cc
tmp
shitaoli-db Mar 28, 2024
933d8db
Merge branch 'main' of github.com:shitaoli-db/llm-foundry into protot…
shitaoli-db Mar 28, 2024
65a7f30
fix
shitaoli-db Mar 28, 2024
d0bc121
fix
shitaoli-db Mar 28, 2024
6c39915
fix
shitaoli-db Mar 28, 2024
eea7218
fix triton
shitaoli-db 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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ my-copy-c4*/
my-copy-arxiv*/
*.jsonl*

ygong/notebook/*

# WandB
wandb/

Expand Down Expand Up @@ -156,3 +158,5 @@ notebooks/
**/mlruns/*
**/tokenizer-save-dir-*/**
**/.downloaded_finetuning/

.databricks
31 changes: 31 additions & 0 deletions llmfoundry/composerpatch/MLFlowLogger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from composer.loggers import MLFlowLogger as ComposerMLFlowLogger
from composer.utils import dist
import json
import os
from composer.core.state import State
from composer.loggers.logger import Logger



CONFIG_FILE = "/tmp/mlflow_config.yaml"
EXPERIMENT_ID_FIELD = "experiment_id"
RUN_ID_FIELD = "run_id"
TRACKING_URI_FIELD = "tracking_uri"


class MLFlowLogger(ComposerMLFlowLogger):

def init(self, state: State, logger: Logger) -> None:
super().init(state, logger)

if self._enabled and dist.get_local_rank() == 0:
if os.path.exists(CONFIG_FILE):
os.remove(CONFIG_FILE)

with open(CONFIG_FILE, "w") as f:
data = {
EXPERIMENT_ID_FIELD: self._experiment_id,
RUN_ID_FIELD: self._run_id,
TRACKING_URI_FIELD : self.tracking_uri,
}
json.dump(data, f)
Empty file.
26 changes: 17 additions & 9 deletions llmfoundry/utils/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from composer.core import Algorithm, Callback, Evaluator
from composer.datasets.in_context_learning_evaluation import \
get_icl_task_dataloader
from composer.loggers import (InMemoryLogger, LoggerDestination,
TensorboardLogger, WandBLogger)
from composer.loggers import LoggerDestination
from composer.models import ComposerModel
from composer.optim.scheduler import ComposerScheduler
Expand All @@ -24,6 +26,8 @@
from torchmetrics import Metric
from transformers import AutoTokenizer, PreTrainedTokenizerBase

from llmfoundry.composerpatch import MLFlowLogger

from llmfoundry import registry
from llmfoundry.callbacks import EvalGauntlet
from llmfoundry.data.dataloader import build_dataloader
Expand Down Expand Up @@ -236,15 +240,19 @@ def build_callback(
kwargs=kwargs)


def build_logger(name: str,
kwargs: Optional[Dict[str, Any]] = None) -> LoggerDestination:
"""Builds a logger from the registry."""
return construct_from_registry(name=name,
registry=registry.loggers,
partial_function=True,
pre_validation_function=LoggerDestination,
post_validation_function=None,
kwargs=kwargs)
def build_logger(name: str, kwargs: Dict[str, Any]) -> LoggerDestination:
if name == 'wandb':
return WandBLogger(**kwargs)
elif name == 'tensorboard':
return TensorboardLogger(**kwargs)
elif name == 'in_memory_logger':
return InMemoryLogger(**kwargs)
elif name == 'mlflow':
return MLFlowLogger.MLFlowLogger(**kwargs)
elif name == 'inmemory':
return InMemoryLogger(**kwargs)
else:
raise ValueError(f'Not sure how to build logger: {name}')


def build_algorithm(name: str,
Expand Down
Loading
Loading