Skip to content

frost(sdpa): collapse the mask Capabilities onto the band vocabulary (causal/swa/bottom_right flags are uniformly True) #601

Description

@vedaanta

Follow-up to the diagonal-band mask model (#485) and BR+SWA (#584): the mask-related Capabilities flags in sdpa/fwd/engines.py (and bwd) predate the band model and several no longer discriminate between rows.

Current state (post-#584, 6 fwd + 2 bwd rows):

flag rows differing verdict
causal True on all 8 dead — delete
swa True on all 8 dead — delete
bottom_right True on all 8 dead — delete
right_band_widening 7/8 (SM120-fp8 lacks it) keep, rename into the band vocabulary
bottom_right_with_swa 5/6 (MXFP8 stopgap only, see #600) delete once #600 lands
bottom_right_padded_seq_q SM120 only keep — real kernel gap

Proposed end-state: capabilities mirror the band facts instead of enumerating mask spellings —

  • window_left: bool — serves a left bound (re-added only when some row actually differs; today it wouldn't exist at all);
  • window_right: "none" | "causal" | "any" (or two booleans) — replaces causal + right_band_widening;
  • bottom_right: bool — anchoring;
  • combination flags exist only while a kernel has a genuine interaction bug (the thd_bottom_right / thd_stats precedent: both were deleted the moment all rows agreed).

A capability that is True on every row is dead weight: its mismatch() gate never fires and it costs every future row a line of boilerplate. Deleting the three uniformly-True flags and folding the rest onto the band vocabulary makes "can this engine serve this band?" answerable by comparing two records with the same field names (facts already speak window_left / right_bound / bottom_right).

Blocked on #600 only for the bottom_right_with_swa deletion; the rest is independent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions