Skip to content

Commit

Permalink
disable autocast for ring_flash_attn_cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Apr 6, 2024
1 parent 5b202e4 commit 8225bfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ring_attention_pytorch/ring_flash_attention_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from torch import nn, einsum, Tensor
import torch.nn.functional as F
from torch.autograd.function import Function
from torch.cuda.amp import autocast

from ring_attention_pytorch.ring import (
ring_pass,
Expand Down Expand Up @@ -833,6 +834,7 @@ def backward(ctx, do):

ring_flash_attn_cuda_ = RingFlashAttentionCUDAFunction.apply

@autocast(enabled = False)
@beartype
def ring_flash_attn_cuda(
q: Tensor,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'ring-attention-pytorch',
packages = find_packages(exclude=[]),
version = '0.3.0',
version = '0.3.2',
license='MIT',
description = 'Ring Attention - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit 8225bfc

Please sign in to comment.