From a0a7ff7359b80b61cd1b11a84ec748a9a4dd934a Mon Sep 17 00:00:00 2001 From: Wanchao Date: Mon, 15 Apr 2024 20:21:40 -0700 Subject: [PATCH] Update licenses and headers (#231) --- LICENSE | 28 ++++++++++++++++++++ docs/license_header.txt | 5 +++- setup.py | 9 ------- test/test_job_config.py | 5 +++- test/test_test.py | 8 ------ test_runner.py | 7 ++--- torchtitan/checkpoint.py | 5 +++- torchtitan/config_manager.py | 7 ++--- torchtitan/datasets/__init__.py | 5 +++- torchtitan/datasets/download_tokenizer.py | 6 ++--- torchtitan/datasets/hf_datasets.py | 5 +++- torchtitan/datasets/tokenizer.py | 2 +- torchtitan/float8_linear.py | 8 +++--- torchtitan/logging_utils.py | 5 +++- torchtitan/lr_scheduling.py | 6 ++--- torchtitan/metrics.py | 8 +++--- torchtitan/models/__init__.py | 5 +++- torchtitan/models/llama/__init__.py | 8 +++++- torchtitan/models/llama/model.py | 9 ++++++- torchtitan/models/norms.py | 5 +++- torchtitan/parallelisms/__init__.py | 5 +++- torchtitan/parallelisms/parallelize_llama.py | 5 +++- torchtitan/profiling.py | 5 +++- torchtitan/utils.py | 5 +++- train.py | 5 +++- 25 files changed, 118 insertions(+), 53 deletions(-) create mode 100644 LICENSE delete mode 100644 test/test_test.py diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..bc559a98 --- /dev/null +++ b/LICENSE @@ -0,0 +1,28 @@ +BSD 3-Clause License + +Copyright 2024 Meta + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice,this list +of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may +be used to endorse or promote products derived from this software without specific +prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/docs/license_header.txt b/docs/license_header.txt index 9e3028ab..dada37c7 100644 --- a/docs/license_header.txt +++ b/docs/license_header.txt @@ -1,2 +1,5 @@ Copyright (c) Meta Platforms, Inc. and affiliates. -This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +All rights reserved. + +This source code is licensed under the BSD-style license found in the +LICENSE file in the root directory of this source tree. diff --git a/setup.py b/setup.py index 168014ce..21269cdb 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,9 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. - # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# This source code is licensed under the license found in the -# LICENSE file in the root directory of this source tree. - from setuptools import find_packages, setup setup( diff --git a/test/test_job_config.py b/test/test_job_config.py index 6d8a54c7..d2ba0209 100644 --- a/test/test_job_config.py +++ b/test/test_job_config.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. import tempfile diff --git a/test/test_test.py b/test/test_test.py deleted file mode 100644 index ed48a6b9..00000000 --- a/test/test_test.py +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. - - -# delete me after adding real tests.. -class Test: - def test_test(self): - assert True diff --git a/test_runner.py b/test_runner.py index ebaa68ca..df1f818c 100755 --- a/test_runner.py +++ b/test_runner.py @@ -1,8 +1,9 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. - # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + import glob import os import shutil diff --git a/torchtitan/checkpoint.py b/torchtitan/checkpoint.py index 54fa4d71..b3902a71 100644 --- a/torchtitan/checkpoint.py +++ b/torchtitan/checkpoint.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. import enum import os diff --git a/torchtitan/config_manager.py b/torchtitan/config_manager.py index 4a3e61fc..44f6b58e 100644 --- a/torchtitan/config_manager.py +++ b/torchtitan/config_manager.py @@ -1,8 +1,9 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. - # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + import argparse import sys from collections import defaultdict diff --git a/torchtitan/datasets/__init__.py b/torchtitan/datasets/__init__.py index 2c26c98c..fd3b0250 100644 --- a/torchtitan/datasets/__init__.py +++ b/torchtitan/datasets/__init__.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. from torchtitan.datasets.hf_datasets import build_hf_data_loader from torchtitan.datasets.tokenizer import create_tokenizer diff --git a/torchtitan/datasets/download_tokenizer.py b/torchtitan/datasets/download_tokenizer.py index 599a8fc2..41db3c81 100644 --- a/torchtitan/datasets/download_tokenizer.py +++ b/torchtitan/datasets/download_tokenizer.py @@ -1,8 +1,8 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. - # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. import os from typing import Optional diff --git a/torchtitan/datasets/hf_datasets.py b/torchtitan/datasets/hf_datasets.py index c469150b..b05bcefb 100644 --- a/torchtitan/datasets/hf_datasets.py +++ b/torchtitan/datasets/hf_datasets.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. from typing import List, Optional diff --git a/torchtitan/datasets/tokenizer.py b/torchtitan/datasets/tokenizer.py index 7ebb42f9..9b3ef49f 100644 --- a/torchtitan/datasets/tokenizer.py +++ b/torchtitan/datasets/tokenizer.py @@ -1,5 +1,5 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. diff --git a/torchtitan/float8_linear.py b/torchtitan/float8_linear.py index abb69de5..a42fe4a1 100644 --- a/torchtitan/float8_linear.py +++ b/torchtitan/float8_linear.py @@ -1,8 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. - -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. from torchtitan.config_manager import JobConfig from torchtitan.logging_utils import logger diff --git a/torchtitan/logging_utils.py b/torchtitan/logging_utils.py index b1d33085..bc485a99 100644 --- a/torchtitan/logging_utils.py +++ b/torchtitan/logging_utils.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. import logging import os diff --git a/torchtitan/lr_scheduling.py b/torchtitan/lr_scheduling.py index ee59f78c..bfcd30a2 100644 --- a/torchtitan/lr_scheduling.py +++ b/torchtitan/lr_scheduling.py @@ -1,8 +1,8 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. - # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. from torch.optim.lr_scheduler import LambdaLR from torchtitan.config_manager import JobConfig diff --git a/torchtitan/metrics.py b/torchtitan/metrics.py index 7b70f524..90108976 100644 --- a/torchtitan/metrics.py +++ b/torchtitan/metrics.py @@ -1,8 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. - -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. import os from collections import namedtuple diff --git a/torchtitan/models/__init__.py b/torchtitan/models/__init__.py index 0b37252d..5d982729 100644 --- a/torchtitan/models/__init__.py +++ b/torchtitan/models/__init__.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. from torchtitan.models.llama import llama_configs, Transformer diff --git a/torchtitan/models/llama/__init__.py b/torchtitan/models/llama/__init__.py index f895cd47..e6e0122c 100644 --- a/torchtitan/models/llama/__init__.py +++ b/torchtitan/models/llama/__init__.py @@ -1,5 +1,11 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +# +# Llama 2 is licensed under the LLAMA 2 Community License, +# Copyright (c) Meta Platforms, Inc. All Rights Reserved. from torchtitan.models.llama.model import ModelArgs, Transformer diff --git a/torchtitan/models/llama/model.py b/torchtitan/models/llama/model.py index f140b0d7..368a3b50 100644 --- a/torchtitan/models/llama/model.py +++ b/torchtitan/models/llama/model.py @@ -1,5 +1,12 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +# +# Llama 2 is licensed under the LLAMA 2 Community License, +# Copyright (c) Meta Platforms, Inc. All Rights Reserved. + from dataclasses import dataclass from typing import Optional, Tuple diff --git a/torchtitan/models/norms.py b/torchtitan/models/norms.py index 59f13d86..e29338d9 100644 --- a/torchtitan/models/norms.py +++ b/torchtitan/models/norms.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. import math diff --git a/torchtitan/parallelisms/__init__.py b/torchtitan/parallelisms/__init__.py index 0e4c8037..3d11a68c 100644 --- a/torchtitan/parallelisms/__init__.py +++ b/torchtitan/parallelisms/__init__.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. from dataclasses import dataclass from functools import cached_property diff --git a/torchtitan/parallelisms/parallelize_llama.py b/torchtitan/parallelisms/parallelize_llama.py index 0fff32b6..644a6163 100644 --- a/torchtitan/parallelisms/parallelize_llama.py +++ b/torchtitan/parallelisms/parallelize_llama.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. # this file applies the PTD parallelisms and various training techniques to the # llama model, i.e. activation checkpointing, etc. diff --git a/torchtitan/profiling.py b/torchtitan/profiling.py index c32d98ec..490b9cf9 100644 --- a/torchtitan/profiling.py +++ b/torchtitan/profiling.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. import contextlib import os diff --git a/torchtitan/utils.py b/torchtitan/utils.py index 370ca990..689335c4 100644 --- a/torchtitan/utils.py +++ b/torchtitan/utils.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. import os from dataclasses import dataclass diff --git a/train.py b/train.py index 2a669fcf..00e43f33 100644 --- a/train.py +++ b/train.py @@ -1,5 +1,8 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. -# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. import contextlib import gc