From 253211cf194c663c53bd36dccd567fc241304552 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Thu, 17 Oct 2024 16:20:46 -0700 Subject: [PATCH 01/31] Add two flash-attn extensions as multi-outputs --- recipe/meta.yaml | 54 +++++++++++++++++---- recipe/setup.py | 119 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 156 insertions(+), 17 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 461ef3b..0c1136b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,7 @@ {% set name = "flash-attn" %} {% set version = "2.6.3" %} +{% set fused_dense_lib_name = "flash-attn-fused-dense-lib" %} +{% set layer_norm_name = "flash-attn-layer-norm" %} package: name: {{ name|lower }} @@ -13,11 +15,10 @@ source: - path: setup.py build: - number: 1 - script: {{ PYTHON }} -m pip install . -vvv --no-deps --no-build-isolation + number: 2 script_env: # Limit MAX_JOBS in order to prevent runners from crashing - - MAX_JOBS=4 + - MAX_JOBS=20 - TORCH_CUDA_ARCH_LIST=8.0;8.6;8.9;9.0+PTX skip: true # [cuda_compiler_version in (undefined, "None")] skip: true # [not linux] @@ -54,13 +55,46 @@ requirements: - python - pytorch =*=cuda* -test: - imports: - - flash_attn - commands: - - pip check - requires: - - pip +outputs: + - name: {{ name|lower }} + build: + script: python -m pip install . -vvv --no-deps --no-build-isolation + + test: + imports: + - flash_attn + commands: + - pip check + requires: + - pip + + - name: {{ fused_dense_lib_name|lower }} + build: + script: python -m pip install . -vvv --no-deps --no-build-isolation + script_env: + - BUILD_FLASH_ATTN_COMPONENT=fused_dense_lib + + test: + imports: + - fused_dense_lib + commands: + - pip check + requires: + - pip + + - name: {{ layer_norm_name|lower }} + build: + script: python -m pip install . -vvv --no-deps --no-build-isolation + script_env: + - BUILD_FLASH_ATTN_COMPONENT=layer_norm + + test: + imports: + - dropout_layer_norm + commands: + - pip check + requires: + - pip about: home: https://github.com/Dao-AILab/flash-attention diff --git a/recipe/setup.py b/recipe/setup.py index b152e80..2d49ba8 100644 --- a/recipe/setup.py +++ b/recipe/setup.py @@ -8,7 +8,7 @@ Read more at the pytorch docs: https://pytorch.org/docs/stable/cpp_extension.html#torch.utils.cpp_extension.CUDAExtension """ - +import os import pathlib from setuptools import setup, find_packages @@ -16,11 +16,11 @@ _this_dir = pathlib.Path(__file__).parent.absolute() -setup( - packages=find_packages( - include=["flash_attn*"], - ), - ext_modules=[ +# Check environment variable to determine which component to build +build_target = os.environ.get("BUILD_FLASH_ATTN_COMPONENT", "core") + +if build_target == "core": + ext_modules = [ CUDAExtension( name="flash_attn_2_cuda", sources=[ @@ -138,7 +138,112 @@ _this_dir / "csrc" / "cutlass" / "include", ], ), - ], + ] +elif build_target == "fused_dense_lib": + ext_modules = [ + CUDAExtension( + name="fused_dense_lib", + sources=[ + "csrc/fused_dense_lib/fused_dense.cpp", + "csrc/fused_dense_lib/fused_dense_cuda.cu", + ], + extra_compile_args={ + 'cxx': ['-O3', ], + 'nvcc': ['-O3'], + }, + ), + ] +elif build_target == "layer_norm": + ext_modules = [ + CUDAExtension( + name="dropout_layer_norm", + sources=[ + "cscr/layer_norm/ln_api.cpp", + "cscr/layer_norm/ln_fwd_256.cu", + "cscr/layer_norm/ln_bwd_256.cu", + "cscr/layer_norm/ln_fwd_512.cu", + "cscr/layer_norm/ln_bwd_512.cu", + "cscr/layer_norm/ln_fwd_768.cu", + "cscr/layer_norm/ln_bwd_768.cu", + "cscr/layer_norm/ln_fwd_1024.cu", + "cscr/layer_norm/ln_bwd_1024.cu", + "cscr/layer_norm/ln_fwd_1280.cu", + "cscr/layer_norm/ln_bwd_1280.cu", + "cscr/layer_norm/ln_fwd_1536.cu", + "cscr/layer_norm/ln_bwd_1536.cu", + "cscr/layer_norm/ln_fwd_2048.cu", + "cscr/layer_norm/ln_bwd_2048.cu", + "cscr/layer_norm/ln_fwd_2560.cu", + "cscr/layer_norm/ln_bwd_2560.cu", + "cscr/layer_norm/ln_fwd_3072.cu", + "cscr/layer_norm/ln_bwd_3072.cu", + "cscr/layer_norm/ln_fwd_4096.cu", + "cscr/layer_norm/ln_bwd_4096.cu", + "cscr/layer_norm/ln_fwd_5120.cu", + "cscr/layer_norm/ln_bwd_5120.cu", + "cscr/layer_norm/ln_fwd_6144.cu", + "cscr/layer_norm/ln_bwd_6144.cu", + "cscr/layer_norm/ln_fwd_7168.cu", + "cscr/layer_norm/ln_bwd_7168.cu", + "cscr/layer_norm/ln_fwd_8192.cu", + "cscr/layer_norm/ln_bwd_8192.cu", + "cscr/layer_norm/ln_parallel_fwd_256.cu", + "cscr/layer_norm/ln_parallel_bwd_256.cu", + "cscr/layer_norm/ln_parallel_fwd_512.cu", + "cscr/layer_norm/ln_parallel_bwd_512.cu", + "cscr/layer_norm/ln_parallel_fwd_768.cu", + "cscr/layer_norm/ln_parallel_bwd_768.cu", + "cscr/layer_norm/ln_parallel_fwd_1024.cu", + "cscr/layer_norm/ln_parallel_bwd_1024.cu", + "cscr/layer_norm/ln_parallel_fwd_1280.cu", + "cscr/layer_norm/ln_parallel_bwd_1280.cu", + "cscr/layer_norm/ln_parallel_fwd_1536.cu", + "cscr/layer_norm/ln_parallel_bwd_1536.cu", + "cscr/layer_norm/ln_parallel_fwd_2048.cu", + "cscr/layer_norm/ln_parallel_bwd_2048.cu", + "cscr/layer_norm/ln_parallel_fwd_2560.cu", + "cscr/layer_norm/ln_parallel_bwd_2560.cu", + "cscr/layer_norm/ln_parallel_fwd_3072.cu", + "cscr/layer_norm/ln_parallel_bwd_3072.cu", + "cscr/layer_norm/ln_parallel_fwd_4096.cu", + "cscr/layer_norm/ln_parallel_bwd_4096.cu", + "cscr/layer_norm/ln_parallel_fwd_5120.cu", + "cscr/layer_norm/ln_parallel_bwd_5120.cu", + "cscr/layer_norm/ln_parallel_fwd_6144.cu", + "cscr/layer_norm/ln_parallel_bwd_6144.cu", + "cscr/layer_norm/ln_parallel_fwd_7168.cu", + "cscr/layer_norm/ln_parallel_bwd_7168.cu", + "cscr/layer_norm/ln_parallel_fwd_8192.cu", + "cscr/layer_norm/ln_parallel_bwd_8192.cu", + ], + extra_compile_args={ + "cxx": ["-O3"], + "nvcc": [ + "-O3", + "-U__CUDA_NO_HALF_OPERATORS__", + "-U__CUDA_NO_HALF_CONVERSIONS__", + "-U__CUDA_NO_BFLOAT16_OPERATORS__", + "-U__CUDA_NO_BFLOAT16_CONVERSIONS__", + "-U__CUDA_NO_BFLOAT162_OPERATORS__", + "-U__CUDA_NO_BFLOAT162_CONVERSIONS__", + "--expt-relaxed-constexpr", + "--expt-extended-lambda", + "--use_fast_math", + ], + }, + include_dirs=[ + _this_dir / "csrc" / "layer_norm", + ], + ), + ] +else: + raise ValueError(f"Unknown build target: {build_target}") + +setup( + packages=find_packages( + include=["flash_attn*"], + ), + ext_modules=ext_modules, cmdclass={"build_ext": BuildExtension}, zip_safe=False, ) From 96eea86161bc41afd5575ef20a286e2c69c43a54 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Mon, 21 Oct 2024 11:27:30 -0700 Subject: [PATCH 02/31] Apply suggestions from code review Co-authored-by: jakirkham Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- recipe/meta.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 0c1136b..ced4e1a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,10 +1,9 @@ -{% set name = "flash-attn" %} {% set version = "2.6.3" %} {% set fused_dense_lib_name = "flash-attn-fused-dense-lib" %} {% set layer_norm_name = "flash-attn-layer-norm" %} package: - name: {{ name|lower }} + name: flash-attn-split version: {{ version }} source: @@ -19,7 +18,7 @@ build: script_env: # Limit MAX_JOBS in order to prevent runners from crashing - MAX_JOBS=20 - - 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] skip: true # [py==313] # Skip until pytorch dependency on setuptools is fixed @@ -56,7 +55,7 @@ requirements: - pytorch =*=cuda* outputs: - - name: {{ name|lower }} + - name: flash-attn build: script: python -m pip install . -vvv --no-deps --no-build-isolation From 2b81b6f46cb56b0d940de8a1e645993fc088c67a Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Mon, 21 Oct 2024 11:40:17 -0700 Subject: [PATCH 03/31] easier debugging --- recipe/meta.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index ced4e1a..8995377 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -17,14 +17,14 @@ build: number: 2 script_env: # Limit MAX_JOBS in order to prevent runners from crashing - - MAX_JOBS=20 + - MAX_JOBS=4 - TORCH_CUDA_ARCH_LIST=8.0+PTX skip: true # [cuda_compiler_version in (undefined, "None")] skip: true # [not linux] skip: true # [py==313] # Skip until pytorch dependency on setuptools is fixed # debugging skips below - # skip: true # [py!=313] - # skip: true # [cuda_compiler_version != "12.0"] + skip: true # [py!=313] + skip: true # [cuda_compiler_version != "12.0"] ignore_run_exports_from: - libcublas-dev # [(cuda_compiler_version or "").startswith("12")] - libcusolver-dev # [(cuda_compiler_version or "").startswith("12")] @@ -104,6 +104,7 @@ about: - LICENSE_CUTLASS.txt extra: + feedstock_name: flash-attn recipe-maintainers: - carterbox - weiji14 From c36935316e5796479671d61be314a65da5dc868f Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Mon, 21 Oct 2024 16:40:56 -0700 Subject: [PATCH 04/31] build once and split outputs --- recipe/meta.yaml | 45 ++++++++++----- recipe/setup.py | 144 +++++++++++++++++++++-------------------------- 2 files changed, 95 insertions(+), 94 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8995377..dd1834d 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,3 +1,4 @@ +{% set name = "flash-attn" %} {% set version = "2.6.3" %} {% set fused_dense_lib_name = "flash-attn-fused-dense-lib" %} {% set layer_norm_name = "flash-attn-layer-norm" %} @@ -15,6 +16,7 @@ source: build: number: 2 + script: python -m pip install . -vvv --no-deps --no-build-isolation script_env: # Limit MAX_JOBS in order to prevent runners from crashing - MAX_JOBS=4 @@ -23,10 +25,11 @@ build: skip: true # [not linux] skip: true # [py==313] # Skip until pytorch dependency on setuptools is fixed # debugging skips below - skip: true # [py!=313] + skip: true # [py!=312] skip: true # [cuda_compiler_version != "12.0"] ignore_run_exports_from: - libcublas-dev # [(cuda_compiler_version or "").startswith("12")] + - libcurand-dev # [(cuda_compiler_version or "").startswith("12")] - libcusolver-dev # [(cuda_compiler_version or "").startswith("12")] - libcusparse-dev # [(cuda_compiler_version or "").startswith("12")] @@ -41,6 +44,7 @@ requirements: - 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")] + - libcurand-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 @@ -55,9 +59,12 @@ requirements: - pytorch =*=cuda* outputs: - - name: flash-attn - build: - script: python -m pip install . -vvv --no-deps --no-build-isolation + - name: {{ name|lower }} + + files: + exclude: + - 'lib/python*/site-packages/fused_dense_lib.cpython*.so' + - 'lib/python*/site-packages/dropout_layer_norm.cpython*.so' test: imports: @@ -68,28 +75,36 @@ outputs: - pip - name: {{ fused_dense_lib_name|lower }} - build: - script: python -m pip install . -vvv --no-deps --no-build-isolation - script_env: - - BUILD_FLASH_ATTN_COMPONENT=fused_dense_lib + + files: + include: + - 'lib/python*/site-packages/fused_dense_lib.cpython*.so' + + requirements: + run: + - {{ pin_subpackage(name|lower, exact=True) }} test: imports: - - fused_dense_lib + - flash_attn.ops.fused_dense commands: - pip check requires: - pip - name: {{ layer_norm_name|lower }} - build: - script: python -m pip install . -vvv --no-deps --no-build-isolation - script_env: - - BUILD_FLASH_ATTN_COMPONENT=layer_norm + + files: + include: + - 'lib/python*/site-packages/dropout_layer_norm.cpython*.so' + + requirements: + run: + - {{ pin_subpackage(name|lower, exact=True) }} test: imports: - - dropout_layer_norm + - flash_attn.ops.layer_norm commands: - pip check requires: @@ -104,7 +119,7 @@ about: - LICENSE_CUTLASS.txt extra: - feedstock_name: flash-attn + feedstock_name: {{ name|lower }} recipe-maintainers: - carterbox - weiji14 diff --git a/recipe/setup.py b/recipe/setup.py index 2d49ba8..84c5bcd 100644 --- a/recipe/setup.py +++ b/recipe/setup.py @@ -8,7 +8,7 @@ Read more at the pytorch docs: https://pytorch.org/docs/stable/cpp_extension.html#torch.utils.cpp_extension.CUDAExtension """ -import os + import pathlib from setuptools import setup, find_packages @@ -16,11 +16,11 @@ _this_dir = pathlib.Path(__file__).parent.absolute() -# Check environment variable to determine which component to build -build_target = os.environ.get("BUILD_FLASH_ATTN_COMPONENT", "core") - -if build_target == "core": - ext_modules = [ +setup( + packages=find_packages( + include=["flash_attn*"], + ), + ext_modules=[ CUDAExtension( name="flash_attn_2_cuda", sources=[ @@ -138,9 +138,6 @@ _this_dir / "csrc" / "cutlass" / "include", ], ), - ] -elif build_target == "fused_dense_lib": - ext_modules = [ CUDAExtension( name="fused_dense_lib", sources=[ @@ -152,69 +149,66 @@ 'nvcc': ['-O3'], }, ), - ] -elif build_target == "layer_norm": - ext_modules = [ CUDAExtension( name="dropout_layer_norm", sources=[ - "cscr/layer_norm/ln_api.cpp", - "cscr/layer_norm/ln_fwd_256.cu", - "cscr/layer_norm/ln_bwd_256.cu", - "cscr/layer_norm/ln_fwd_512.cu", - "cscr/layer_norm/ln_bwd_512.cu", - "cscr/layer_norm/ln_fwd_768.cu", - "cscr/layer_norm/ln_bwd_768.cu", - "cscr/layer_norm/ln_fwd_1024.cu", - "cscr/layer_norm/ln_bwd_1024.cu", - "cscr/layer_norm/ln_fwd_1280.cu", - "cscr/layer_norm/ln_bwd_1280.cu", - "cscr/layer_norm/ln_fwd_1536.cu", - "cscr/layer_norm/ln_bwd_1536.cu", - "cscr/layer_norm/ln_fwd_2048.cu", - "cscr/layer_norm/ln_bwd_2048.cu", - "cscr/layer_norm/ln_fwd_2560.cu", - "cscr/layer_norm/ln_bwd_2560.cu", - "cscr/layer_norm/ln_fwd_3072.cu", - "cscr/layer_norm/ln_bwd_3072.cu", - "cscr/layer_norm/ln_fwd_4096.cu", - "cscr/layer_norm/ln_bwd_4096.cu", - "cscr/layer_norm/ln_fwd_5120.cu", - "cscr/layer_norm/ln_bwd_5120.cu", - "cscr/layer_norm/ln_fwd_6144.cu", - "cscr/layer_norm/ln_bwd_6144.cu", - "cscr/layer_norm/ln_fwd_7168.cu", - "cscr/layer_norm/ln_bwd_7168.cu", - "cscr/layer_norm/ln_fwd_8192.cu", - "cscr/layer_norm/ln_bwd_8192.cu", - "cscr/layer_norm/ln_parallel_fwd_256.cu", - "cscr/layer_norm/ln_parallel_bwd_256.cu", - "cscr/layer_norm/ln_parallel_fwd_512.cu", - "cscr/layer_norm/ln_parallel_bwd_512.cu", - "cscr/layer_norm/ln_parallel_fwd_768.cu", - "cscr/layer_norm/ln_parallel_bwd_768.cu", - "cscr/layer_norm/ln_parallel_fwd_1024.cu", - "cscr/layer_norm/ln_parallel_bwd_1024.cu", - "cscr/layer_norm/ln_parallel_fwd_1280.cu", - "cscr/layer_norm/ln_parallel_bwd_1280.cu", - "cscr/layer_norm/ln_parallel_fwd_1536.cu", - "cscr/layer_norm/ln_parallel_bwd_1536.cu", - "cscr/layer_norm/ln_parallel_fwd_2048.cu", - "cscr/layer_norm/ln_parallel_bwd_2048.cu", - "cscr/layer_norm/ln_parallel_fwd_2560.cu", - "cscr/layer_norm/ln_parallel_bwd_2560.cu", - "cscr/layer_norm/ln_parallel_fwd_3072.cu", - "cscr/layer_norm/ln_parallel_bwd_3072.cu", - "cscr/layer_norm/ln_parallel_fwd_4096.cu", - "cscr/layer_norm/ln_parallel_bwd_4096.cu", - "cscr/layer_norm/ln_parallel_fwd_5120.cu", - "cscr/layer_norm/ln_parallel_bwd_5120.cu", - "cscr/layer_norm/ln_parallel_fwd_6144.cu", - "cscr/layer_norm/ln_parallel_bwd_6144.cu", - "cscr/layer_norm/ln_parallel_fwd_7168.cu", - "cscr/layer_norm/ln_parallel_bwd_7168.cu", - "cscr/layer_norm/ln_parallel_fwd_8192.cu", - "cscr/layer_norm/ln_parallel_bwd_8192.cu", + "csrc/layer_norm/ln_api.cpp", + "csrc/layer_norm/ln_fwd_256.cu", + "csrc/layer_norm/ln_bwd_256.cu", + "csrc/layer_norm/ln_fwd_512.cu", + "csrc/layer_norm/ln_bwd_512.cu", + "csrc/layer_norm/ln_fwd_768.cu", + "csrc/layer_norm/ln_bwd_768.cu", + "csrc/layer_norm/ln_fwd_1024.cu", + "csrc/layer_norm/ln_bwd_1024.cu", + "csrc/layer_norm/ln_fwd_1280.cu", + "csrc/layer_norm/ln_bwd_1280.cu", + "csrc/layer_norm/ln_fwd_1536.cu", + "csrc/layer_norm/ln_bwd_1536.cu", + "csrc/layer_norm/ln_fwd_2048.cu", + "csrc/layer_norm/ln_bwd_2048.cu", + "csrc/layer_norm/ln_fwd_2560.cu", + "csrc/layer_norm/ln_bwd_2560.cu", + "csrc/layer_norm/ln_fwd_3072.cu", + "csrc/layer_norm/ln_bwd_3072.cu", + "csrc/layer_norm/ln_fwd_4096.cu", + "csrc/layer_norm/ln_bwd_4096.cu", + "csrc/layer_norm/ln_fwd_5120.cu", + "csrc/layer_norm/ln_bwd_5120.cu", + "csrc/layer_norm/ln_fwd_6144.cu", + "csrc/layer_norm/ln_bwd_6144.cu", + "csrc/layer_norm/ln_fwd_7168.cu", + "csrc/layer_norm/ln_bwd_7168.cu", + "csrc/layer_norm/ln_fwd_8192.cu", + "csrc/layer_norm/ln_bwd_8192.cu", + "csrc/layer_norm/ln_parallel_fwd_256.cu", + "csrc/layer_norm/ln_parallel_bwd_256.cu", + "csrc/layer_norm/ln_parallel_fwd_512.cu", + "csrc/layer_norm/ln_parallel_bwd_512.cu", + "csrc/layer_norm/ln_parallel_fwd_768.cu", + "csrc/layer_norm/ln_parallel_bwd_768.cu", + "csrc/layer_norm/ln_parallel_fwd_1024.cu", + "csrc/layer_norm/ln_parallel_bwd_1024.cu", + "csrc/layer_norm/ln_parallel_fwd_1280.cu", + "csrc/layer_norm/ln_parallel_bwd_1280.cu", + "csrc/layer_norm/ln_parallel_fwd_1536.cu", + "csrc/layer_norm/ln_parallel_bwd_1536.cu", + "csrc/layer_norm/ln_parallel_fwd_2048.cu", + "csrc/layer_norm/ln_parallel_bwd_2048.cu", + "csrc/layer_norm/ln_parallel_fwd_2560.cu", + "csrc/layer_norm/ln_parallel_bwd_2560.cu", + "csrc/layer_norm/ln_parallel_fwd_3072.cu", + "csrc/layer_norm/ln_parallel_bwd_3072.cu", + "csrc/layer_norm/ln_parallel_fwd_4096.cu", + "csrc/layer_norm/ln_parallel_bwd_4096.cu", + "csrc/layer_norm/ln_parallel_fwd_5120.cu", + "csrc/layer_norm/ln_parallel_bwd_5120.cu", + "csrc/layer_norm/ln_parallel_fwd_6144.cu", + "csrc/layer_norm/ln_parallel_bwd_6144.cu", + "csrc/layer_norm/ln_parallel_fwd_7168.cu", + "csrc/layer_norm/ln_parallel_bwd_7168.cu", + "csrc/layer_norm/ln_parallel_fwd_8192.cu", + "csrc/layer_norm/ln_parallel_bwd_8192.cu", ], extra_compile_args={ "cxx": ["-O3"], @@ -229,21 +223,13 @@ "--expt-relaxed-constexpr", "--expt-extended-lambda", "--use_fast_math", - ], + ] }, include_dirs=[ _this_dir / "csrc" / "layer_norm", ], ), - ] -else: - raise ValueError(f"Unknown build target: {build_target}") - -setup( - packages=find_packages( - include=["flash_attn*"], - ), - ext_modules=ext_modules, + ], cmdclass={"build_ext": BuildExtension}, zip_safe=False, ) From 7186c4cd548579b22a4eca6153500c43afe8e6e7 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Mon, 21 Oct 2024 16:43:08 -0700 Subject: [PATCH 05/31] MNT: Re-rendered with conda-build 24.9.0, conda-smithy 3.43.0, and conda-forge-pinning 2024.10.21.14.45.36 --- ...piler_version11python3.10.____cpython.yaml | 46 ------------------- ...piler_version11python3.11.____cpython.yaml | 46 ------------------- ...piler_version11python3.12.____cpython.yaml | 46 ------------------- ...mpiler_version11python3.9.____cpython.yaml | 46 ------------------- ...piler_version12python3.10.____cpython.yaml | 46 ------------------- ...piler_version12python3.11.____cpython.yaml | 46 ------------------- ...mpiler_version12python3.9.____cpython.yaml | 46 ------------------- .github/workflows/conda-build.yml | 42 +---------------- .scripts/build_steps.sh | 10 ++-- README.md | 26 ++++++----- 10 files changed, 20 insertions(+), 380 deletions(-) delete mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml deleted file mode 100644 index 4e19191..0000000 --- a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '11' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.8' -cxx_compiler: -- gxx -cxx_compiler_version: -- '11' -docker_image: -- quay.io/condaforge/linux-anvil-cuda:11.8 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.10.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml deleted file mode 100644 index f77b690..0000000 --- a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '11' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.8' -cxx_compiler: -- gxx -cxx_compiler_version: -- '11' -docker_image: -- quay.io/condaforge/linux-anvil-cuda:11.8 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.11.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml deleted file mode 100644 index de20559..0000000 --- a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '11' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.8' -cxx_compiler: -- gxx -cxx_compiler_version: -- '11' -docker_image: -- quay.io/condaforge/linux-anvil-cuda:11.8 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.12.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml deleted file mode 100644 index 69b099e..0000000 --- a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '11' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.8' -cxx_compiler: -- gxx -cxx_compiler_version: -- '11' -docker_image: -- quay.io/condaforge/linux-anvil-cuda:11.8 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.9.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml deleted file mode 100644 index 7b46f9f..0000000 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '12' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- '12.0' -cxx_compiler: -- gxx -cxx_compiler_version: -- '12' -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.10.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml deleted file mode 100644 index 3ceb8f2..0000000 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '12' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- '12.0' -cxx_compiler: -- gxx -cxx_compiler_version: -- '12' -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.11.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml deleted file mode 100644 index 06a95ad..0000000 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '12' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- '12.0' -cxx_compiler: -- gxx -cxx_compiler_version: -- '12' -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.9.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 1623e44..440ef7d 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -21,46 +21,11 @@ jobs: fail-fast: false matrix: include: - - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h2de5a10efd', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h92f0a476d9', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h58c8c5aa26', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_hfa7a9894d1', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h91fe0f008d', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_hed7027e077', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython UPLOAD_PACKAGES: True os: ubuntu runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h11ed5249c8', 'linux', 'x64', 'self-hosted'] DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h625cfcfe2e', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 steps: - name: Checkout code @@ -117,12 +82,6 @@ jobs: fi ./.scripts/run_osx_build.sh - - name: Install Miniconda for windows - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 - with: - miniforge-version: latest - if: matrix.os == 'windows' - - name: Build on windows shell: cmd run: | @@ -131,6 +90,7 @@ jobs: set "sha=%GITHUB_SHA%" call ".scripts\run_win_build.bat" env: + MINIFORGE_HOME: D:\Miniforge PYTHONUNBUFFERED: 1 CONFIG: ${{ matrix.CONFIG }} CI: github_actions diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 9123720..f8051ab 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -31,13 +31,13 @@ pkgs_dirs: solver: libmamba CONDARC +mv /opt/conda/conda-meta/history /opt/conda/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S) +echo > /opt/conda/conda-meta/history +micromamba install --root-prefix ~/.conda --prefix /opt/conda \ + --yes --override-channels --channel conda-forge --strict-channel-priority \ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 -mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" - # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" diff --git a/README.md b/README.md index 42d2d8b..dc44110 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -About flash-attn-feedstock -========================== +About flash-attn-split-feedstock +================================ Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/flash-attn-feedstock/blob/main/LICENSE.txt) @@ -22,27 +22,29 @@ Current release info | Name | Downloads | Version | Platforms | | --- | --- | --- | --- | | [![Conda Recipe](https://img.shields.io/badge/recipe-flash--attn-green.svg)](https://anaconda.org/conda-forge/flash-attn) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flash-attn.svg)](https://anaconda.org/conda-forge/flash-attn) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flash-attn.svg)](https://anaconda.org/conda-forge/flash-attn) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flash-attn.svg)](https://anaconda.org/conda-forge/flash-attn) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-flash--attn--fused--dense--lib-green.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flash-attn-fused-dense-lib.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flash-attn-fused-dense-lib.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flash-attn-fused-dense-lib.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-flash--attn--layer--norm-green.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flash-attn-layer-norm.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flash-attn-layer-norm.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flash-attn-layer-norm.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | -Installing flash-attn -===================== +Installing flash-attn-split +=========================== -Installing `flash-attn` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with: +Installing `flash-attn-split` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with: ``` conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `flash-attn` can be installed with `conda`: +Once the `conda-forge` channel has been enabled, `flash-attn, flash-attn-fused-dense-lib, flash-attn-layer-norm` can be installed with `conda`: ``` -conda install flash-attn +conda install flash-attn flash-attn-fused-dense-lib flash-attn-layer-norm ``` or with `mamba`: ``` -mamba install flash-attn +mamba install flash-attn flash-attn-fused-dense-lib flash-attn-layer-norm ``` It is possible to list all of the versions of `flash-attn` available on your platform with `conda`: @@ -112,17 +114,17 @@ Terminology produce the finished article (built conda distributions) -Updating flash-attn-feedstock -============================= +Updating flash-attn-split-feedstock +=================================== -If you would like to improve the flash-attn recipe or build a new +If you would like to improve the flash-attn-split recipe or build a new package version, please fork this repository and submit a PR. Upon submission, your changes will be run on the appropriate platforms to give the reviewer an opportunity to confirm that the changes result in a successful build. Once merged, the recipe will be re-built and uploaded automatically to the `conda-forge` channel, whereupon the built conda packages will be available for everybody to install and use from the `conda-forge` channel. -Note that all branches in the conda-forge/flash-attn-feedstock are +Note that all branches in the conda-forge/flash-attn-split-feedstock are immediately built and any created packages are uploaded, so PRs should be based on branches in forks and branches in the main repository should only be used to build distinct package versions. From aa4487dad6d25e0c9411ba43ad704e435a286e4c Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Tue, 22 Oct 2024 13:14:58 -0700 Subject: [PATCH 06/31] fix output requirements --- recipe/meta.yaml | 97 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 81 insertions(+), 16 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index dd1834d..90dab8b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -53,18 +53,40 @@ requirements: - pytorch - pytorch =*=cuda* - setuptools - run: - - einops - - python - - pytorch =*=cuda* outputs: - name: {{ name|lower }} + 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")] + - libcurand-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* + files: - exclude: - - 'lib/python*/site-packages/fused_dense_lib.cpython*.so' - - 'lib/python*/site-packages/dropout_layer_norm.cpython*.so' + include: + - 'lib/python*/site-packages/flash_attn/**' + - 'lib/python*/site-packages/flash_attn-{{ version }}.dist-info/**' + - 'lib/python*/site-packages/flash_attn_2_cuda.cpython-*.so' test: imports: @@ -76,14 +98,36 @@ outputs: - name: {{ fused_dense_lib_name|lower }} - files: - include: - - 'lib/python*/site-packages/fused_dense_lib.cpython*.so' - 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")] + - libcurand-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* - {{ pin_subpackage(name|lower, exact=True) }} + files: + include: + - 'lib/python*/site-packages/fused_dense_lib.cpython-*.so' + test: imports: - flash_attn.ops.fused_dense @@ -94,14 +138,36 @@ outputs: - name: {{ layer_norm_name|lower }} - files: - include: - - 'lib/python*/site-packages/dropout_layer_norm.cpython*.so' - 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")] + - libcurand-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* - {{ pin_subpackage(name|lower, exact=True) }} + files: + include: + - 'lib/python*/site-packages/dropout_layer_norm.cpython-*.so' + test: imports: - flash_attn.ops.layer_norm @@ -119,7 +185,6 @@ about: - LICENSE_CUTLASS.txt extra: - feedstock_name: {{ name|lower }} recipe-maintainers: - carterbox - weiji14 From a3ff73dc551353fc48db596934694b4ee023471c Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Tue, 22 Oct 2024 15:08:31 -0700 Subject: [PATCH 07/31] Remove unneeded output requirements --- recipe/meta.yaml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 90dab8b..b39bb6b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -59,11 +59,8 @@ outputs: 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")] @@ -72,15 +69,10 @@ outputs: - 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* files: include: @@ -100,11 +92,8 @@ outputs: 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")] @@ -113,15 +102,9 @@ outputs: - 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* - {{ pin_subpackage(name|lower, exact=True) }} files: @@ -140,11 +123,8 @@ outputs: 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")] @@ -153,15 +133,9 @@ outputs: - 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* - {{ pin_subpackage(name|lower, exact=True) }} files: From 5a5f9aaec0022d9183162c82d0b7b6749b064613 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Tue, 22 Oct 2024 16:22:34 -0700 Subject: [PATCH 08/31] add back feedstock name to extra --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b39bb6b..43a7509 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -159,6 +159,7 @@ about: - LICENSE_CUTLASS.txt extra: + feedstock-name: {{ name|lower }} recipe-maintainers: - carterbox - weiji14 From 943fe53c3993a457b1c9cd50e0edcd273a08161f Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Wed, 23 Oct 2024 10:03:16 -0700 Subject: [PATCH 09/31] further clean up output requirements --- recipe/meta.yaml | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 43a7509..bf938c6 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -27,11 +27,6 @@ build: # debugging skips below skip: true # [py!=312] skip: true # [cuda_compiler_version != "12.0"] - ignore_run_exports_from: - - libcublas-dev # [(cuda_compiler_version or "").startswith("12")] - - libcurand-dev # [(cuda_compiler_version or "").startswith("12")] - - libcusolver-dev # [(cuda_compiler_version or "").startswith("12")] - - libcusparse-dev # [(cuda_compiler_version or "").startswith("12")] requirements: build: @@ -56,19 +51,14 @@ requirements: outputs: - name: {{ name|lower }} - requirements: build: - - {{ compiler('cxx') }} - - {{ stdlib('c') }} + - libgcc-ng # needed for DSO checker + - libstdcxx-ng # needed for DSO checker + - {{ stdlib('c') }} # needed for DSO checker 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")] - - libcurand-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 - python - pytorch =*=cuda* run: @@ -89,19 +79,14 @@ outputs: - pip - name: {{ fused_dense_lib_name|lower }} - requirements: build: - - {{ compiler('cxx') }} - - {{ stdlib('c') }} + - libgcc-ng # needed for DSO checker + - libstdcxx-ng # needed for DSO checker + - {{ stdlib('c') }} # needed for DSO checker 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")] - - libcurand-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 - python - pytorch =*=cuda* run: @@ -120,19 +105,14 @@ outputs: - pip - name: {{ layer_norm_name|lower }} - requirements: build: - - {{ compiler('cxx') }} - - {{ stdlib('c') }} + - libgcc-ng # needed for DSO checker + - libstdcxx-ng # needed for DSO checker + - {{ stdlib('c') }} # needed for DSO checker 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")] - - libcurand-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 - python - pytorch =*=cuda* run: From ad5c63425c2da748fccf830fe805d4b33776aa96 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Wed, 23 Oct 2024 10:10:20 -0700 Subject: [PATCH 10/31] make linter happy --- recipe/meta.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index bf938c6..74823c8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -53,9 +53,8 @@ outputs: - name: {{ name|lower }} requirements: build: - - libgcc-ng # needed for DSO checker - - libstdcxx-ng # needed for DSO checker - - {{ stdlib('c') }} # needed for DSO checker + - {{ compiler('cxx') }} # needed for DSO checker + - {{ stdlib('c') }} # needed for DSO checker host: - cuda-version {{ cuda_compiler_version }} # same cuda for host and build - cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")] @@ -81,9 +80,8 @@ outputs: - name: {{ fused_dense_lib_name|lower }} requirements: build: - - libgcc-ng # needed for DSO checker - - libstdcxx-ng # needed for DSO checker - - {{ stdlib('c') }} # needed for DSO checker + - {{ compiler('cxx') }} # needed for DSO checker + - {{ stdlib('c') }} # needed for DSO checker host: - cuda-version {{ cuda_compiler_version }} # same cuda for host and build - cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")] @@ -107,9 +105,8 @@ outputs: - name: {{ layer_norm_name|lower }} requirements: build: - - libgcc-ng # needed for DSO checker - - libstdcxx-ng # needed for DSO checker - - {{ stdlib('c') }} # needed for DSO checker + - {{ compiler('cxx') }} # needed for DSO checker + - {{ stdlib('c') }} # needed for DSO checker host: - cuda-version {{ cuda_compiler_version }} # same cuda for host and build - cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")] From 3b82cd153490b4bbbc95309aa1327716458af114 Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Wed, 30 Oct 2024 15:12:45 -0500 Subject: [PATCH 11/31] REF: Remove name templates --- recipe/meta.yaml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 74823c8..adead57 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,14 +1,11 @@ -{% set name = "flash-attn" %} {% set version = "2.6.3" %} -{% set fused_dense_lib_name = "flash-attn-fused-dense-lib" %} -{% set layer_norm_name = "flash-attn-layer-norm" %} package: name: flash-attn-split version: {{ version }} source: - - url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/flash_attn-{{ version }}.tar.gz + - url: https://pypi.io/packages/source/f/flash-attn/flash_attn-{{ version }}.tar.gz sha256: 5bfae9500ad8e7d2937ebccb4906f3bc464d1bf66eedd0e4adabd520811c7b52 # Overwrite with a simpler build script that doesn't try to revend pre-compiled binaries - path: pyproject.toml @@ -50,7 +47,7 @@ requirements: - setuptools outputs: - - name: {{ name|lower }} + - name: flash-attn requirements: build: - {{ compiler('cxx') }} # needed for DSO checker @@ -77,7 +74,7 @@ outputs: requires: - pip - - name: {{ fused_dense_lib_name|lower }} + - name: flash-attn-fused-dense-lib requirements: build: - {{ compiler('cxx') }} # needed for DSO checker @@ -88,7 +85,7 @@ outputs: - python - pytorch =*=cuda* run: - - {{ pin_subpackage(name|lower, exact=True) }} + - {{ pin_subpackage('flash-attn', exact=True) }} files: include: @@ -102,7 +99,7 @@ outputs: requires: - pip - - name: {{ layer_norm_name|lower }} + - name: flash-attn-layer-norm requirements: build: - {{ compiler('cxx') }} # needed for DSO checker @@ -113,7 +110,7 @@ outputs: - python - pytorch =*=cuda* run: - - {{ pin_subpackage(name|lower, exact=True) }} + - {{ pin_subpackage('flash-attn', exact=True) }} files: include: @@ -136,7 +133,7 @@ about: - LICENSE_CUTLASS.txt extra: - feedstock-name: {{ name|lower }} + feedstock-name: flash-attn recipe-maintainers: - carterbox - weiji14 From 0986f1d273410d036bcb41b9ef818a8d84da888d Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Wed, 30 Oct 2024 15:18:38 -0500 Subject: [PATCH 12/31] BLD: Strip binaries --- recipe/setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipe/setup.py b/recipe/setup.py index 84c5bcd..690e5cf 100644 --- a/recipe/setup.py +++ b/recipe/setup.py @@ -132,6 +132,7 @@ # "-DFLASHATTENTION_DISABLE_LOCAL", ], }, + extra_link_args = ["-Wl,--strip-all"], include_dirs=[ _this_dir / "csrc" / "flash_attn", _this_dir / "csrc" / "flash_attn" / "src", @@ -148,6 +149,7 @@ 'cxx': ['-O3', ], 'nvcc': ['-O3'], }, + extra_link_args = ["-Wl,--strip-all"], ), CUDAExtension( name="dropout_layer_norm", @@ -225,6 +227,7 @@ "--use_fast_math", ] }, + extra_link_args = ["-Wl,--strip-all"], include_dirs=[ _this_dir / "csrc" / "layer_norm", ], From 7788404773db18e067581dfef789a28d356b480a Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Wed, 30 Oct 2024 15:20:02 -0500 Subject: [PATCH 13/31] MNT: Re-rendered with conda-build 24.9.0, conda-smithy 3.43.0, and conda-forge-pinning 2024.10.30.09.36.02 --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index dc44110..0f5fa4f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -About flash-attn-split-feedstock -================================ +About flash-attn-feedstock +========================== Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/flash-attn-feedstock/blob/main/LICENSE.txt) @@ -25,10 +25,10 @@ Current release info | [![Conda Recipe](https://img.shields.io/badge/recipe-flash--attn--fused--dense--lib-green.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flash-attn-fused-dense-lib.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flash-attn-fused-dense-lib.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flash-attn-fused-dense-lib.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | | [![Conda Recipe](https://img.shields.io/badge/recipe-flash--attn--layer--norm-green.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flash-attn-layer-norm.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flash-attn-layer-norm.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flash-attn-layer-norm.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | -Installing flash-attn-split -=========================== +Installing flash-attn +===================== -Installing `flash-attn-split` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with: +Installing `flash-attn` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with: ``` conda config --add channels conda-forge @@ -114,17 +114,17 @@ Terminology produce the finished article (built conda distributions) -Updating flash-attn-split-feedstock -=================================== +Updating flash-attn-feedstock +============================= -If you would like to improve the flash-attn-split recipe or build a new +If you would like to improve the flash-attn recipe or build a new package version, please fork this repository and submit a PR. Upon submission, your changes will be run on the appropriate platforms to give the reviewer an opportunity to confirm that the changes result in a successful build. Once merged, the recipe will be re-built and uploaded automatically to the `conda-forge` channel, whereupon the built conda packages will be available for everybody to install and use from the `conda-forge` channel. -Note that all branches in the conda-forge/flash-attn-split-feedstock are +Note that all branches in the conda-forge/flash-attn-feedstock are immediately built and any created packages are uploaded, so PRs should be based on branches in forks and branches in the main repository should only be used to build distinct package versions. From 927614818da5c39002839aa6d0fdb3f0409bb20c Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Thu, 31 Oct 2024 11:47:55 -0500 Subject: [PATCH 14/31] REF: Use PYTHON template for python path --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index adead57..37cd258 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -13,7 +13,7 @@ source: build: number: 2 - script: python -m pip install . -vvv --no-deps --no-build-isolation + script: {{ PYTHON }} -m pip install . -vvv --no-deps --no-build-isolation script_env: # Limit MAX_JOBS in order to prevent runners from crashing - MAX_JOBS=4 From ceebe6abcc91b85887e93b04beae55cb041f929f Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Fri, 1 Nov 2024 11:41:55 -0700 Subject: [PATCH 15/31] Apply suggestions from code review Co-authored-by: jakirkham --- recipe/meta.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 37cd258..95b2de6 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -17,7 +17,7 @@ build: script_env: # Limit MAX_JOBS in order to prevent runners from crashing - MAX_JOBS=4 - - TORCH_CUDA_ARCH_LIST=8.0+PTX + - TORCH_CUDA_ARCH_LIST=8.0;8.6;8.9;9.0+PTX skip: true # [cuda_compiler_version in (undefined, "None")] skip: true # [not linux] skip: true # [py==313] # Skip until pytorch dependency on setuptools is fixed @@ -50,15 +50,25 @@ outputs: - name: flash-attn requirements: build: - - {{ compiler('cxx') }} # needed for DSO checker - - {{ stdlib('c') }} # needed for DSO checker + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - {{ compiler('cuda') }} + - {{ stdlib('c') }} 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")] + - libcurand-dev # [(cuda_compiler_version or "").startswith("12")] + - libcusolver-dev # [(cuda_compiler_version or "").startswith("12")] + - libcusparse-dev # [(cuda_compiler_version or "").startswith("12")] - python + - libtorch # required until pytorch run_exports libtorch + - pytorch - pytorch =*=cuda* run: - einops + - python + - pytorch =*=cuda* files: include: From 4938b990ef2672cbe00340ac5d566ca3c7bd8c20 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Fri, 1 Nov 2024 11:47:22 -0700 Subject: [PATCH 16/31] comment out debug lines --- recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 95b2de6..52dfa52 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -22,8 +22,8 @@ build: skip: true # [not linux] skip: true # [py==313] # Skip until pytorch dependency on setuptools is fixed # debugging skips below - skip: true # [py!=312] - skip: true # [cuda_compiler_version != "12.0"] + # skip: true # [py!=312] + # skip: true # [cuda_compiler_version != "12.0"] requirements: build: From 18375e2c88b161865c940a98ff2e984262fe23c0 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Fri, 1 Nov 2024 11:49:05 -0700 Subject: [PATCH 17/31] update pypi domain --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 52dfa52..86aa311 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -5,7 +5,7 @@ package: version: {{ version }} source: - - url: https://pypi.io/packages/source/f/flash-attn/flash_attn-{{ version }}.tar.gz + - url: https://pypi.org/packages/source/f/flash-attn/flash_attn-{{ version }}.tar.gz sha256: 5bfae9500ad8e7d2937ebccb4906f3bc464d1bf66eedd0e4adabd520811c7b52 # Overwrite with a simpler build script that doesn't try to revend pre-compiled binaries - path: pyproject.toml From 53ac85b1a4d2af8c475cafed88e45a16c2e97157 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Fri, 1 Nov 2024 11:52:15 -0700 Subject: [PATCH 18/31] MNT: Re-rendered with conda-build 24.9.0, conda-smithy 3.43.2, and conda-forge-pinning 2024.10.31.23.25.38 --- ...piler_version11python3.10.____cpython.yaml | 46 +++++++++++++++++++ ...piler_version11python3.11.____cpython.yaml | 46 +++++++++++++++++++ ...piler_version11python3.12.____cpython.yaml | 46 +++++++++++++++++++ ...mpiler_version11python3.9.____cpython.yaml | 46 +++++++++++++++++++ ...piler_version12python3.10.____cpython.yaml | 46 +++++++++++++++++++ ...piler_version12python3.11.____cpython.yaml | 46 +++++++++++++++++++ ...mpiler_version12python3.9.____cpython.yaml | 46 +++++++++++++++++++ .ci_support/migrations/python312.yaml | 38 --------------- .github/workflows/conda-build.yml | 35 ++++++++++++++ 9 files changed, 357 insertions(+), 38 deletions(-) create mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml delete mode 100644 .ci_support/migrations/python312.yaml diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml new file mode 100644 index 0000000..4e19191 --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml new file mode 100644 index 0000000..f77b690 --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml new file mode 100644 index 0000000..de20559 --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml new file mode 100644 index 0000000..69b099e --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml new file mode 100644 index 0000000..7b46f9f --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml new file mode 100644 index 0000000..3ceb8f2 --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml new file mode 100644 index 0000000..06a95ad --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cdt_name + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/migrations/python312.yaml b/.ci_support/migrations/python312.yaml deleted file mode 100644 index 784a0a2..0000000 --- a/.ci_support/migrations/python312.yaml +++ /dev/null @@ -1,38 +0,0 @@ -migrator_ts: 1695046563 -__migrator: - migration_number: 1 - operation: key_add - primary_key: python - ordering: - python: - - 3.6.* *_cpython - - 3.7.* *_cpython - - 3.8.* *_cpython - - 3.9.* *_cpython - - 3.10.* *_cpython - - 3.11.* *_cpython - - 3.12.* *_cpython # new entry - - 3.6.* *_73_pypy - - 3.7.* *_73_pypy - - 3.8.* *_73_pypy - - 3.9.* *_73_pypy - paused: false - longterm: True - pr_limit: 30 - max_solver_attempts: 6 # this will make the bot retry "not solvable" stuff 6 times - exclude: - # this shouldn't attempt to modify the python feedstocks - - python - - pypy3.6 - - pypy-meta - - cross-python - - python_abi - exclude_pinned_pkgs: false - -python: - - 3.12.* *_cpython -# additional entries to add for zip_keys -numpy: - - 1.26 -python_impl: - - cpython diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 440ef7d..c84f511 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -21,11 +21,46 @@ jobs: fail-fast: false matrix: include: + - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h2de5a10efd', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 + - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h92f0a476d9', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 + - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h58c8c5aa26', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 + - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_hfa7a9894d1', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 + - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h91fe0f008d', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_hed7027e077', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython UPLOAD_PACKAGES: True os: ubuntu runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h11ed5249c8', 'linux', 'x64', 'self-hosted'] DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h625cfcfe2e', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 steps: - name: Checkout code From e55f64b6f6d0114db9bb5779cb182ca0d16949a7 Mon Sep 17 00:00:00 2001 From: Daniel Ching <9604511+carterbox@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:02:52 -0500 Subject: [PATCH 19/31] BLD: Collect channel pinnings in outputs --- recipe/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 86aa311..98d9a89 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -93,6 +93,7 @@ outputs: - cuda-version {{ cuda_compiler_version }} # same cuda for host and build - cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")] - python + - pytorch - pytorch =*=cuda* run: - {{ pin_subpackage('flash-attn', exact=True) }} @@ -118,6 +119,7 @@ outputs: - cuda-version {{ cuda_compiler_version }} # same cuda for host and build - cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")] - python + - pytorch - pytorch =*=cuda* run: - {{ pin_subpackage('flash-attn', exact=True) }} From 26421e4b333775110ab5362524eb2cd3123a251b Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Thu, 7 Nov 2024 14:32:40 -0600 Subject: [PATCH 20/31] BLD: Disallow undefined symbols --- recipe/setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe/setup.py b/recipe/setup.py index 690e5cf..25e7a7e 100644 --- a/recipe/setup.py +++ b/recipe/setup.py @@ -132,7 +132,7 @@ # "-DFLASHATTENTION_DISABLE_LOCAL", ], }, - extra_link_args = ["-Wl,--strip-all"], + extra_link_args = ["-Wl,--strip-all", "-Wl,--no-undefined"], include_dirs=[ _this_dir / "csrc" / "flash_attn", _this_dir / "csrc" / "flash_attn" / "src", @@ -149,7 +149,7 @@ 'cxx': ['-O3', ], 'nvcc': ['-O3'], }, - extra_link_args = ["-Wl,--strip-all"], + extra_link_args = ["-Wl,--strip-all", "-Wl,--no-undefined"], ), CUDAExtension( name="dropout_layer_norm", @@ -227,7 +227,7 @@ "--use_fast_math", ] }, - extra_link_args = ["-Wl,--strip-all"], + extra_link_args = ["-Wl,--strip-all", "-Wl,--no-undefined"], include_dirs=[ _this_dir / "csrc" / "layer_norm", ], From f1c1351b4f2e45247539f2c8014201ead6186baf Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Thu, 7 Nov 2024 14:58:05 -0600 Subject: [PATCH 21/31] BLD: Disallow undefined symbols --- recipe/setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe/setup.py b/recipe/setup.py index 25e7a7e..9848070 100644 --- a/recipe/setup.py +++ b/recipe/setup.py @@ -132,7 +132,7 @@ # "-DFLASHATTENTION_DISABLE_LOCAL", ], }, - extra_link_args = ["-Wl,--strip-all", "-Wl,--no-undefined"], + extra_link_args=["-Wl,--strip-all", "-Wl,--no-undefined"], include_dirs=[ _this_dir / "csrc" / "flash_attn", _this_dir / "csrc" / "flash_attn" / "src", @@ -149,7 +149,7 @@ 'cxx': ['-O3', ], 'nvcc': ['-O3'], }, - extra_link_args = ["-Wl,--strip-all", "-Wl,--no-undefined"], + extra_link_args=["-Wl,--strip-all", "-Wl,--no-undefined"], ), CUDAExtension( name="dropout_layer_norm", @@ -227,7 +227,7 @@ "--use_fast_math", ] }, - extra_link_args = ["-Wl,--strip-all", "-Wl,--no-undefined"], + extra_link_args=["-Wl,--strip-all", "-Wl,--no-undefined"], include_dirs=[ _this_dir / "csrc" / "layer_norm", ], From e5cc5605f2cc79ad44c71c9b1825e0e8f328ff0e Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Thu, 7 Nov 2024 14:58:41 -0600 Subject: [PATCH 22/31] STY: Format setup.py --- recipe/setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/recipe/setup.py b/recipe/setup.py index 9848070..6658958 100644 --- a/recipe/setup.py +++ b/recipe/setup.py @@ -146,8 +146,10 @@ "csrc/fused_dense_lib/fused_dense_cuda.cu", ], extra_compile_args={ - 'cxx': ['-O3', ], - 'nvcc': ['-O3'], + "cxx": [ + "-O3", + ], + "nvcc": ["-O3"], }, extra_link_args=["-Wl,--strip-all", "-Wl,--no-undefined"], ), @@ -225,7 +227,7 @@ "--expt-relaxed-constexpr", "--expt-extended-lambda", "--use_fast_math", - ] + ], }, extra_link_args=["-Wl,--strip-all", "-Wl,--no-undefined"], include_dirs=[ From 0789f14da51108ad0e409fee7c40be9be3da151d Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Thu, 7 Nov 2024 15:01:10 -0600 Subject: [PATCH 23/31] BLD: Rename fused-dense output --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 98d9a89..9c73ef0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -84,7 +84,7 @@ outputs: requires: - pip - - name: flash-attn-fused-dense-lib + - name: flash-attn-fused-dense requirements: build: - {{ compiler('cxx') }} # needed for DSO checker From 0d23df94a1e2baa192f156fb82ae70e0cda35fb6 Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Sun, 10 Nov 2024 11:55:16 -0600 Subject: [PATCH 24/31] BLD: Match host deps with library links --- recipe/meta.yaml | 7 +++---- recipe/setup.py | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 9c73ef0..52a95f6 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -57,10 +57,6 @@ outputs: 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")] - - libcurand-dev # [(cuda_compiler_version or "").startswith("12")] - - libcusolver-dev # [(cuda_compiler_version or "").startswith("12")] - - libcusparse-dev # [(cuda_compiler_version or "").startswith("12")] - python - libtorch # required until pytorch run_exports libtorch - pytorch @@ -92,10 +88,12 @@ outputs: 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")] - python - pytorch - pytorch =*=cuda* run: + - python - {{ pin_subpackage('flash-attn', exact=True) }} files: @@ -122,6 +120,7 @@ outputs: - pytorch - pytorch =*=cuda* run: + - python - {{ pin_subpackage('flash-attn', exact=True) }} files: diff --git a/recipe/setup.py b/recipe/setup.py index 6658958..56059a9 100644 --- a/recipe/setup.py +++ b/recipe/setup.py @@ -10,6 +10,7 @@ """ import pathlib +import sys from setuptools import setup, find_packages from torch.utils.cpp_extension import BuildExtension, CUDAExtension @@ -138,6 +139,10 @@ _this_dir / "csrc" / "flash_attn" / "src", _this_dir / "csrc" / "cutlass" / "include", ], + libraries=[ + "cudart", + f"python{sys.version_info[0]}.{sys.version_info[1]}", + ], ), CUDAExtension( name="fused_dense_lib", @@ -152,6 +157,12 @@ "nvcc": ["-O3"], }, extra_link_args=["-Wl,--strip-all", "-Wl,--no-undefined"], + libraries=[ + "cudart", + "cublas", + "cublasLt", + f"python{sys.version_info[0]}.{sys.version_info[1]}", + ], ), CUDAExtension( name="dropout_layer_norm", @@ -233,6 +244,10 @@ include_dirs=[ _this_dir / "csrc" / "layer_norm", ], + libraries=[ + "cudart", + f"python{sys.version_info[0]}.{sys.version_info[1]}", + ], ), ], cmdclass={"build_ext": BuildExtension}, From 66a46f7c878707514e33909795ae65c1498c6ba5 Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Sun, 10 Nov 2024 11:56:38 -0600 Subject: [PATCH 25/31] CI: Increase timeout to 12 hours --- conda-forge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-forge.yml b/conda-forge.yml index 5dbd5ef..4d31f4f 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -5,7 +5,7 @@ conda_build: error_overlinking: true conda_forge_output_validation: true github_actions: - timeout_minutes: 540 + timeout_minutes: 720 self_hosted: true triggers: - push From 16d13d10debb49356987fd91b1b2ec6200c79ef7 Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Mon, 11 Nov 2024 11:27:52 -0600 Subject: [PATCH 26/31] CI: Bump timeout to 18 hours --- conda-forge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-forge.yml b/conda-forge.yml index 4d31f4f..da58b5b 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -5,7 +5,7 @@ conda_build: error_overlinking: true conda_forge_output_validation: true github_actions: - timeout_minutes: 720 + timeout_minutes: 1080 self_hosted: true triggers: - push From 7190d0be637f8b64a4c680d064e78a9a63efb9be Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Mon, 11 Nov 2024 11:30:46 -0600 Subject: [PATCH 27/31] MNT: Re-rendered with conda-build 24.9.0, conda-smithy 3.44.3, and conda-forge-pinning 2024.11.11.08.59.26 --- ...piler_version11python3.10.____cpython.yaml | 46 ------------------- ...piler_version11python3.11.____cpython.yaml | 46 ------------------- ...piler_version11python3.12.____cpython.yaml | 3 +- ...mpiler_version11python3.9.____cpython.yaml | 46 ------------------- ...piler_version12python3.10.____cpython.yaml | 46 ------------------- ...piler_version12python3.11.____cpython.yaml | 46 ------------------- ...piler_version12python3.12.____cpython.yaml | 46 ------------------- ...mpiler_version12python3.9.____cpython.yaml | 46 ------------------- .github/workflows/automerge.yml | 17 ------- .github/workflows/conda-build.yml | 37 +-------------- .github/workflows/webservices.yml | 13 ------ README.md | 8 ++-- recipe/meta.yaml | 4 +- 13 files changed, 8 insertions(+), 396 deletions(-) delete mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython.yaml delete mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml delete mode 100644 .github/workflows/automerge.yml delete mode 100644 .github/workflows/webservices.yml diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml deleted file mode 100644 index 4e19191..0000000 --- a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '11' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.8' -cxx_compiler: -- gxx -cxx_compiler_version: -- '11' -docker_image: -- quay.io/condaforge/linux-anvil-cuda:11.8 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.10.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml deleted file mode 100644 index f77b690..0000000 --- a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '11' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.8' -cxx_compiler: -- gxx -cxx_compiler_version: -- '11' -docker_image: -- quay.io/condaforge/linux-anvil-cuda:11.8 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.11.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml index de20559..866f345 100644 --- a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml +++ b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython.yaml @@ -7,7 +7,7 @@ c_stdlib: c_stdlib_version: - '2.17' cdt_name: -- cos7 +- conda channel_sources: - conda-forge channel_targets: @@ -40,7 +40,6 @@ zip_keys: - - c_compiler_version - cxx_compiler_version - c_stdlib_version - - cdt_name - cuda_compiler - cuda_compiler_version - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml deleted file mode 100644 index 69b099e..0000000 --- a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '11' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.8' -cxx_compiler: -- gxx -cxx_compiler_version: -- '11' -docker_image: -- quay.io/condaforge/linux-anvil-cuda:11.8 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.9.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml deleted file mode 100644 index 7b46f9f..0000000 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '12' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- '12.0' -cxx_compiler: -- gxx -cxx_compiler_version: -- '12' -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.10.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml deleted file mode 100644 index 3ceb8f2..0000000 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '12' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- '12.0' -cxx_compiler: -- gxx -cxx_compiler_version: -- '12' -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.11.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython.yaml deleted file mode 100644 index a63ae35..0000000 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '12' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- '12.0' -cxx_compiler: -- gxx -cxx_compiler_version: -- '12' -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.12.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml deleted file mode 100644 index 06a95ad..0000000 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml +++ /dev/null @@ -1,46 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '12' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- '12.0' -cxx_compiler: -- gxx -cxx_compiler_version: -- '12' -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -github_actions_labels: -- cirun-openstack-cpu-xlarge -libtorch: -- '2.4' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.9.* *_cpython -pytorch: -- '2.4' -target_platform: -- linux-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version - - c_stdlib_version - - cdt_name - - cuda_compiler - - cuda_compiler_version - - docker_image diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index 0535f6a..0000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,17 +0,0 @@ -on: - status: {} - check_suite: - types: - - completed - -jobs: - automerge-action: - runs-on: ubuntu-latest - name: automerge - steps: - - name: automerge-action - id: automerge-action - uses: conda-forge/automerge-action@main - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index c84f511..6e15e60 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -16,51 +16,16 @@ jobs: build: name: ${{ matrix.CONFIG }} runs-on: ${{ matrix.runs_on }} - timeout-minutes: 540 + timeout-minutes: 1080 strategy: fail-fast: false matrix: include: - - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h2de5a10efd', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h92f0a476d9', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython UPLOAD_PACKAGES: True os: ubuntu runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h58c8c5aa26', 'linux', 'x64', 'self-hosted'] DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_hfa7a9894d1', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h91fe0f008d', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_hed7027e077', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h11ed5249c8', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython - UPLOAD_PACKAGES: True - os: ubuntu - runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h625cfcfe2e', 'linux', 'x64', 'self-hosted'] - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 steps: - name: Checkout code diff --git a/.github/workflows/webservices.yml b/.github/workflows/webservices.yml deleted file mode 100644 index d6f06b5..0000000 --- a/.github/workflows/webservices.yml +++ /dev/null @@ -1,13 +0,0 @@ -on: repository_dispatch - -jobs: - webservices: - runs-on: ubuntu-latest - name: webservices - steps: - - name: webservices - id: webservices - uses: conda-forge/webservices-dispatch-action@main - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/README.md b/README.md index 0f5fa4f..22a9d81 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Current release info | Name | Downloads | Version | Platforms | | --- | --- | --- | --- | | [![Conda Recipe](https://img.shields.io/badge/recipe-flash--attn-green.svg)](https://anaconda.org/conda-forge/flash-attn) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flash-attn.svg)](https://anaconda.org/conda-forge/flash-attn) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flash-attn.svg)](https://anaconda.org/conda-forge/flash-attn) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flash-attn.svg)](https://anaconda.org/conda-forge/flash-attn) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-flash--attn--fused--dense--lib-green.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flash-attn-fused-dense-lib.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flash-attn-fused-dense-lib.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flash-attn-fused-dense-lib.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense-lib) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-flash--attn--fused--dense-green.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flash-attn-fused-dense.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flash-attn-fused-dense.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flash-attn-fused-dense.svg)](https://anaconda.org/conda-forge/flash-attn-fused-dense) | | [![Conda Recipe](https://img.shields.io/badge/recipe-flash--attn--layer--norm-green.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flash-attn-layer-norm.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flash-attn-layer-norm.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flash-attn-layer-norm.svg)](https://anaconda.org/conda-forge/flash-attn-layer-norm) | Installing flash-attn @@ -35,16 +35,16 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `flash-attn, flash-attn-fused-dense-lib, flash-attn-layer-norm` can be installed with `conda`: +Once the `conda-forge` channel has been enabled, `flash-attn, flash-attn-fused-dense, flash-attn-layer-norm` can be installed with `conda`: ``` -conda install flash-attn flash-attn-fused-dense-lib flash-attn-layer-norm +conda install flash-attn flash-attn-fused-dense flash-attn-layer-norm ``` or with `mamba`: ``` -mamba install flash-attn flash-attn-fused-dense-lib flash-attn-layer-norm +mamba install flash-attn flash-attn-fused-dense flash-attn-layer-norm ``` It is possible to list all of the versions of `flash-attn` available on your platform with `conda`: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 52a95f6..519fc83 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -22,8 +22,8 @@ build: skip: true # [not linux] skip: true # [py==313] # Skip until pytorch dependency on setuptools is fixed # debugging skips below - # skip: true # [py!=312] - # skip: true # [cuda_compiler_version != "12.0"] + skip: true # [py!=312] + skip: true # [cuda_compiler_version != "11.8"] requirements: build: From 210cead93fdd0f48f8d0a7e997092b6d8b0682c6 Mon Sep 17 00:00:00 2001 From: Daniel Ching <9604511+carterbox@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:19:28 -0600 Subject: [PATCH 28/31] BLD: Need cudatoolkit for CUDA 11 --- recipe/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 519fc83..e383fb8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -85,6 +85,7 @@ outputs: build: - {{ compiler('cxx') }} # needed for DSO checker - {{ stdlib('c') }} # needed for DSO checker + - {{ compiler('cuda') }} host: - cuda-version {{ cuda_compiler_version }} # same cuda for host and build - cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")] @@ -113,6 +114,7 @@ outputs: build: - {{ compiler('cxx') }} # needed for DSO checker - {{ stdlib('c') }} # needed for DSO checker + - {{ compiler('cuda') }} host: - cuda-version {{ cuda_compiler_version }} # same cuda for host and build - cuda-cudart-dev # [(cuda_compiler_version or "").startswith("12")] From 5bcbf375c7ed8e668501fbf5179de8c7d2107941 Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Fri, 15 Nov 2024 13:04:38 -0600 Subject: [PATCH 29/31] BLD: Bump build again just to add a commit --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e383fb8..2e88250 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -12,7 +12,7 @@ source: - path: setup.py build: - number: 2 + number: 3 script: {{ PYTHON }} -m pip install . -vvv --no-deps --no-build-isolation script_env: # Limit MAX_JOBS in order to prevent runners from crashing From 48a7800dd5a8e0c703687c3bf2fbd78e527f4646 Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Sun, 17 Nov 2024 18:41:37 -0600 Subject: [PATCH 30/31] BLD: Disable debug skips --- recipe/meta.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 2e88250..b7a57d5 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -12,7 +12,7 @@ source: - path: setup.py build: - number: 3 + number: 2 script: {{ PYTHON }} -m pip install . -vvv --no-deps --no-build-isolation script_env: # Limit MAX_JOBS in order to prevent runners from crashing @@ -22,8 +22,8 @@ build: skip: true # [not linux] skip: true # [py==313] # Skip until pytorch dependency on setuptools is fixed # debugging skips below - skip: true # [py!=312] - skip: true # [cuda_compiler_version != "11.8"] + # skip: true # [py!=312] + # skip: true # [cuda_compiler_version != "11.8"] requirements: build: From 4e225cc2f88ed7cd4edeb82811a4b09375add261 Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Sun, 17 Nov 2024 18:44:35 -0600 Subject: [PATCH 31/31] MNT: Re-rendered with conda-build 24.9.0, conda-smithy 3.44.6, and conda-forge-pinning 2024.11.17.06.32.00 --- ...piler_version11python3.10.____cpython.yaml | 45 +++++++++++++++++++ ...piler_version11python3.11.____cpython.yaml | 45 +++++++++++++++++++ ...mpiler_version11python3.9.____cpython.yaml | 45 +++++++++++++++++++ ...piler_version12python3.10.____cpython.yaml | 45 +++++++++++++++++++ ...piler_version12python3.11.____cpython.yaml | 45 +++++++++++++++++++ ...piler_version12python3.12.____cpython.yaml | 45 +++++++++++++++++++ ...mpiler_version12python3.9.____cpython.yaml | 45 +++++++++++++++++++ .github/workflows/conda-build.yml | 35 +++++++++++++++ 8 files changed, 350 insertions(+) create mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython.yaml create mode 100644 .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml new file mode 100644 index 0000000..072ad5d --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython.yaml @@ -0,0 +1,45 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- conda +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml new file mode 100644 index 0000000..f530a5b --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython.yaml @@ -0,0 +1,45 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- conda +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml new file mode 100644 index 0000000..df5a6d3 --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython.yaml @@ -0,0 +1,45 @@ +c_compiler: +- gcc +c_compiler_version: +- '11' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- conda +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.8' +cxx_compiler: +- gxx +cxx_compiler_version: +- '11' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.8 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml new file mode 100644 index 0000000..9562803 --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython.yaml @@ -0,0 +1,45 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- conda +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml new file mode 100644 index 0000000..f53693a --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython.yaml @@ -0,0 +1,45 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- conda +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython.yaml new file mode 100644 index 0000000..f45ddea --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython.yaml @@ -0,0 +1,45 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- conda +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml new file mode 100644 index 0000000..de13864 --- /dev/null +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython.yaml @@ -0,0 +1,45 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- conda +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +github_actions_labels: +- cirun-openstack-cpu-xlarge +libtorch: +- '2.4' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +pytorch: +- '2.4' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - c_stdlib_version + - cuda_compiler + - cuda_compiler_version + - docker_image diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 6e15e60..ecff2ce 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -21,11 +21,46 @@ jobs: fail-fast: false matrix: include: + - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.10.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h2de5a10efd', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 + - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.11.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h92f0a476d9', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.12.____cpython UPLOAD_PACKAGES: True os: ubuntu runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_h58c8c5aa26', 'linux', 'x64', 'self-hosted'] DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 + - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.9.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version11cuda_c_hfa7a9894d1', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 + - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.10.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h91fe0f008d', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.11.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_hed7027e077', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.12.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h11ed5249c8', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.9.____cpython + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['cirun-openstack-cpu-xlarge--${{ github.run_id }}-linux_64_c_compiler_version12cuda_c_h625cfcfe2e', 'linux', 'x64', 'self-hosted'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 steps: - name: Checkout code