diff --git a/csrc/flash_attn/fmha_api.cpp b/csrc/flash_attn/fmha_api.cpp index be2f501..73d9cdb 100644 --- a/csrc/flash_attn/fmha_api.cpp +++ b/csrc/flash_attn/fmha_api.cpp @@ -413,8 +413,8 @@ mha_bwd(const at::Tensor &dout, // total_q x num_heads, x head_size const int total_k = k.size(TOTAL_DIM); TORCH_CHECK(batch_size > 0); TORCH_CHECK((head_size % 8 == 0) && (head_size <= 128)); - if (head_size > 64) { // TODO: eventually we should support SM86 and SM70 with d=128 as well - TORCH_CHECK(is_sm80 || is_sm90); + if (head_size > 64) { + TORCH_CHECK(is_sm80 || is_sm90, "FlashAttention backward for head dim > 64 requires A100 or H100 GPUs as the implementation needs a large amount of shared memory."); } CHECK_SHAPE(q, total_q, num_heads, head_size); diff --git a/setup.py b/setup.py index ebf16b3..ca7f209 100644 --- a/setup.py +++ b/setup.py @@ -162,7 +162,7 @@ ext_modules.append( setup( name="flash_attn", - version="1.0.3.post0", + version="1.0.4", packages=find_packages( exclude=("build", "csrc", "include", "tests", "dist", "docs", "benchmarks", "flash_attn.egg-info",) ), diff --git a/training/Dockerfile b/training/Dockerfile index e915ee3..7e113ee 100644 --- a/training/Dockerfile +++ b/training/Dockerfile @@ -85,11 +85,11 @@ RUN pip install transformers==4.25.1 datasets==2.8.0 pytorch-lightning==1.8.6 tr RUN pip install git+https://github.com/mlcommons/logging.git@2.1.0 # Install FlashAttention -RUN pip install flash-attn==1.0.3.post0 +RUN pip install flash-attn==1.0.4 # Install CUDA extensions for cross-entropy, fused dense, layer norm RUN git clone https://github.com/HazyResearch/flash-attention \ - && cd flash-attention && git checkout v1.0.3.post0 \ + && cd flash-attention && git checkout v1.0.4 \ && cd csrc/fused_softmax && pip install . && cd ../../ \ && cd csrc/rotary && pip install . && cd ../../ \ && cd csrc/xentropy && pip install . && cd ../../ \