Skip to content

Commit

Permalink
Change benchmarks --> examples in code (#48)
Browse files Browse the repository at this point in the history
* Change benchmarks --> examples in README

* Change benchmarks --> examples in all files

* Change benchmarks --> examples in automatic file header

* Fix capitalization
  • Loading branch information
nik-mosaic authored Dec 16, 2022
1 parent 084d3e5 commit e7f5154
Show file tree
Hide file tree
Showing 71 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .ci/FILE_HEADER
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Copyright 2022 MosaicML Benchmarks authors
Copyright 2022 MosaicML Examples authors
SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 MosaicML Benchmarks authors
Copyright 2022 MosaicML Examples authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# benchmarks
# Examples

Fast reference benchmarks for training ML models with recipes. Designed to be easily forked and modified.
Fast reference examples for training ML models with recipes. Designed to be easily forked and modified.
## ResNet-50 + ImageNet
<img src="https://assets-global.website-files.com/61fd4eb76a8d78bc0676b47d/62a12d1e4eb9b83915be37a6_r50_overall_pareto.png" alt="drawing" width="500"/>

Expand Down
2 changes: 1 addition & 1 deletion bert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This recommended Docker image comes pre-configured with the following dependenci
To get started, clone this repo and install the requirements:

```bash
git clone https://github.com/mosaicml/benchmarks.git
git clone https://github.com/mosaicml/examples.git
cd bert
pip install -r requirements.txt
```
Expand Down
2 changes: 1 addition & 1 deletion bert/convert_c4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""C4 streaming dataset conversion script."""
Expand Down
2 changes: 1 addition & 1 deletion bert/glue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import copy
Expand Down
2 changes: 1 addition & 1 deletion bert/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import os
Expand Down
2 changes: 1 addition & 1 deletion bert/src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion bert/src/bert_layers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
Expand Down
2 changes: 1 addition & 1 deletion bert/src/bert_padding.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

# Adapted from https://github.com/HazyResearch/flash-attention/blob/main/flash_attn/bert_padding.py
Expand Down
2 changes: 1 addition & 1 deletion bert/src/data_c4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""Build a StreamingC4 dataset and dataloader for training."""
Expand Down
2 changes: 1 addition & 1 deletion bert/src/flash_attn_triton.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""Triton implementation of Flash Attention.
Expand Down
2 changes: 1 addition & 1 deletion bert/src/glue/data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import logging
Expand Down
2 changes: 1 addition & 1 deletion bert/src/glue/finetuning_jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

# """Contains GLUE job objects for the simple_glue_trainer."""
Expand Down
2 changes: 1 addition & 1 deletion bert/src/hf_bert.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""Implements a Hugging Face BERT wrapped inside a :class:`.ComposerModel`."""
Expand Down
2 changes: 1 addition & 1 deletion bert/src/mosaic_bert.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""Implements a Mosaic BERT wrapper around a :class:`.ComposerTransformer`."""
Expand Down
4 changes: 2 additions & 2 deletions bert/yamls/glue/mcloud_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ gpu_num: 8 # Number of GPUs to use
image: mosaicml/pytorch:1.12.1_cu116-python3.9-ubuntu20.04
integrations:
- integration_type: git_repo
git_repo: mosaicml/benchmarks
git_repo: mosaicml/examples
command: |
cd benchmarks/bert
cd examples/bert
pip install -r requirements.txt
python glue.py /mnt/config/parameters.yaml
Expand Down
4 changes: 2 additions & 2 deletions bert/yamls/main/mcloud_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ gpu_num: 8 # Number of GPUs to use
image: mosaicml/pytorch:1.12.1_cu116-python3.9-ubuntu20.04
integrations:
- integration_type: git_repo
git_repo: mosaicml/benchmarks
git_repo: mosaicml/examples
command: |
cd benchmarks/bert
cd examples/bert
pip install -r requirements.txt
composer main.py /mnt/config/parameters.yaml
Expand Down
2 changes: 1 addition & 1 deletion bert/yamls/test/glue.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use this YAML to verify that GLUE fine-tuning works. Runs on CPU or GPUs (if available).
# From `benchmarks/bert`, run:
# From `examples/bert`, run:
# `python glue.py yamls/test/glue.yaml` to run using the HuggingFace BERT
# `python glue.py yamls/test/glue.yaml model.name=mosaic_bert` to run using the Mosaic BERT

Expand Down
2 changes: 1 addition & 1 deletion bert/yamls/test/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use this YAML to verify that MLM pre-training works. Runs on CPU or GPUs (if available).
# From `benchmarks/bert`, run:
# From `examples/bert`, run:
# `composer main.py yamls/test/main.yaml` to run using the HuggingFace BERT
# `composer main.py yamls/test/main.yaml model.name=mosaic_bert` to run using the Mosaic BERT

Expand Down
2 changes: 1 addition & 1 deletion cifar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<a href="https://join.slack.com/t/mosaicml-community/shared_invite/zt-w0tiddn9-WGTlRpfjcO9J5jyrMub1dg">
<img alt="Chat @ Slack" src="https://img.shields.io/badge/slack-chat-2eb67d.svg?logo=slack">
</a>
<a href="https://github.com/mosaicml/benchmarks/blob/main/LICENSE">
<a href="https://github.com/mosaicml/examples/blob/main/LICENSE">
<img alt="License" src="https://img.shields.io/badge/License-Apache%202.0-green.svg?logo=slack">
</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion cifar/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion cifar/data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""CIFAR image classification dataset.
Expand Down
2 changes: 1 addition & 1 deletion cifar/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import os
Expand Down
2 changes: 1 addition & 1 deletion cifar/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""The CIFAR ResNet torch module.
Expand Down
2 changes: 1 addition & 1 deletion cifar/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion cifar/tests/test_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import pytest
Expand Down
2 changes: 1 addition & 1 deletion cifar/tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import pytest
Expand Down
4 changes: 2 additions & 2 deletions cifar/tests/test_trainer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import os
import sys

import pytest

# TODO: this should be removed when benchmarks has a setup.py i.e. installable
# TODO: this should be removed when examples has a setup.py i.e. installable
sys.path.append('.')

import torch
Expand Down
2 changes: 1 addition & 1 deletion cifar/tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import os
Expand Down
4 changes: 2 additions & 2 deletions cifar/yamls/mcloud_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ gpu_num: 8 # Number of GPUs to use
image: mosaicml/pytorch:1.12.1_cu116-python3.9-ubuntu20.04
integrations:
- integration_type: git_repo
git_repo: mosaicml/benchmarks
git_repo: mosaicml/examples
git_branch: landan/cifar_benchmark
command: |
cd benchmarks/cifar
cd examples/cifar
pip install -r requirements.txt
composer main.py yamls/resnet56.yaml
4 changes: 2 additions & 2 deletions deeplab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<a href="https://join.slack.com/t/mosaicml-community/shared_invite/zt-w0tiddn9-WGTlRpfjcO9J5jyrMub1dg">
<img alt="Chat @ Slack" src="https://img.shields.io/badge/slack-chat-2eb67d.svg?logo=slack">
</a>
<a href="https://github.com/mosaicml/benchmarks/blob/main/LICENSE">
<a href="https://github.com/mosaicml/examples/blob/main/LICENSE">
<img alt="License" src="https://img.shields.io/badge/License-Apache%202.0-green.svg?logo=slack">
</a>
</p>
Expand Down Expand Up @@ -98,7 +98,7 @@ But if you really must try this manually on your own cluster, then just provide
either directly via CLI, or via environment variables that can be read. Then launch the appropriate command on each node:

### Overriding Arguments
Composer benchmarks uses [`omegaconf`](https://github.com/omry/omegaconf) to manage configs. OmegaConf allows us to override YAML configs from the command line for quick experimentation.
Composer examples uses [`omegaconf`](https://github.com/omry/omegaconf) to manage configs. OmegaConf allows us to override YAML configs from the command line for quick experimentation.

Common examples include:

Expand Down
2 changes: 1 addition & 1 deletion deeplab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion deeplab/data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""ADE20K Semantic segmentation and scene parsing dataset.
Expand Down
2 changes: 1 addition & 1 deletion deeplab/download_ade20k.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""ADE20K Semantic segmentation and scene parsing dataset.
Expand Down
2 changes: 1 addition & 1 deletion deeplab/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""Example script to train a DeepLabv3 model on ADE20k."""
Expand Down
2 changes: 1 addition & 1 deletion deeplab/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""DeepLabV3 model extending :class:`.ComposerClassifier`."""
Expand Down
2 changes: 1 addition & 1 deletion deeplab/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion deeplab/tests/test_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import os
Expand Down
2 changes: 1 addition & 1 deletion deeplab/tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import pytest
Expand Down
4 changes: 2 additions & 2 deletions deeplab/tests/test_trainer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import os
import sys

import pytest

# TODO: this should be removed when benchmarks has a setup.py i.e. installable
# TODO: this should be removed when examples has a setup.py i.e. installable
sys.path.append('.')

import torch
Expand Down
2 changes: 1 addition & 1 deletion deeplab/transforms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""ADE20K Semantic segmentation and scene parsing dataset.
Expand Down
4 changes: 2 additions & 2 deletions deeplab/yamls/mcloud_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ gpu_num: 8 # Number of GPUs to use specified as an integer
image: mosaicml/pytorch_vision:1.12.1_cu116-python3.9-ubuntu20.04
integrations:
- integration_type: git_repo
git_repo: mosaicml/benchmarks
git_repo: mosaicml/examples
command: |
cd benchmarks/deeplab
cd examples/deeplab
pip install -r requirements.txt
composer main.py /mnt/config/parameters.yaml
# Configuration copied from baseline.yaml
Expand Down
2 changes: 1 addition & 1 deletion llm/convert_c4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""C4 streaming dataset conversion scripts."""
Expand Down
2 changes: 1 addition & 1 deletion llm/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import os
Expand Down
2 changes: 1 addition & 1 deletion llm/src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion llm/src/data_c4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""Build a StreamingC4 dataset and dataloader for training."""
Expand Down
4 changes: 2 additions & 2 deletions llm/src/evaluation/eval.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import argparse
Expand Down Expand Up @@ -110,7 +110,7 @@ def log_results_to_tsv(results: JsonResults, outfile: str) -> None:


if __name__ == '__main__':
"""Example usage from benchmarks/llm directory:
"""Example usage from examples/llm directory:
python -m src.evaluation.eval --experiment_name opt_1.3b \
--model_type pretrained_hf \
Expand Down
2 changes: 1 addition & 1 deletion llm/src/evaluation/model_loading.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import os
Expand Down
2 changes: 1 addition & 1 deletion llm/src/hf_causal_lm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import torch
Expand Down
2 changes: 1 addition & 1 deletion llm/src/model_registry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

from src.hf_causal_lm import ComposerHFCausalLM
Expand Down
2 changes: 1 addition & 1 deletion llm/src/mosaic_gpt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

"""A simple, flexible implementation of a GPT model.
Expand Down
2 changes: 1 addition & 1 deletion llm/src/tokenizer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

from abc import ABC, abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion llm/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion llm/tests/c4_data_prep_script.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import os
Expand Down
2 changes: 1 addition & 1 deletion llm/tests/compare_hf_v_mosaic_gpt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MosaicML Benchmarks authors
# Copyright 2022 MosaicML Examples authors
# SPDX-License-Identifier: Apache-2.0

import warnings
Expand Down
Loading

0 comments on commit e7f5154

Please sign in to comment.