From 049a75775867d94b286c848def16b5c0b7d2a481 Mon Sep 17 00:00:00 2001 From: Masahiro Masuda Date: Fri, 28 Jul 2023 09:04:19 +0900 Subject: [PATCH 1/3] add flash attn submodule --- .gitmodules | 3 +++ 3rdparty/libflash_attn | 1 + python/setup.py | 6 ++++++ 3 files changed, 10 insertions(+) create mode 160000 3rdparty/libflash_attn diff --git a/.gitmodules b/.gitmodules index ba725af1588a..b9526991c258 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "3rdparty/cutlass_fpA_intB_gemm"] path = 3rdparty/cutlass_fpA_intB_gemm url = https://github.com/tlc-pack/cutlass_fpA_intB_gemm +[submodule "3rdparty/libflash_attn"] + path = 3rdparty/libflash_attn + url = https://github.com/tlc-pack/libflash_attn diff --git a/3rdparty/libflash_attn b/3rdparty/libflash_attn new file mode 160000 index 000000000000..58b343e57571 --- /dev/null +++ b/3rdparty/libflash_attn @@ -0,0 +1 @@ +Subproject commit 58b343e57571fe5e0a5b43b5eb721acef8b35dff diff --git a/python/setup.py b/python/setup.py index 0f1d0b44363a..736aeab78fb7 100644 --- a/python/setup.py +++ b/python/setup.py @@ -103,6 +103,12 @@ def get_lib_path(): candidate_path, "cutlass_fpA_intB_gemm", "cutlass", "media" ) ) + _remove_path( + os.path.join(candidate_path, "libflash_attn", "cutlass", "docs") + ) + _remove_path( + os.path.join(candidate_path, "libflash_attn", "cutlass", "media") + ) break else: libs = None From 7e731ed30969cee43d1cb0f141f179fef28e6f98 Mon Sep 17 00:00:00 2001 From: Masahiro Masuda Date: Fri, 28 Jul 2023 10:15:38 +0900 Subject: [PATCH 2/3] update license --- LICENSE | 3 ++- licenses/LICENSE.libflash_attn.txt | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 licenses/LICENSE.libflash_attn.txt diff --git a/LICENSE b/LICENSE index 93bcbc63497e..f324a0311b91 100644 --- a/LICENSE +++ b/LICENSE @@ -214,7 +214,7 @@ Apache Software Foundation License 2.0 3rdparty/OpenCL-Headers 3rdparty/mlperftiny 3rdparty/nvbench (with LLVM exception) - +3rdparty/cutlass_fpA_intB_gemm BSD 2-clause License -------------------- @@ -247,3 +247,4 @@ BSD 3-Clause "New" or "Revised" License 3rdparty/cutlass 3rdparty/libbacktrace +3rdparty/libflash_attn \ No newline at end of file diff --git a/licenses/LICENSE.libflash_attn.txt b/licenses/LICENSE.libflash_attn.txt new file mode 100644 index 000000000000..5860e4b33f3d --- /dev/null +++ b/licenses/LICENSE.libflash_attn.txt @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2022, the respective contributors, as shown by the AUTHORS file. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* 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. + +* 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. From c651aa6a4a621cbbe0ef1a7bea20aca9d2d266e3 Mon Sep 17 00:00:00 2001 From: Masahiro Masuda Date: Fri, 28 Jul 2023 11:38:09 +0900 Subject: [PATCH 3/3] whitespace lint --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index f324a0311b91..1d26fab957c8 100644 --- a/LICENSE +++ b/LICENSE @@ -247,4 +247,4 @@ BSD 3-Clause "New" or "Revised" License 3rdparty/cutlass 3rdparty/libbacktrace -3rdparty/libflash_attn \ No newline at end of file +3rdparty/libflash_attn