Skip to content

Commit

Permalink
rename DOLMA -> OLMo (allenai#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh authored Apr 6, 2023
1 parent 5607566 commit 5d167cf
Show file tree
Hide file tree
Showing 39 changed files with 138 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body:
```python
# All necessary imports at the beginning
import dolma
import olmo
# A succinct reproducing example trimmed down to the essential parts:
assert False is True, "Oh no!"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ jobs:
if: always()
run: |
. .venv/bin/activate
pip uninstall -y dolma
pip uninstall -y olmo
gpu_tests:
name: GPU Tests
runs-on: ubuntu-latest
timeout-minutes: 15
env:
BEAKER_TOKEN: ${{ secrets.BEAKER_TOKEN }}
BEAKER_IMAGE: dolma-torch2-test
BEAKER_IMAGE: olmo-torch2-test
BEAKER_WORKSPACE: ai2/llm-testing
steps:
- name: Determine current commit SHA (pull request)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
branches:
- main
paths:
- 'dolma/**'
- 'olmo/**'

jobs:
changelog:
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ When you're ready to contribute code to address an open issue, please follow the

Then you can create and activate a new Python environment by running:

conda create -n dolma python=3.9
conda activate dolma
conda create -n olmo python=3.9
conda activate olmo

Once your virtual environment is activated, you can install your local clone in "editable mode" with

Expand Down Expand Up @@ -139,13 +139,13 @@ When you're ready to contribute code to address an open issue, please follow the

We also strive to maintain high test coverage, so most contributions should include additions to [the unit tests](https://github.com/allenai/LLM/tree/main/tests). These tests are run with [`pytest`](https://docs.pytest.org/en/latest/), which you can use to locally run any test modules that you've added or changed.

For example, if you've fixed a bug in `dolma/a/b.py`, you can run the tests specific to that module with
For example, if you've fixed a bug in `olmo/a/b.py`, you can run the tests specific to that module with

pytest -v tests/a/b_test.py

To check the code coverage locally in this example, you could run

pytest -v --cov dolma.a.b tests/a/b_test.py
pytest -v --cov olmo.a.b tests/a/b_test.py

If your contribution involves additions to any public part of the API, we require that you write docstrings
for each function, method, class, or module that you add.
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# If you update this, also update BEAKER_IMAGE in .github/workflows/main.yml
IMAGE_NAME_BASE = dolma-torch2
IMAGE_NAME_BASE = olmo-torch2
# If you update this, also update BEAKER_WORKSPACE in .github/workflows/main.yml
BEAKER_WORKSPACE = ai2/llm-testing

Expand All @@ -24,7 +24,7 @@ beaker-info :
.PHONY : images
images : gantry-image test-image

PHONY : base-image
.PHONY : base-image
base-image :
docker build -f docker/Dockerfile.base -t $(IMAGE_NAME_BASE)-base .

Expand Down Expand Up @@ -91,7 +91,7 @@ gantry-run-ib :
--env NCCL_DEBUG=INFO \
--env SCRATCH_DIR=/tmp/scratch \
--env FLASH_DIR=/tmp/flash \
--env WANDB_PROJECT=dolma-beaker-ib \
--env WANDB_PROJECT=olmo-beaker-ib \
--env-secret WANDB_API_KEY=WANDB_API_KEY \
--replicas 4 \
--leader-selection \
Expand All @@ -103,8 +103,8 @@ gantry-run-ib :

.PHONY : check-cpu-install
check-cpu-install :
@python -c 'from dolma import check_install; check_install(cuda=False)'
@python -c 'from olmo import check_install; check_install(cuda=False)'

.PHONY : check-cuda-install
check-cuda-install :
@python -c 'from dolma import check_install; check_install(cuda=True)'
@python -c 'from olmo import check_install; check_install(cuda=True)'
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DOLMA: Delightful Open Language Model from AI2
# OLMo: Delightful Open Language Model from AI2

## Setup

Expand All @@ -24,7 +24,7 @@ gantry run \
--nfs \
--priority preemptible \
--gpus 8 \
--beaker-image dolma-torch2-gantry \
--beaker-image olmo-torch2-gantry \
--cluster 'ai2/*-cirrascale' \
--allow-dirty \
-- composer scripts/train.py configs/1.2b-c4.yaml
Expand All @@ -36,7 +36,7 @@ Train the 70B model on c4 with gantry across multiple nodes:
gantry run \
--workspace ai2/llm-testing \
--priority "high" \
--beaker-image dolma-torch2-gantry \
--beaker-image olmo-torch2-gantry \
--cluster ai2/general-cirrascale-a100-80g-ib \
--gpus 8 \
--nfs \
Expand All @@ -45,7 +45,7 @@ gantry run \
--env NCCL_DEBUG=INFO \
--env SCRATCH_DIR=/tmp/scratch \
--env FLASH_DIR=/tmp/flash \
--env WANDB_PROJECT=dolma-beaker-ib \
--env WANDB_PROJECT=olmo-beaker-ib \
--env-secret WANDB_API_KEY=WANDB_API_KEY \
--replicas 4 \
--leader-selection \
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Steps

1. Update the version in `dolma/version.py`.
1. Update the version in `olmo/version.py`.

3. Run the release script:

Expand Down
4 changes: 2 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from dolma.config import (
from olmo.config import (
DataConfig,
ModelConfig,
OptimizerConfig,
Expand All @@ -11,7 +11,7 @@
TokenizerConfig,
TrainConfig,
)
from dolma.tokenizer import Tokenizer
from olmo.tokenizer import Tokenizer

TEST_MODEL = "gpt2"

Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.gantry
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# To build and push the image to Beaker, run 'make gantry-image'.
# To test the image after pushing to Beaker, run 'make gantry-test'.

FROM dolma-torch2-base
FROM olmo-torch2-base

WORKDIR /stage

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

WORKDIR /app/dolma
WORKDIR /app/olmo
2 changes: 1 addition & 1 deletion docker/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# To build and push the image to Beaker, run 'make test-image'.

FROM dolma-torch2-base
FROM olmo-torch2-base

COPY scripts/test_entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
Expand Down
19 changes: 0 additions & 19 deletions dolma/exceptions.py

This file was deleted.

2 changes: 1 addition & 1 deletion dolma/__init__.py → olmo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def check_install(cuda: bool = False):
assert torch.cuda.is_available(), "CUDA is not available!"
print("CUDA available")

print(f"DOLMA v{VERSION} installed")
print(f"OLMo v{VERSION} installed")
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions dolma/composer.py → olmo/composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
TrainConfig,
)
from .data import DataCollator, MemMapDataset
from .exceptions import DolmaConfigurationError
from .model import Dolma, LayerNormBase
from .exceptions import OlmoConfigurationError
from .model import LayerNormBase, Olmo
from .optim import DecoupledLionW

log = logging.getLogger(__name__)

__all__ = [
"TrainBatchPerplexity",
"ComposerDolmaLM",
"DolmaConsoleLogger",
"ComposerOlmoLM",
"OlmoConsoleLogger",
"build_dataloader",
"build_optimizer",
"build_scheduler",
Expand Down Expand Up @@ -76,10 +76,10 @@ def compute(self) -> torch.Tensor:
return torch.exp(self.loss)


class ComposerDolmaLM(ComposerModel):
def __init__(self, model_or_config: Union[Dolma, ModelConfig]):
class ComposerOlmoLM(ComposerModel):
def __init__(self, model_or_config: Union[Olmo, ModelConfig]):
super().__init__()
self.model = Dolma(model_or_config) if isinstance(model_or_config, ModelConfig) else model_or_config
self.model = Olmo(model_or_config) if isinstance(model_or_config, ModelConfig) else model_or_config
self.config = self.model.config
self.num_fwd_flops = self.model.num_fwd_flops

Expand Down Expand Up @@ -131,7 +131,7 @@ def flops_per_batch(self, batch: BatchDict):
return self.num_fwd_flops * 3 * batch["input_ids"].shape[0]


class DolmaConsoleLogger(ConsoleLogger):
class OlmoConsoleLogger(ConsoleLogger):
metrics_to_log: Set[str] = {"loss/train/total", "trainer/global_step", "metrics/*"}

def log_metrics(self, metrics: dict[str, float], step: Optional[int] = None) -> None:
Expand Down Expand Up @@ -285,7 +285,7 @@ def calculate_batch_size_info(
global_batch_size: int, device_microbatch_size: Union[int, str]
) -> Tuple[int, Union[str, int], Union[str, int]]:
if global_batch_size % dist.get_world_size() != 0:
raise DolmaConfigurationError(
raise OlmoConfigurationError(
f"Global batch size {global_batch_size} is not divisible by {dist.get_world_size()} "
"as a result, the batch size would be truncated, please adjust `global_batch_size` "
f"to be divisible by world size, {dist.get_world_size()}."
Expand All @@ -303,7 +303,7 @@ def calculate_batch_size_info(
device_microbatch_size = device_batch_size
device_grad_accum = math.ceil(device_batch_size / device_microbatch_size)
else:
raise DolmaConfigurationError(f"Not sure how to parse {device_microbatch_size=}")
raise OlmoConfigurationError(f"Not sure how to parse {device_microbatch_size=}")

return device_batch_size, device_microbatch_size, device_grad_accum

Expand All @@ -324,7 +324,7 @@ def update_batch_size_info(cfg: TrainConfig):
elif isinstance(cfg.device_train_microbatch_size, int):
cfg.device_eval_batch_size = cfg.device_train_microbatch_size
else:
raise DolmaConfigurationError(
raise OlmoConfigurationError(
f"Not sure how to parse device_train_microbatch_size={cfg.device_train_microbatch_size}"
)
return cfg
10 changes: 5 additions & 5 deletions dolma/config.py → olmo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from omegaconf.errors import OmegaConfBaseException

from .aliases import PathOrStr
from .exceptions import DolmaConfigurationError
from .exceptions import OlmoConfigurationError

__all__ = [
"ActivationType",
Expand Down Expand Up @@ -90,7 +90,7 @@ def new(cls: Type[C], **kwargs) -> C:
conf = om.merge(conf, kwargs)
return cast(C, om.to_object(conf))
except OmegaConfBaseException as e:
raise DolmaConfigurationError(str(e))
raise OlmoConfigurationError(str(e))

@classmethod
def load(cls: Type[C], path: PathOrStr, overrides: Optional[List[str]] = None) -> C:
Expand All @@ -103,7 +103,7 @@ def load(cls: Type[C], path: PathOrStr, overrides: Optional[List[str]] = None) -
conf = om.merge(conf, om.from_dotlist(overrides))
return cast(C, om.to_object(conf))
except OmegaConfBaseException as e:
raise DolmaConfigurationError(str(e))
raise OlmoConfigurationError(str(e))

def save(self, path: PathOrStr) -> None:
"""Save to a YAML file."""
Expand Down Expand Up @@ -155,7 +155,7 @@ class BlockType(StrEnum):
@dataclass
class ModelConfig(BaseConfig):
"""
DOLMA (model) configuration.
OLMo (model) configuration.
"""

# Note that the defaults for these attributes are equivalent to the base GPT2 model.
Expand Down Expand Up @@ -401,7 +401,7 @@ class CompilerConfig(BaseConfig):
@dataclass
class TrainConfig(BaseConfig):
"""
DOLMA training configuration.
OLMo training configuration.
"""

run_name: Optional[str] = None
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions olmo/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
__all__ = ["OlmoError", "OlmoConfigurationError", "OlmoCliError"]


class OlmoError(Exception):
"""
Base class for all custom OLMo exceptions.
"""


class OlmoConfigurationError(OlmoError):
"""
An error with a configuration file.
"""


class OlmoCliError(OlmoError):
"""
An error from incorrect CLI usage.
"""
Loading

0 comments on commit 5d167cf

Please sign in to comment.