Skip to content

Commit

Permalink
[Docs] Clearer error message for bwd d > 64, bump to v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tridao committed Apr 26, 2023
1 parent fbbb107 commit ad11394
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions csrc/flash_attn/fmha_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def append_nvcc_threads(nvcc_extra_args):

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",)
),
Expand Down
4 changes: 2 additions & 2 deletions training/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]

# 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 ../../ \
Expand Down

0 comments on commit ad11394

Please sign in to comment.