From f5db522466276e80290ac10bbd49932d949278f6 Mon Sep 17 00:00:00 2001 From: Wanchao Liang Date: Mon, 15 Apr 2024 17:28:29 -0700 Subject: [PATCH 1/4] Update license --- LICENSE | 28 ++++++++++++++++++++++++++++ docs/license_header.txt | 5 ++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..bc559a98b --- /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 9e3028abd..dada37c71 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. From c802ce55ce5b6d90e5d33b11531d7c91ac36384d Mon Sep 17 00:00:00 2001 From: Wanchao Liang Date: Mon, 15 Apr 2024 20:03:10 -0700 Subject: [PATCH 2/4] Update license headers --- setup.py | 15 --------------- test/test_job_config.py | 3 --- test/test_test.py | 8 -------- test_runner.py | 5 ----- torchtitan/checkpoint.py | 3 --- torchtitan/config_manager.py | 5 ----- torchtitan/datasets/__init__.py | 3 --- torchtitan/datasets/download_tokenizer.py | 6 ------ torchtitan/datasets/hf_datasets.py | 3 --- torchtitan/datasets/tokenizer.py | 6 ------ torchtitan/float8_linear.py | 6 ------ torchtitan/logging_utils.py | 3 --- torchtitan/lr_scheduling.py | 6 ------ torchtitan/metrics.py | 6 ------ torchtitan/models/__init__.py | 3 --- torchtitan/models/llama/__init__.py | 3 --- torchtitan/models/llama/model.py | 3 --- torchtitan/models/norms.py | 3 --- torchtitan/parallelisms/__init__.py | 3 --- torchtitan/parallelisms/parallelize_llama.py | 3 --- torchtitan/profiling.py | 3 --- torchtitan/utils.py | 3 --- train.py | 3 --- 23 files changed, 105 deletions(-) delete mode 100644 test/test_test.py diff --git a/setup.py b/setup.py index 168014ce4..5649b00c5 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,3 @@ -# 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 6d8a54c73..89f101442 100644 --- a/test/test_job_config.py +++ b/test/test_job_config.py @@ -1,6 +1,3 @@ -# 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. - import tempfile import pytest diff --git a/test/test_test.py b/test/test_test.py deleted file mode 100644 index ed48a6b9f..000000000 --- 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 77fe600ba..14b6a77ab 100755 --- a/test_runner.py +++ b/test_runner.py @@ -1,8 +1,3 @@ -# 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. import os import subprocess from collections import defaultdict diff --git a/torchtitan/checkpoint.py b/torchtitan/checkpoint.py index 7846dce4b..ab0b8fe66 100644 --- a/torchtitan/checkpoint.py +++ b/torchtitan/checkpoint.py @@ -1,6 +1,3 @@ -# 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. - import enum import os import re diff --git a/torchtitan/config_manager.py b/torchtitan/config_manager.py index 90cadf49a..15ed49d29 100644 --- a/torchtitan/config_manager.py +++ b/torchtitan/config_manager.py @@ -1,8 +1,3 @@ -# 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. import argparse import sys from collections import defaultdict diff --git a/torchtitan/datasets/__init__.py b/torchtitan/datasets/__init__.py index b8331c3b6..d0bad34fb 100644 --- a/torchtitan/datasets/__init__.py +++ b/torchtitan/datasets/__init__.py @@ -1,6 +1,3 @@ -# 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. - 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 599a8fc2f..0c5b381e7 100644 --- a/torchtitan/datasets/download_tokenizer.py +++ b/torchtitan/datasets/download_tokenizer.py @@ -1,9 +1,3 @@ -# 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. - import os from typing import Optional diff --git a/torchtitan/datasets/hf_datasets.py b/torchtitan/datasets/hf_datasets.py index 4b05f40b7..cce160925 100644 --- a/torchtitan/datasets/hf_datasets.py +++ b/torchtitan/datasets/hf_datasets.py @@ -1,6 +1,3 @@ -# 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. - from typing import List, Optional import torch diff --git a/torchtitan/datasets/tokenizer.py b/torchtitan/datasets/tokenizer.py index 7ebb42f99..0003137df 100644 --- a/torchtitan/datasets/tokenizer.py +++ b/torchtitan/datasets/tokenizer.py @@ -1,9 +1,3 @@ -# 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. -# -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. - # copied and adjusted from https://github.com/facebookresearch/llama/blob/main/llama/tokenizer.py import os diff --git a/torchtitan/float8_linear.py b/torchtitan/float8_linear.py index abb69de5f..d935611a2 100644 --- a/torchtitan/float8_linear.py +++ b/torchtitan/float8_linear.py @@ -1,9 +1,3 @@ -# 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 - from torchtitan.config_manager import JobConfig from torchtitan.logging_utils import logger from torchtitan.models.llama import Transformer diff --git a/torchtitan/logging_utils.py b/torchtitan/logging_utils.py index b1d330851..a79a2b3ef 100644 --- a/torchtitan/logging_utils.py +++ b/torchtitan/logging_utils.py @@ -1,6 +1,3 @@ -# 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. - import logging import os diff --git a/torchtitan/lr_scheduling.py b/torchtitan/lr_scheduling.py index ee59f78cc..4460617d8 100644 --- a/torchtitan/lr_scheduling.py +++ b/torchtitan/lr_scheduling.py @@ -1,9 +1,3 @@ -# 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. - from torch.optim.lr_scheduler import LambdaLR from torchtitan.config_manager import JobConfig diff --git a/torchtitan/metrics.py b/torchtitan/metrics.py index 7b70f5248..10d3d5a09 100644 --- a/torchtitan/metrics.py +++ b/torchtitan/metrics.py @@ -1,9 +1,3 @@ -# 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 - import os from collections import namedtuple from datetime import datetime diff --git a/torchtitan/models/__init__.py b/torchtitan/models/__init__.py index 0b37252dc..1e152073a 100644 --- a/torchtitan/models/__init__.py +++ b/torchtitan/models/__init__.py @@ -1,6 +1,3 @@ -# 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. - from torchtitan.models.llama import llama_configs, Transformer models_config = { diff --git a/torchtitan/models/llama/__init__.py b/torchtitan/models/llama/__init__.py index f895cd470..6b9363072 100644 --- a/torchtitan/models/llama/__init__.py +++ b/torchtitan/models/llama/__init__.py @@ -1,6 +1,3 @@ -# 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. - from torchtitan.models.llama.model import ModelArgs, Transformer __all__ = ["Transformer"] diff --git a/torchtitan/models/llama/model.py b/torchtitan/models/llama/model.py index f140b0d70..ede1fac37 100644 --- a/torchtitan/models/llama/model.py +++ b/torchtitan/models/llama/model.py @@ -1,6 +1,3 @@ -# 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. - from dataclasses import dataclass from typing import Optional, Tuple diff --git a/torchtitan/models/norms.py b/torchtitan/models/norms.py index 59f13d866..4ad71aa98 100644 --- a/torchtitan/models/norms.py +++ b/torchtitan/models/norms.py @@ -1,6 +1,3 @@ -# 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. - import math import torch diff --git a/torchtitan/parallelisms/__init__.py b/torchtitan/parallelisms/__init__.py index 0e4c80375..023f6c163 100644 --- a/torchtitan/parallelisms/__init__.py +++ b/torchtitan/parallelisms/__init__.py @@ -1,6 +1,3 @@ -# 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. - from dataclasses import dataclass from functools import cached_property diff --git a/torchtitan/parallelisms/parallelize_llama.py b/torchtitan/parallelisms/parallelize_llama.py index 0fff32b63..1bd060e07 100644 --- a/torchtitan/parallelisms/parallelize_llama.py +++ b/torchtitan/parallelisms/parallelize_llama.py @@ -1,6 +1,3 @@ -# 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. - # 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 62cf77982..50007a9a7 100644 --- a/torchtitan/profiling.py +++ b/torchtitan/profiling.py @@ -1,6 +1,3 @@ -# 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. - import contextlib import os diff --git a/torchtitan/utils.py b/torchtitan/utils.py index 370ca990e..975547073 100644 --- a/torchtitan/utils.py +++ b/torchtitan/utils.py @@ -1,6 +1,3 @@ -# 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. - import os from dataclasses import dataclass from datetime import timedelta diff --git a/train.py b/train.py index d95c11739..c49a60456 100644 --- a/train.py +++ b/train.py @@ -1,6 +1,3 @@ -# 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. - import contextlib import gc import os From 8d8b96b1aedbfbb6ecdf4c24e84632d90cd55a88 Mon Sep 17 00:00:00 2001 From: Wanchao Liang Date: Mon, 15 Apr 2024 20:09:45 -0700 Subject: [PATCH 3/4] update with new headers --- setup.py | 6 ++++++ test/test_job_config.py | 6 ++++++ test_runner.py | 6 ++++++ torchtitan/checkpoint.py | 6 ++++++ torchtitan/config_manager.py | 6 ++++++ torchtitan/datasets/__init__.py | 6 ++++++ torchtitan/datasets/download_tokenizer.py | 6 ++++++ torchtitan/datasets/hf_datasets.py | 6 ++++++ torchtitan/datasets/tokenizer.py | 6 ++++++ torchtitan/float8_linear.py | 6 ++++++ torchtitan/logging_utils.py | 6 ++++++ torchtitan/lr_scheduling.py | 6 ++++++ torchtitan/metrics.py | 6 ++++++ torchtitan/models/__init__.py | 6 ++++++ torchtitan/models/llama/__init__.py | 6 ++++++ torchtitan/models/llama/model.py | 6 ++++++ torchtitan/models/norms.py | 6 ++++++ torchtitan/parallelisms/__init__.py | 6 ++++++ torchtitan/parallelisms/parallelize_llama.py | 6 ++++++ torchtitan/profiling.py | 6 ++++++ torchtitan/utils.py | 6 ++++++ train.py | 6 ++++++ 22 files changed, 132 insertions(+) diff --git a/setup.py b/setup.py index 5649b00c5..21269cdb2 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,9 @@ +# 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 setuptools import find_packages, setup setup( diff --git a/test/test_job_config.py b/test/test_job_config.py index 89f101442..d2ba02093 100644 --- a/test/test_job_config.py +++ b/test/test_job_config.py @@ -1,3 +1,9 @@ +# 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 tempfile import pytest diff --git a/test_runner.py b/test_runner.py index 6e6f7fe01..df1f818c9 100755 --- a/test_runner.py +++ b/test_runner.py @@ -1,3 +1,9 @@ +# 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 6b624cba6..b3902a71f 100644 --- a/torchtitan/checkpoint.py +++ b/torchtitan/checkpoint.py @@ -1,3 +1,9 @@ +# 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 enum import os import re diff --git a/torchtitan/config_manager.py b/torchtitan/config_manager.py index a171d08f4..44f6b58e6 100644 --- a/torchtitan/config_manager.py +++ b/torchtitan/config_manager.py @@ -1,3 +1,9 @@ +# 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 56db3238a..fd3b0250b 100644 --- a/torchtitan/datasets/__init__.py +++ b/torchtitan/datasets/__init__.py @@ -1,3 +1,9 @@ +# 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 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 0c5b381e7..41db3c819 100644 --- a/torchtitan/datasets/download_tokenizer.py +++ b/torchtitan/datasets/download_tokenizer.py @@ -1,3 +1,9 @@ +# 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 f18e62a96..b05bcefb7 100644 --- a/torchtitan/datasets/hf_datasets.py +++ b/torchtitan/datasets/hf_datasets.py @@ -1,3 +1,9 @@ +# 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 typing import List, Optional import torch diff --git a/torchtitan/datasets/tokenizer.py b/torchtitan/datasets/tokenizer.py index 0003137df..9b3ef49f3 100644 --- a/torchtitan/datasets/tokenizer.py +++ b/torchtitan/datasets/tokenizer.py @@ -1,3 +1,9 @@ +# 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. + # copied and adjusted from https://github.com/facebookresearch/llama/blob/main/llama/tokenizer.py import os diff --git a/torchtitan/float8_linear.py b/torchtitan/float8_linear.py index d935611a2..a42fe4a11 100644 --- a/torchtitan/float8_linear.py +++ b/torchtitan/float8_linear.py @@ -1,3 +1,9 @@ +# 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 torchtitan.config_manager import JobConfig from torchtitan.logging_utils import logger from torchtitan.models.llama import Transformer diff --git a/torchtitan/logging_utils.py b/torchtitan/logging_utils.py index a79a2b3ef..bc485a996 100644 --- a/torchtitan/logging_utils.py +++ b/torchtitan/logging_utils.py @@ -1,3 +1,9 @@ +# 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 logging import os diff --git a/torchtitan/lr_scheduling.py b/torchtitan/lr_scheduling.py index 4460617d8..bfcd30a26 100644 --- a/torchtitan/lr_scheduling.py +++ b/torchtitan/lr_scheduling.py @@ -1,3 +1,9 @@ +# 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 10d3d5a09..90108976b 100644 --- a/torchtitan/metrics.py +++ b/torchtitan/metrics.py @@ -1,3 +1,9 @@ +# 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 collections import namedtuple from datetime import datetime diff --git a/torchtitan/models/__init__.py b/torchtitan/models/__init__.py index 1e152073a..5d9827296 100644 --- a/torchtitan/models/__init__.py +++ b/torchtitan/models/__init__.py @@ -1,3 +1,9 @@ +# 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 torchtitan.models.llama import llama_configs, Transformer models_config = { diff --git a/torchtitan/models/llama/__init__.py b/torchtitan/models/llama/__init__.py index 6b9363072..9593ae2be 100644 --- a/torchtitan/models/llama/__init__.py +++ b/torchtitan/models/llama/__init__.py @@ -1,3 +1,9 @@ +# 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 torchtitan.models.llama.model import ModelArgs, Transformer __all__ = ["Transformer"] diff --git a/torchtitan/models/llama/model.py b/torchtitan/models/llama/model.py index ede1fac37..d247f6313 100644 --- a/torchtitan/models/llama/model.py +++ b/torchtitan/models/llama/model.py @@ -1,3 +1,9 @@ +# 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 dataclasses import dataclass from typing import Optional, Tuple diff --git a/torchtitan/models/norms.py b/torchtitan/models/norms.py index 4ad71aa98..e29338d94 100644 --- a/torchtitan/models/norms.py +++ b/torchtitan/models/norms.py @@ -1,3 +1,9 @@ +# 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 math import torch diff --git a/torchtitan/parallelisms/__init__.py b/torchtitan/parallelisms/__init__.py index 023f6c163..3d11a68cb 100644 --- a/torchtitan/parallelisms/__init__.py +++ b/torchtitan/parallelisms/__init__.py @@ -1,3 +1,9 @@ +# 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 dataclasses import dataclass from functools import cached_property diff --git a/torchtitan/parallelisms/parallelize_llama.py b/torchtitan/parallelisms/parallelize_llama.py index 1bd060e07..644a6163a 100644 --- a/torchtitan/parallelisms/parallelize_llama.py +++ b/torchtitan/parallelisms/parallelize_llama.py @@ -1,3 +1,9 @@ +# 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. + # 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 fd5b12f05..490b9cf91 100644 --- a/torchtitan/profiling.py +++ b/torchtitan/profiling.py @@ -1,3 +1,9 @@ +# 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 contextlib import os diff --git a/torchtitan/utils.py b/torchtitan/utils.py index 975547073..689335c4e 100644 --- a/torchtitan/utils.py +++ b/torchtitan/utils.py @@ -1,3 +1,9 @@ +# 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 dataclasses import dataclass from datetime import timedelta diff --git a/train.py b/train.py index 034833c2a..00e43f336 100644 --- a/train.py +++ b/train.py @@ -1,3 +1,9 @@ +# 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 contextlib import gc import os From 9fba817a4e4a9746b41d5358faca29b86e7402fe Mon Sep 17 00:00:00 2001 From: Wanchao Liang Date: Mon, 15 Apr 2024 20:14:40 -0700 Subject: [PATCH 4/4] preserve llama2 licenses --- torchtitan/models/llama/__init__.py | 3 +++ torchtitan/models/llama/model.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/torchtitan/models/llama/__init__.py b/torchtitan/models/llama/__init__.py index 9593ae2be..e6e0122c5 100644 --- a/torchtitan/models/llama/__init__.py +++ b/torchtitan/models/llama/__init__.py @@ -3,6 +3,9 @@ # # 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 d247f6313..368a3b504 100644 --- a/torchtitan/models/llama/model.py +++ b/torchtitan/models/llama/model.py @@ -3,6 +3,10 @@ # # 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