diff --git a/android/Torchchat/app/proguard-rules.pro b/android/Torchchat/app/proguard-rules.pro index 481bb43481..f1b424510d 100644 --- a/android/Torchchat/app/proguard-rules.pro +++ b/android/Torchchat/app/proguard-rules.pro @@ -18,4 +18,4 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile diff --git a/android/Torchchat/app/src/androidTest/java/org/pytorch/torchchat/LlamaModuleTest.java b/android/Torchchat/app/src/androidTest/java/org/pytorch/torchchat/LlamaModuleTest.java index a538d979f9..e3b4e5019c 100644 --- a/android/Torchchat/app/src/androidTest/java/org/pytorch/torchchat/LlamaModuleTest.java +++ b/android/Torchchat/app/src/androidTest/java/org/pytorch/torchchat/LlamaModuleTest.java @@ -1,3 +1,10 @@ +/* + * 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. + */ package org.pytorch.torchchat; import androidx.test.ext.junit.runners.AndroidJUnit4; diff --git a/android/Torchchat/app/src/main/AndroidManifest.xml b/android/Torchchat/app/src/main/AndroidManifest.xml index 1fdf01745f..4bf09633d6 100644 --- a/android/Torchchat/app/src/main/AndroidManifest.xml +++ b/android/Torchchat/app/src/main/AndroidManifest.xml @@ -1,3 +1,10 @@ + diff --git a/android/Torchchat/app/src/test/java/org/pytorch/torchchat/ExampleUnitTest.java b/android/Torchchat/app/src/test/java/org/pytorch/torchchat/ExampleUnitTest.java index 2c2fbc93e2..8fbffcf351 100644 --- a/android/Torchchat/app/src/test/java/org/pytorch/torchchat/ExampleUnitTest.java +++ b/android/Torchchat/app/src/test/java/org/pytorch/torchchat/ExampleUnitTest.java @@ -1,3 +1,11 @@ +/* + * 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. + */ + package org.pytorch.torchchat; import org.junit.Test; diff --git a/android/Torchchat/gradle.properties b/android/Torchchat/gradle.properties index a03b354896..9440e7d54d 100644 --- a/android/Torchchat/gradle.properties +++ b/android/Torchchat/gradle.properties @@ -1,3 +1,9 @@ +# 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. + # Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* diff --git a/android/Torchchat/gradle/wrapper/gradle-wrapper.properties b/android/Torchchat/gradle/wrapper/gradle-wrapper.properties index a1a5bfcb36..5ac70c8c50 100644 --- a/android/Torchchat/gradle/wrapper/gradle-wrapper.properties +++ b/android/Torchchat/gradle/wrapper/gradle-wrapper.properties @@ -1,3 +1,9 @@ +# 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. + #Thu Apr 25 21:54:24 PDT 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists diff --git a/browser/browser.py b/browser/browser.py index 613146d8b3..5c3fca797e 100644 --- a/browser/browser.py +++ b/browser/browser.py @@ -1,3 +1,9 @@ +# 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. + import subprocess import sys diff --git a/build/model_aoti.py b/build/model_aoti.py index b7c1bda56e..10560d957d 100644 --- a/build/model_aoti.py +++ b/build/model_aoti.py @@ -1,3 +1,9 @@ +# 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. + import torch import torch.nn as nn from torch._inductor.codecache import AsyncCompile diff --git a/build/model_et.py b/build/model_et.py index 747a7ca318..cae755fbc6 100644 --- a/build/model_et.py +++ b/build/model_et.py @@ -1,3 +1,9 @@ +# 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. + import torch import torch.nn as nn from executorch.extension.pybindings import portable_lib as exec_lib diff --git a/export_et_util.py b/export_et_util.py index a9c743a77e..074f4b9052 100644 --- a/export_et_util.py +++ b/export_et_util.py @@ -1,3 +1,9 @@ +# 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. + import torch from build.model import apply_rotary_emb, Attention diff --git a/quantization/qops.py b/quantization/qops.py index c36a464ee5..281ac3e99e 100644 --- a/quantization/qops.py +++ b/quantization/qops.py @@ -1,3 +1,9 @@ +# 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 typing import Optional import torch diff --git a/runner/aoti.cmake b/runner/aoti.cmake index 2ae9a4079e..156e9bcce8 100644 --- a/runner/aoti.cmake +++ b/runner/aoti.cmake @@ -1,3 +1,10 @@ +#!/bin/bash +# 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. + cmake_minimum_required(VERSION 3.24) set(CMAKE_CXX_STANDARD 17) IF(DEFINED ENV{TORCHCHAT_ROOT}) diff --git a/runner/et.cmake b/runner/et.cmake index 6b233ae9c9..7fc16b1f20 100644 --- a/runner/et.cmake +++ b/runner/et.cmake @@ -1,3 +1,10 @@ +#!/bin/bash +# 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. + cmake_minimum_required(VERSION 3.24) set(CMAKE_CXX_STANDARD 17) diff --git a/runner/run.cpp b/runner/run.cpp index 2ee57c8acf..ac2186ac86 100644 --- a/runner/run.cpp +++ b/runner/run.cpp @@ -1,3 +1,11 @@ +/* +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. +*/ + /* Inference for Llama-2 Transformer model in pure C++ */ #include #include diff --git a/scripts/patch_triton.py b/scripts/patch_triton.py index 7213ed30ca..06f04e9601 100644 --- a/scripts/patch_triton.py +++ b/scripts/patch_triton.py @@ -1,3 +1,9 @@ +# 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. + #!/usr/bin/env python3 # Delete me after triton is updated past https://github.com/triton-lang/triton/pull/3564 diff --git a/scripts/prepare.sh b/scripts/prepare.sh index c3a74e6eb4..b3bec8f143 100755 --- a/scripts/prepare.sh +++ b/scripts/prepare.sh @@ -1 +1,7 @@ -python3 scripts/download.py --repo-id $1 && python3 scripts/convert_hf_checkpoint.py --checkpoint-dir checkpoints/$1 +# 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. + +python3 scripts/download.py --repo-id $1 && python3 scripts/convert_hf_checkpoint.py --checkpoint-dir checkpoints/$1 diff --git a/scripts/test_flow.sh b/scripts/test_flow.sh index 9cc25b1868..1813612cd7 100755 --- a/scripts/test_flow.sh +++ b/scripts/test_flow.sh @@ -1,3 +1,9 @@ +# 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. + export MODEL_REPO=meta-llama/Llama-2-7b-chat-hf rm -r checkpoints/$MODEL_REPO python3 scripts/download.py --repo-id $MODEL_REPO diff --git a/scripts/updown.py b/scripts/updown.py index fc0478d472..94cf52cc60 100644 --- a/scripts/updown.py +++ b/scripts/updown.py @@ -1,3 +1,10 @@ +# 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. + + import argparse import os import re diff --git a/utils/measure_time.py b/utils/measure_time.py index 874061e46f..89ec2d0915 100644 --- a/utils/measure_time.py +++ b/utils/measure_time.py @@ -1,3 +1,9 @@ +# 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 time import perf_counter from typing import Optional