diff --git a/recipes/flash-attn/LICENSE_CUTLASS.txt b/recipes/flash-attn/LICENSE_CUTLASS.txt deleted file mode 100644 index 525500841ed2f..0000000000000 --- a/recipes/flash-attn/LICENSE_CUTLASS.txt +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2017 - 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -SPDX-License-Identifier: BSD-3-Clause - -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/recipes/flash-attn/conda-forge.yml b/recipes/flash-attn/conda-forge.yml deleted file mode 100644 index 1195b8d42e899..0000000000000 --- a/recipes/flash-attn/conda-forge.yml +++ /dev/null @@ -1,2 +0,0 @@ -azure: - timeout_minutes: 360 diff --git a/recipes/flash-attn/meta.yaml b/recipes/flash-attn/meta.yaml deleted file mode 100644 index 608128b1517d9..0000000000000 --- a/recipes/flash-attn/meta.yaml +++ /dev/null @@ -1,78 +0,0 @@ -{% set name = "flash-attn" %} -{% set version = "2.5.8" %} - -package: - name: {{ name|lower }} - version: {{ version }} - -source: - - url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/flash_attn-{{ version }}.tar.gz - sha256: 2e5b2bcff6d5cff40d494af91ecd1eb3c5b4520a6ce7a0a8b1f9c1ed129fb402 - # Overwrite with a simpler build script that doesn't try to revend pre-compiled binaries - - path: pyproject.toml - - path: setup.py - -build: - number: 0 - script: {{ PYTHON }} -m pip install . -vvv --no-deps --no-build-isolation - script_env: - # Temporarily reduce ARCHs and JOBS to debug build - # - MAX_JOBS=$CPU_COUNT - - MAX_JOBS=1 - # - TORCH_CUDA_ARCH_LIST=8.0;8.6;8.9;9.0+PTX - - TORCH_CUDA_ARCH_LIST=8.0+PTX - skip: true # [cuda_compiler_version in (undefined, "None")] - skip: true # [not linux] - ignore_run_exports_from: - - libcublas-dev # [(cuda_compiler_version or "").startswith("12")] - - libcusolver-dev # [(cuda_compiler_version or "").startswith("12")] - - libcusparse-dev # [(cuda_compiler_version or "").startswith("12")] - rpaths: - - lib/ - # PyTorch libs are in site-packages instead of with other shared objects - - {{ SP_DIR }}/torch/lib/ - -requirements: - build: - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - {{ compiler('cuda') }} - - {{ stdlib('c') }} - - ninja - host: - - cuda-version {{ cuda_compiler_version }} # same cuda for host and build - - cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")] - - libcublas-dev # [(cuda_compiler_version or "").startswith("12")] - - libcusolver-dev # [(cuda_compiler_version or "").startswith("12")] - - libcusparse-dev # [(cuda_compiler_version or "").startswith("12")] - - libtorch # required until pytorch run_exports libtorch - - pip - - python - - pytorch - - pytorch =*=cuda* - - setuptools - run: - - einops - - python - - pytorch =*=cuda* - -test: - imports: - - flash_attn - commands: - - pip check - requires: - - pip - -about: - home: https://github.com/Dao-AILab/flash-attention - summary: 'Flash Attention: Fast and Memory-Efficient Exact Attention' - license: BSD-3-Clause - license_file: - - LICENSE - - LICENSE_CUTLASS.txt - -extra: - recipe-maintainers: - - carterbox - - weiji14 diff --git a/recipes/flash-attn/pyproject.toml b/recipes/flash-attn/pyproject.toml deleted file mode 100644 index 30cd0e5ec6fb7..0000000000000 --- a/recipes/flash-attn/pyproject.toml +++ /dev/null @@ -1,28 +0,0 @@ -[build-system] -requires = ["setuptools>=62", "torch", "ninja"] -build-backend = "setuptools.build_meta" - -[project] -dynamic = ["version"] -name = "flash_attn" -authors = [ - {name = "Tri Dao", email = "trid@cs.stanford.edu"}, -] -description="Flash Attention: Fast and Memory-Efficient Exact Attention" -classifiers = [ - "Programming Language :: Python :: 3", - "Operating System :: Unix", - "License :: OSI Approved :: BSD License", -] -readme = "README.md" -license = {file = "LICENSE"} -dependencies = [ - "torch", - "einops", -] - -[project.urls] -Homepage = "https://github.com/Dao-AILab/flash-attention" - -[tool.setuptools.dynamic] -version = {attr = "flash_attn.__version__"} diff --git a/recipes/flash-attn/setup.py b/recipes/flash-attn/setup.py deleted file mode 100644 index dd6b95f5d2376..0000000000000 --- a/recipes/flash-attn/setup.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (c) 2023, Tri Dao. -# Copyright (c) 2024, Conda-forge Contributors. - -"""Since this package is a pytorch extension, this setup file uses the custom -CUDAExtension build system from pytorch. This ensures that compatible compiler -args, headers, etc for pytorch. - -Read more at the pytorch docs: -https://pytorch.org/docs/stable/cpp_extension.html#torch.utils.cpp_extension.CUDAExtension -""" - -import pathlib - -from setuptools import setup, find_packages -from torch.utils.cpp_extension import BuildExtension, CUDAExtension - -_this_dir = pathlib.Path(__file__).parent.absolute() - -setup( - packages=find_packages( - include=["flash_attn*"], - ), - ext_modules=[ - CUDAExtension( - name="flash_attn_2_cuda", - sources=[ - "csrc/flash_attn/flash_api.cpp", - "csrc/flash_attn/src/flash_fwd_hdim32_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim32_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim64_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim64_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim96_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim96_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim128_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim128_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim160_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim160_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim192_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim192_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim224_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim224_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim256_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_hdim256_bf16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim32_fp16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim32_bf16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim64_fp16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim64_bf16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim96_fp16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim96_bf16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim128_fp16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim128_bf16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim160_fp16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim160_bf16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim192_fp16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim192_bf16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim224_fp16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim224_bf16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim256_fp16_sm80.cu", - "csrc/flash_attn/src/flash_bwd_hdim256_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim32_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim32_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim64_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim64_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim96_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim96_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim128_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim128_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim160_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim160_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim192_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim192_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim224_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim224_bf16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim256_fp16_sm80.cu", - "csrc/flash_attn/src/flash_fwd_split_hdim256_bf16_sm80.cu", - ], - extra_compile_args={ - "cxx": [ - "-std=c++17", - ], - "nvcc": [ - "-std=c++17", - "-U__CUDA_NO_HALF_OPERATORS__", - "-U__CUDA_NO_HALF_CONVERSIONS__", - "-U__CUDA_NO_HALF2_OPERATORS__", - "-U__CUDA_NO_BFLOAT16_CONVERSIONS__", - "--expt-relaxed-constexpr", - "--expt-extended-lambda", - "--use_fast_math", - # "--ptxas-options=-v", - # "--ptxas-options=-O2", - # "-lineinfo", - # "-DFLASHATTENTION_DISABLE_BACKWARD", - # "-DFLASHATTENTION_DISABLE_DROPOUT", - # "-DFLASHATTENTION_DISABLE_ALIBI", - # "-DFLASHATTENTION_DISABLE_UNEVEN_K", - # "-DFLASHATTENTION_DISABLE_LOCAL", - ], - }, - include_dirs=[ - _this_dir / "csrc" / "flash_attn", - _this_dir / "csrc" / "flash_attn" / "src", - _this_dir / "csrc" / "cutlass" / "include", - ], - ), - ], - cmdclass={"build_ext": BuildExtension}, - zip_safe=False, -)