From 3547c147341896ff0f5b9e68a862948c47160e22 Mon Sep 17 00:00:00 2001 From: Jesse Date: Tue, 16 Jul 2024 09:19:11 -0700 Subject: [PATCH 1/3] need license header on every file --- export_et_util.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/export_et_util.py b/export_et_util.py index a9c743a77..074f4b905 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 From aae572723df215af7931722922cf2cb779c4379a Mon Sep 17 00:00:00 2001 From: Jesse Date: Tue, 16 Jul 2024 10:28:43 -0700 Subject: [PATCH 2/3] apparently the validator only reports the first violation it finds not all of them --- android/Torchchat/app/build.gradle.kts | 6 ++++++ android/Torchchat/app/proguard-rules.pro | 9 ++++++++- android/Torchchat/build.gradle.kts | 6 ++++++ android/Torchchat/gradle.properties | 6 ++++++ .../Torchchat/gradle/wrapper/gradle-wrapper.properties | 6 ++++++ build/model_aoti.py | 6 ++++++ build/model_et.py | 6 ++++++ quantization/qops.py | 6 ++++++ runner/run.cpp | 8 ++++++++ scripts/patch_triton.py | 6 ++++++ scripts/updown.py | 7 +++++++ tokenizer/sentencepiece.cpp | 2 +- unsupported/llama2.c/runner-aoti/run.cpp | 8 ++++++++ unsupported/llama2.c/runner/run.cpp | 7 +++++++ 14 files changed, 87 insertions(+), 2 deletions(-) diff --git a/android/Torchchat/app/build.gradle.kts b/android/Torchchat/app/build.gradle.kts index 1001c9f81..a27f563a5 100644 --- a/android/Torchchat/app/build.gradle.kts +++ b/android/Torchchat/app/build.gradle.kts @@ -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. + plugins { id("com.android.application") } diff --git a/android/Torchchat/app/proguard-rules.pro b/android/Torchchat/app/proguard-rules.pro index 481bb4348..8a7c18826 100644 --- a/android/Torchchat/app/proguard-rules.pro +++ b/android/Torchchat/app/proguard-rules.pro @@ -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. + + # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the # proguardFiles setting in build.gradle. @@ -18,4 +25,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/build.gradle.kts b/android/Torchchat/build.gradle.kts index cc9db8a5c..9349f97ae 100644 --- a/android/Torchchat/build.gradle.kts +++ b/android/Torchchat/build.gradle.kts @@ -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. + // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id("com.android.application") version "8.1.0" apply false diff --git a/android/Torchchat/gradle.properties b/android/Torchchat/gradle.properties index a03b35489..9440e7d54 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 a1a5bfcb3..5ac70c8c5 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/build/model_aoti.py b/build/model_aoti.py index b7c1bda56..10560d957 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 747a7ca31..cae755fbc 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/quantization/qops.py b/quantization/qops.py index c36a464ee..281ac3e99 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/run.cpp b/runner/run.cpp index 2ee57c8ac..ac2186ac8 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 7213ed30c..06f04e960 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/updown.py b/scripts/updown.py index fc0478d47..94cf52cc6 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/tokenizer/sentencepiece.cpp b/tokenizer/sentencepiece.cpp index 99c99f05f..6e830e455 100644 --- a/tokenizer/sentencepiece.cpp +++ b/tokenizer/sentencepiece.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * diff --git a/unsupported/llama2.c/runner-aoti/run.cpp b/unsupported/llama2.c/runner-aoti/run.cpp index 56d623a06..47b909a5e 100644 --- a/unsupported/llama2.c/runner-aoti/run.cpp +++ b/unsupported/llama2.c/runner-aoti/run.cpp @@ -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. +*/ + /* Inference for Llama-2 Transformer model in pure C */ /* this uses the same logic regardless of AOTI OR ET */ /* but requires different data types - ATen vs ETen */ diff --git a/unsupported/llama2.c/runner/run.cpp b/unsupported/llama2.c/runner/run.cpp index 5ac8405a6..44fcbd1ac 100644 --- a/unsupported/llama2.c/runner/run.cpp +++ b/unsupported/llama2.c/runner/run.cpp @@ -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. +*/ + /* Inference for Llama-2 Transformer model in pure C */ #include From 8faaf00e751b74a54bca6f3f10ce68d8c3dbb98b Mon Sep 17 00:00:00 2001 From: Jesse Date: Tue, 16 Jul 2024 10:34:59 -0700 Subject: [PATCH 3/3] typeo --- tokenizer/sentencepiece.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokenizer/sentencepiece.cpp b/tokenizer/sentencepiece.cpp index 6e830e455..99c99f05f 100644 --- a/tokenizer/sentencepiece.cpp +++ b/tokenizer/sentencepiece.cpp @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. *