Skip to content

Commit

Permalink
Update license (mosaicml#1026)
Browse files Browse the repository at this point in the history
* update license header precommit

* update LICENSE author

* update all licenses

* rename COPYRIGHT HEADER
  • Loading branch information
hanlint authored May 10, 2022
1 parent 3b036c5 commit 0f1624e
Show file tree
Hide file tree
Showing 309 changed files with 717 additions and 410 deletions.
2 changes: 2 additions & 0 deletions .ci/FILE_HEADER
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright 2022 MosaicML Composer authors
SPDX-License-Identifier: Apache-2.0
74 changes: 37 additions & 37 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
default_language_version:
python: python3
python: python3
repos:
- repo: https://github.com/google/yapf
- repo: https://github.com/google/yapf
rev: v0.32.0
hooks:
- id: yapf
- id: yapf
name: yapf
description: "A formatter for Python files."
entry: yapf
Expand All @@ -13,58 +13,58 @@ repos:
types: [python]
additional_dependencies:
- "toml"
- repo: https://github.com/pycqa/isort
- repo: https://github.com/pycqa/isort
hooks:
- id: isort
rev: 5.10.1
# - repo: https://github.com/pycqa/pylint
# hooks:
# - id: pylint
# entry: pylint
# args: ['composer', 'examples', 'tests']
# language: python
# types: [python]
# require_serial: true
# rev: v2.12.2
- repo: local
# - repo: https://github.com/pycqa/pylint
# hooks:
# - id: pylint
# entry: pylint
# args: ['composer', 'examples', 'tests']
# language: python
# types: [python]
# require_serial: true
# rev: v2.12.2
- repo: local
hooks:
- id: pyright
- id: pyright
name: pyright
entry: pyright
language: node
types: [python]
pass_filenames: false
args: [--warnings]
additional_dependencies: ["pyright@1.1.243"]
# - repo: https://github.com/PyCQA/pydocstyle
# hooks:
# - id: pydocstyle
# name: pydocstyle
# entry: pydocstyle
# language: python
# types: [python]
# additional_dependencies:
# - "toml"
# rev: 6.1.1
- repo: https://github.com/pre-commit/pre-commit-hooks
# - repo: https://github.com/PyCQA/pydocstyle
# hooks:
# - id: pydocstyle
# name: pydocstyle
# entry: pydocstyle
# language: python
# types: [python]
# additional_dependencies:
# - "toml"
# rev: 6.1.1
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
# - id: trailing-whitespace # TODO(ravi): Enable this check later. Generates a large diff.
# - id: end-of-file-fixer # TODO(ravi): Enable this check later. Generates a large diff.
- id: check-docstring-first
- id: check-yaml
- id: debug-statements
# - id: trailing-whitespace # TODO(ravi): Enable this check later. Generates a large diff.
# - id: end-of-file-fixer # TODO(ravi): Enable this check later. Generates a large diff.
- id: check-docstring-first
- id: check-yaml
- id: debug-statements
# - id: name-tests-test # TODO(ravi): Enable this check later. Generates a large diff.
# args: ['--django']
# - id: double-quote-string-fixer # TODO(ravi): Enable this check later. Generates a large diff.
- repo: https://github.com/Lucas-C/pre-commit-hooks
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.13
hooks:
- id: insert-license
- id: insert-license
files: composer
args:
- --license-filepath
- COPYRIGHT_HEADER
- --comment-style
- "#"
- --license-filepath
- .ci/FILE_HEADER
- --comment-style
- "#"
types: [python]
1 change: 0 additions & 1 deletion COPYRIGHT_HEADER

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

END OF TERMS AND CONDITIONS

Copyright 2022 MosaicML
Copyright 2022 MosaicML Composer 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
3 changes: 2 additions & 1 deletion composer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

from composer import algorithms as algorithms
from composer import callbacks as callbacks
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Efficiency methods for training.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/agc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""`Adaptive gradient Clipping <https://arxiv.org/abs/2102.06171>`_ Clips all gradients in model based on ratio of
gradient norms to parameter norms.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/agc/agc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core adaptive gradient clipping classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/algorithm_hparams.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/algorithm_registry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

from typing import Dict, List, Type

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/alibi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""ALiBi (Attention with Linear Biases; `Press et al, 2021 <https://arxiv.org/abs/2108.12409>`_) dispenses with position
embeddings for tokens in transformer-based NLP models, instead encoding position information by biasing the query-key
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/alibi/_gpt2_alibi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

# _attn is used by the yaml codepath, even though it is private
# pyright: reportUnusedFunction=none
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/alibi/alibi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core ALiBi classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/augmix/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""AugMix (`Hendrycks et al, 2020 <http://arxiv.org/abs/1912.02781>`_) creates multiple independent realizations of
sequences of image augmentations, applies each sequence with random intensity, and returns a convex combination of the
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/augmix/augmix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core AugMix classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/blurpool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""`BlurPool <http://proceedings.mlr.press/v97/zhang19a.html>`_ adds anti-aliasing filters to convolutional layers to
increase accuracy and invariance to small shifts in the input.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/blurpool/blurpool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/blurpool/blurpool_layers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

# type: ignore
from typing import Optional
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/channels_last/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Changes the memory format of the model to ``torch.channels_last``.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/channels_last/channels_last.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""ChannelsLast algorithm."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/colout/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Drops a fraction of the rows and columns of an input image. If the fraction of rows/columns dropped isn't too large,
this does not significantly alter the content of the image, but reduces its size and provides extra variability.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/colout/colout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core ColOut classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/cutmix/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""`CutMix <https://arxiv.org/abs/1905.04899>`_ trains the network on non-overlapping combinations of pairs of examples
and iterpolated targets rather than individual examples and targets.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/cutmix/cutmix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core CutMix classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/cutout/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""`Cutout <https://arxiv.org/abs/1708.04552>`_ is a data augmentation technique that works by masking out one or more
square regions of an input image.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/cutout/cutout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core CutOut classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/ema/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Exponential moving average maintains a moving average of model parameters and uses these at test time.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/ema/ema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core Exponential Moving Average (EMA) classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/factorize/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Decomposes linear operators into pairs of smaller linear operators.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/factorize/factorize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/factorize/factorize_core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

import dataclasses
from typing import Optional, Tuple, Union
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/factorize/factorize_modules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/ghost_batchnorm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Replaces batch normalization modules with `Ghost Batch Normalization <https://arxiv.org/abs/1705.08741>`_ modules
that simulate the effect of using a smaller batch size.
Expand Down
5 changes: 3 additions & 2 deletions composer/algorithms/ghost_batchnorm/ghost_batchnorm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

import logging
import math
Expand Down Expand Up @@ -61,7 +62,7 @@ def maybe_replace(module: torch.nn.Module, module_index: int) -> Optional[torch.


class GhostBatchNorm(Algorithm):
"""Replaces batch normalization modules with
"""Replaces batch normalization modules with
`Ghost Batch Normalization <https://arxiv.org/abs/1705.08741>`_ modules
that simulate the effect of using a smaller batch size.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/hparams.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

import textwrap
from dataclasses import asdict, dataclass
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/label_smoothing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Shrinks targets towards a uniform distribution to counteract label noise. Introduced in `Rethinking the Inception
Architecture for Computer Vision <https://arxiv.org/abs/1512.00567>`_.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/label_smoothing/label_smoothing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core Label Smoothing classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/layer_freezing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Progressively freeze the layers of the network during training, starting with the earlier layers.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/layer_freezing/layer_freezing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core Layer Freezing classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/mixup/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Create new samples using convex combinations of pairs of samples.
Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/mixup/mixup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Core MixUp classes and functions."""

Expand Down
3 changes: 2 additions & 1 deletion composer/algorithms/no_op_model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 MosaicML. All Rights Reserved.
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0

"""Replaces model with a dummy model of type :class:`NoOpModelClass`.
Expand Down
Loading

0 comments on commit 0f1624e

Please sign in to comment.