GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - qwertyforce/fast_attn_short_seq: Fast attention for short sequences

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
README.md
README.md
 
 
benchmark.py
benchmark.py
 
 
correctness_check.py
correctness_check.py
 
 
requirements.txt
requirements.txt
 
 
triton_cross_attention.py
triton_cross_attention.py
 
 
triton_self_attention.py
triton_self_attention.py
 
 

Repository files navigation

fast_attn_short_seq

Fast attention for short sequences
https://blog.qwertyforce.dev/posts/fast_attention_for_short_sequences

seq_len head_dim Triton FlashAttention2 MemEff cuDNN Triton vs best
fwdbwd fwdbwd fwdbwd fwdbwd fwdbwdtotal
32 32 0.561.01 2.338.48 1.354.28 2.174.11 2.41x4.07x 3.59x
64 0.771.31 2.8314.11 1.426.02 2.155.20 1.84x3.97x 3.53x
128 1.432.49 2.8115.47 3.3822.40 2.758.51 1.92x3.42x 2.87x
256 (bs=8k) 1.422.62 1.5513.25 1.4455.25 2.589.67 1.01x3.69x 3.03x
64 32 1.071.96 2.549.86 1.455.84 2.155.47 1.36x2.79x 2.41x
64 1.492.63 2.9316.39 1.609.56 2.167.98 1.07x3.03x 2.46x
128 2.795.50 3.2820.31 3.6831.18 2.7913.67 1.00x2.49x 1.99x
256 (bs=8k) 2.977.75 2.7718.54 2.9664.36 2.9114.51 0.93x1.87x 1.62x
128 32 2.896.16 2.5012.24 4.6315.28 1.978.63 0.68x1.40x 1.17x
64 3.9410.26 3.3420.67 5.0223.04 2.7313.62 0.69x1.33x 1.15x
128 6.8524.28 6.0937.20 8.2247.53 5.4124.80 0.79x1.02x 0.97x
256 (bs=8k) 9.40331.75 5.6139.50 6.5895.48 5.4026.26 0.57x0.08x 0.09x

q=1

kv_len head_dim Triton FlashAttention2 MemEff cuDNN Triton vs best
fwdbwd fwdbwd fwdbwd fwdbwd fwdbwdtotal
32 32 0.340.58 2.287.43 1.363.52 0.692.92 2.03x5.03x 3.92x
64 0.450.77 2.7611.76 1.414.42 0.703.13 1.56x4.06x 3.14x
128 0.801.47 2.6811.69 3.3418.94 1.364.64 1.70x3.16x 2.64x
256 (bs=8k) 0.791.78 1.289.05 1.2649.56 1.575.60 1.59x3.15x 2.79x
64 32 0.571.16 2.307.58 1.414.32 0.992.92 1.74x2.52x 2.26x
64 0.801.54 2.8012.36 1.485.96 1.003.54 1.25x2.30x 1.94x
128 1.462.88 2.7012.22 3.5922.37 1.775.47 1.21x1.90x 1.67x
256 (bs=8k) 1.453.82 1.439.87 1.4455.30 2.465.29 0.99x1.38x 1.47x
128 32 1.062.45 2.358.16 2.318.13 1.413.54 1.33x1.44x 1.41x
64 1.473.06 2.8112.85 2.4611.82 1.524.35 1.03x1.42x 1.30x
128 2.806.21 4.3113.61 3.9730.41 2.806.69 1.00x1.08x 1.05x
256 (bs=8k) 3.095.89 2.7314.27 2.7473.62 4.416.90 0.88x1.17x 1.26x

About

Fast attention for short sequences

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.