You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jit_fuser
def flash_attn_fwd_out_correction(out, out_per_step, seq_dim, softmax_lse, softmax_lse_per_step):
"""Merge partial outputs of each step in Attention with context parallelism"""
softmax_lse_corrected_exp = torch.exp(softmax_lse_per_step - softmax_lse).movedim(2, seq_dim)
softmax_lse_corrected_exp = softmax_lse_corrected_exp.unsqueeze(-1)
out_corrected = out_per_step * softmax_lse_corrected_exp
out.add_(out_corrected)
The final tracing info is:
torch._dynamo.exc.TorchRuntimeError: Failed running call_method movedim(*(FakeTensor(..., device='cuda:4', size=(36, 13056)), 2, 1), **{}):
This was fixed by #1232, which added packed softmax_lse handling for FlashAttention 2.6+/FA3 in context parallelism. The fix is available in TE v1.12 and later. Closing as fixed.
Activity
ksivaman commentedon Oct 10, 2024
Which PyTorch version are you using? I'm wondering if this is related to #1217, could you try that fix?
RedRAINXXXX commentedon Oct 11, 2024
My torch version is:
Version: 2.4.1+cu124
I've tried this (setting NVTE_TORCH_COMPILE to 1) but it didn't work, and I tried removing the @jit_fuser decorator but it also didn't work. :(
The size of softmax_lse and softmax_lse_per_step is (36, 13056), and this will cause a bug when calling movedim(2, seq_dim).
sbhavani commentedon Jun 30, 2026
This was fixed by #1232, which added packed
softmax_lsehandling for FlashAttention 2.6+/FA3 in context parallelism. The fix is available in TE v1.12 and later. Closing as fixed.