Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[PyTorch] Integrate cuDNN GQA + DSA backend into DotProductAttention

Đang mở
#3,028 0 bình luận 1 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@cyanguwa đang làm issue này rồi.

Từ ngày 26/5/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

attention

Is your feature request related to a problem? Please describe.

Transformer Engine currently does not expose a path that combines Grouped Query Attention (GQA) with DeepSeek-style sparse attention (DSA), where each query token attends only to a TopK subset of key/value tokens. Several training workloads need this combination — a GQA attention shape (many query heads sharing fewer K/V heads) with a sparsity pattern that drops attention to all but a small index list per query. Without a TE-native backend, teams either fall back to community Triton kernels, which can't reach production-scale performance, or implement sparse attention outside of TE — losing autograd integration, kernel fusion, and parity with TE's existing attention features.

Describe the solution you'd like

Add a cuDNN-backed sparse-attention path inside DotProductAttention for the PyTorch frontend that:

  • Recognizes a sparse-attention mode and dispatches to the new cuDNN GQA + DSA kernel
  • Accepts a per-query sparse_indices tensor of shape [B, S_q, topk] selecting which K/V positions each query attends to
  • Supports the standard GQA shape (num_attention_heads ≠ num_gqa_groups)
  • Supports BF16 attention at minimum (FP8 indexer extension as a follow-on if needed)
  • Integrates cleanly with TE's autograd and existing context-parallelism path
  • Ships with numerical-equivalence tests against a reference dense-attention baseline restricted to the same TopK indices

cc: @cyanguwa

Ngôn ngữ chính
Python
Star
3.6k
Fork
862
Merge trung bình
4 ngày 21 giờ
Pull request đã merge (30 ngày)
62

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/TransformerEngine

Tất cả issue của NVIDIA/TransformerEngine

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.