Skip to content

Flash backward residuals: measured roofs on A, library-bound ARITH gap on B (successor to #94) #103

Open

Description

@feitreim

Successor to #94, which closes with backward attention at ~34.8 ms (from 57.0) across five phases (#96 issue warp, #98 pass split, #100 MMA shapes + deferred dQ drain, #102 deferred dK/dV drain). Everything left is a measured roof or a cross-repo library question — parked here, low priority.

Residuals, with the numbers that bound them

Kernel A (flash_q):

  • Score-MMA width: SMMA is 1142 of a 1384-tick ISSUE, all M128_N64 at 55.7 ticks/K16-equivalent vs M128_N128's 32.0. Widening needs a 128-key visit at 256 KiB shared vs the 227 available — the second dS slot doesn't fit, and at one slot the post-barrier tensor core goes fully exposed and eats the win.
  • exp2: ~512 ticks/visit against the SFU's 16 lanes/SM/cycle; nothing removes it at this algorithm.
  • Real DRAM (incl. causal K/V re-read) is ~2.5 GB, 46% of the 8 TB/s roof — not the 13.8% compulsory figure Flash-attention backward: 57 ms/step, and the visit is one warp's serial chain of MMA issue then register pass #94's original table quoted. The remaining headroom is ~2×, not 7×.

Kernel B (flash_kv):

Instruments

Extended probe in-tree (partitioned ISSUE/PASS, FILL/GAP/EPI with EWAIT/ETREAD/ESTORE). Caveat on record from #102: the ISSUE/IDLE split is instrument-sensitive (two implementations read 3188/23 vs 1564/1642 on the same kernel — sums agree); trust column totals, not that split.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions