Skip to content

[Triton/Gluon] [Feature] unified_attention: support causal=False for bidirectional draft verify - #7244

Open
yuychang wants to merge 1 commit into
ROCm:mainfrom
yuychang:k3/unified-attn-noncausal
Open

yuychang wants to merge 1 commit into
ROCm:mainfrom
yuychang:k3/unified-attn-noncausal

Conversation

@yuychang

@yuychang yuychang commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Motivation

Changes

  • CAUSAL constexpr in the Triton 2D and 3D kernels, default True
    • Causal launches compile as before
    • With CAUSAL=False the key bound, key mask and 2D unmasked loop use seq_len
      • Via shared helpers key_prefix_len / key_unmasked_len / key_mask
  • Wrapper passes causal to both kernels
    • A decode batch (max_seqlen_q == 1) keeps the causal kernels
  • Non-causal raises ValueError for:
    • A sliding window (left >= 0 or right > 0)
      • (-1, 0) and (-1, -1) are accepted
    • ALiBi
    • A query-query bias
    • An fp4 Q, K or V
    • Also raises for a decode batch and under python -O
    • Kernels add tl.static_assert(CAUSAL or SLIDING_WINDOW <= 0)
  • gfx950 / gfx1250 Gluon kernels stay causal-only
    • Non-causal calls (including backend="gluon", also on an arch without Gluon) run Triton
    • A non-causal decode batch keeps Gluon where it is available, else runs Triton
  • gfx1250: a non-causal call with max_seqlen_q > 1 raises ValueError
    • Not validated there, no hardware here
    • Reason: main's Triton 3D kernel with an unshuffled cache misses the reference for short queries on gfx1250
    • Decode batches still run the causal kernels
    • RDNA is not gated (the mask math is arch-agnostic, not measured)
  • The unified_attention docstring states these limits
  • bench_unified_attention.py
    • -non_causal flag (rejects -test and -sliding_window)
    • -sliding_window <= 0 means no window

Performance (if applicable)

  • Workload: Kimi-K3 DSpark draft verify at TP8
    • 8 Q / 2 KV heads, head 64, bf16 Q, fp8 KV, page 128, 4 query tokens per seq
  • Setup of the first table:
Item Value
Command bench_unified_attention.py -b <batch> -sk <keys> -hq 8 -hk 2 -sq 4 -d 64 -block_size 128 -fp8_kv -equal_seqlens [-non_causal] --metric time
Hardware one MI355X
Commits head 3c93fb773 vs main 075695e89
Date 2026-11-10
Statistic median (min–max) of 5 alternating rounds
ROCm version not recorded for this run
Kernel both sides run the Triton 3D kernel
Hardware Workload/configuration main causal (µs) PR causal (µs) PR non-causal (µs) vs main
MI355X 1 × 350K keys 55.6 (55.4–55.7) 55.5 (55.4–55.6) 55.4 (55.2–55.5) 1.00×
MI355X 4 × 350K keys 157.7 (157.4–158.4) 157.9 (157.3–158.1) 157.4 (157.2–157.5) 1.00×
MI355X 16 × 120K keys 212.8 (212.1–213.0) 212.8 (212.5–214.4) 212.0 (211.7–212.0) 1.00×
MI355X 32 × 120K keys 416.6 (416.0–417.8) 416.2 (415.5–417.2) 414.7 (414.5–415.8) 1.00×
MI355X 56 × 120K keys 530.3 (529.7–532.2) 531.3 (527.7–532.0) 528.6 (527.6–529.8) 1.00×
MI355X 56 × 30K keys 135.5 (135.4–135.8) 135.5 (135.4–135.6) 135.4 (135.3–136.9) 1.00×
  • Verification run of the same six rows
    • Head e00afd224 (the PR branch, not merged into main) vs main 4ba20eba9b
    • MI355X (gfx950), GPU 0, ROCm 10.0.0, torch 2.11.0+rocm10.0.0, Triton 3.8.0
    • Same command, median (min–max) of 3 rounds
Hardware Workload/configuration main causal (µs) PR causal (µs) PR non-causal (µs) vs main
MI355X 1 × 350K keys 54.8 (54.6–54.8) 54.8 (54.8–54.9) 53.4 (53.4–53.6) 1.03×
MI355X 4 × 350K keys 156.6 (156.6–156.9) 156.4 (156.4–156.4) 151.1 (151.0–151.2) 1.04×
MI355X 16 × 120K keys 211.2 (211.2–211.4) 211.6 (211.6–211.6) 203.7 (203.6–204.0) 1.04×
MI355X 32 × 120K keys 417.6 (417.2–418.0) 417.4 (417.3–417.6) 399.9 (399.6–400.0) 1.04×
MI355X 56 × 120K keys 537.4 (537.1–537.4) 537.4 (537.3–537.7) 524.5 (524.4–525.0) 1.02×
MI355X 56 × 30K keys 134.4 (134.3–134.4) 134.3 (134.3–134.7) 131.8 (131.7–131.8) 1.02×
  • Here non-causal is 2–4% faster than causal, not 1.00× as in the 2026-11-10 table
    • Other head, base, ROCm and round count
  • PR causal is within 0.3% of main causal
  • PR causal is within 1% of main causal in every cell
  • Historical (no log attached): MI300X
    • Same command, head e98131411 vs main 95c9ab3aa, median of 3
    • 1.00–1.01× on all 6 shapes (main causal 103.0–1087.8 µs)
  • Historical (no log attached): causal, base 5c1489c24 vs head e266d32bf, one MI355X
    • bench_unified_attention.py --backend triton --metric time -equal_seqlens, 3 rounds
    • head/base 0.998–1.002 on verify, prefill and decode shapes, bf16 and fp8
  • Non-causal prefill, review run at e00afd224 (main 50bfa78d0 for the causal baseline)
    • MI355X (gfx950), ROCm 10.0.0, torch 2.11.0+rocm10.0.0, Triton 3.8.0, one GPU, 3 alternating rounds
    • Command (table below)
Item Value
Command bench_unified_attention.py -b 4 -hq 32 -hk 8 -sq 512 -sk 4096 -d 128 --backend triton --metric time -equal_seqlens [-non_causal]
  • The causal rows differ by under 1%
Hardware Workload/configuration main causal (µs) PR causal (µs) PR non-causal (µs) non-causal vs causal
MI355X prefill 4 × 512 q, 4096 keys, 32/8 heads, d128, bf16 173.0–174.5 172.9–174.5 178.7–178.9 1.03×

Testing

  • Unit tests added or updated

  • Performance benchmarks run

  • Tested on MI250X

  • Tested on MI300X

  • op_tests/triton_tests/attention/test_unified_attention.py (run by CI)

    • MI355X (gfx950), Triton 3.8.0, e266d32bf
      • validate-kernel-pr PASS, repo tests 2958 run / 0 failed
      • -k causal 224 passed, 126 skipped
    • Historical (no log attached): MI355X, ROCm 7.2.4, torch 2.11.0+rocm7.2, Triton 3.7.0, 3c93fb773
      • -k non_causal 224 passed / 126 skipped
      • -k "not non_causal" 2642 passed on both PR and main 075695e89; 0 failed
      • One causal case aborts in Triton 3.7.0's compiler on main too and was deselected
        • Case: test_triton_unified_attn_qq_bias_padded_query_rows[num_heads1-4-4096]
        • It passes on Triton 3.8.0
    • Historical (no log attached): MI300X (gfx942), e98131411
      • -k non_causal 206 passed; -k "not non_causal" 1130 passed; 0 failed
    • Skips are gfx950/gfx1250-only cases, Gluon non-causal duplicates, shuffled KV with 2D Gluon and NVFP4 KV
  • Historical (before dce729cf4, which made the benchmark reject -non_causal -test)

    • bench_unified_attention.py -b 4 -hq 32 -hk 8 -sq 512 -sk 4096 -d 128 -test --backend triton
    • Printed PASS for -non_causal, -non_causal -fp8, -non_causal -decode 0.5 and causal
      • Informational: the bench prints FAIL but does not exit non-zero
      • pytest is the accuracy check
    • -non_causal -sliding_window 128 raises
  • Not tested: MI250X, gfx1250, RDNA

    • gfx1250 rejection is tested by monkeypatching the arch flag

Documentation

  • Docstrings updated

  • User guide updated

  • Performance guide updated

  • No documentation change is needed, with the reason stated below

  • The user and performance guides do not document unified_attention arguments

    • The docstring carries the limits

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

  • None
    • Causal calls are unchanged
    • causal=False used to raise AssertionError

PR Self-Review

Reviewed revision

  • a0f1175f4e18216b230a72b6ed1b774b6e294923
    • e00afd224 only shortens a test docstring; runs at e266d32bf and at e00afd224 are labelled below
    • dce729cf4 and the next commit:
      • The backend follows the caller's causal flag (non-causal decode no longer asserts without Gluon)
      • The benchmark rejects -non_causal -test
      • Multi-token non-causal raises on gfx1250
      • A right window above 0 raises for causal=False
    • c8d0b5b55:
      • Runs Triton for a non-causal call before the Gluon availability check
      • Rejects an fp4 V cache with the documented ValueError
      • NaN-fills the output of the non-causal tests
    • build_aiter_wheels on 42fe8c82d failed pulling the Docker image (infra), which failed Aiter Test Gate

Behavior and intent

  • causal=False attends each query token to all keys of its sequence on the Triton 2D and 3D kernels
  • Before, the wrapper asserted causal, so a bidirectional draft block could not use the split-KV kernels
  • Causal calls compile and run as before: CAUSAL is a constexpr defaulting to True
  • Review decisions:
    • Gluon non-causal stays off although the Gluon kernels have a CAUSAL branch: it is not validated
      • Multi-token non-causal calls run Triton except on gfx1250, where they raise
      • Decode uses the causal kernels and keeps Gluon where it is selected and available
    • seq_len < query_len leaves 3D partials unwritten
      • Outside the contract (query tokens are the last keys)

Validation and unverified scope

  • validate-kernel-pr PASS
    • e266d32bf vs 5c1489c24 (MI355X, Triton 3.8.0; S1 grid 1118 run, 0 failed)
    • 3c93fb773 vs 075695e89 (MI355X)
    • e98131411 vs 95c9ab3aa (MI300X)
    • The perf stage skipped each time (the target has no bench harness)
    • Timings in Performance were taken by hand
  • At head a0f1175f4 (MI355X gfx950, GPU 0, ROCm 10.0.0, torch 2.11.0+rocm10.0.0, Triton 3.8.0)
    • pytest -q op_tests/triton_tests/attention/test_unified_attention.py
    • 2965 passed, 3089 skipped, 0 failed (7244-r3.log)
  • At head e00afd224, MI355X (gfx950), GPU 0, ROCm 10.0.0, torch 2.11.0+rocm10.0.0, Triton 3.8.0
    • pytest -k non_causal op_tests/triton_tests/attention/test_unified_attention.py: 224 passed, 126 skipped
    • validate-kernel-pr on test_unified_attn_non_causal (--no-perf) over main 4ba20eba9b: INCONCLUSIVE
      • Repo tests pass; the S1 grid is skipped because no shape-grid hook was configured for this run
      • Its index-width scan lists 1 index expression (q_block_local_idx * BLOCK_Q, 2 sites)
        • Bounded by the query length
      • It also lists 4 unannotated runtime parameters; no 64-bit issue
  • At head c8d0b5b55 (same host, GPU 0)
    • pytest -q op_tests/triton_tests/attention/test_unified_attention.py -k non_causal
    • 227 passed, 126 skipped, 0 failed (log 7244-triage.log)
    • git merge-tree of this head with main 95f38f953 is conflict-free
  • An sglang GPU test covers the aiter backend's ENCODER_ONLY verify ([Perf] [AMD] aiter: Run the DSpark MHA draft on non-causal unified_attention sgl-project/sglang#47437)
  • Not measured:
    • gfx1250 (no hardware here; multi-token non-causal raises there, see Changes)
    • RDNA and MI250X (not gated off; the mask math is arch-agnostic, nothing ran there)
    • End-to-end sglang at the standalone head

PR-specific question

Changed op tests

  • op_tests/triton_tests/attention/test_unified_attention.py
    • test_unified_attn_non_causal
      • Covers verify (3D split-KV, up to 16K keys), prefill and mixed (2D) and decode
      • 8/2 and 8/8 heads, head 64/128, pages 16/128, bf16 and fp8 mixes
      • Compared vs ref_paged_attn(causal=0) with per-request rel L2 (0.02 bf16 Q, 0.05 fp8 Q)
      • A causal launch is 0.19 off on the short request, so a wrong mask fails
    • test_unified_attn_non_causal_features: sinks, softcap, shuffled KV; on gfx950 asserts 2D vs 3D
    • test_unified_attn_non_causal_rejects_unsupported
      • Window, ALiBi, qq bias, fp4 Q/K/V raise, verify and decode
    • test_unified_attn_non_causal_ignores_gluon_request
      • backend="gluon" with causal=False runs Triton when Gluon is unavailable
      • The same call with causal=True still asserts
    • The four positive tests NaN-fill output first, so an unwritten row cannot pass
    • test_unified_attn_non_causal_no_window: (-1, -1) and (-1, 0) match the reference
    • test_unified_attn_non_causal_rejected_on_gfx1250
      • Multi-token non-causal raises when the arch flag is gfx1250
    • Decode (query_len 1) is also covered
      • At a0f1175f4 the whole file gives 2965 passed, 3089 skipped, 0 failed
    • Not redundant: no earlier test calls causal=False
  • op_tests/op_benchmarks/triton/bench_unified_attention.py
    • -non_causal times causal=False
    • Rejects -test (accuracy lives in pytest)
    • Counts all sq * sk pairs in FLOPs

🤖 Generated with Claude Code

@yuychang
yuychang requested review from a team and a balanced review from Copilot October 31, 2026 02:16
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7244 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@aiter-bot

aiter-bot commented Oct 31, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision acf7848125b7 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — validation answer must explicitly state what remains unverified (or say none with a reason)

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Non-causal decode can silently truncate attention to the last 256 keys, while non-positive sliding-window values cause the benchmark to pass arguments the wrapper rejects.

2 open issues
What changed in this PR

Adds non-causal attention to the Triton unified_attention path so draft-model verification can attend to the full block and cached prefix. This feature builds on the length-aware KV splitting in #7088.

Changes:

  • Adds causal-mode controls to the Triton 2D and 3D kernels.
  • Updates wrapper validation and dispatch while keeping Gluon paths causal-only.
  • Adds non-causal tests and a benchmark flag with matching reference checks and work estimates.
File Description
op_tests/​triton_tests/​attention/​test_unified_attention.py Adds non-causal correctness and rejection tests; includes stacked split-KV coverage.
op_tests/​op_benchmarks/​triton/​bench_unified_attention.py Adds non-causal benchmarking and reference checks.
aiter/​ops/​triton/​utils/​unified_attention_utils.py Derives length-aware segment limits for the stacked optimization.
aiter/​ops/​triton/​configs/​gfx950/​triton/​attention/​unified_attention/​DEFAULT.json Adds gfx950 length-aware split settings from #7088.
aiter/​ops/​triton/​attention/​unified_attention.py Validates and dispatches non-causal calls to Triton.
aiter/​ops/​triton/​_triton_kernels/​attention/​unified_attention.py Adds full-sequence key bounds and masks alongside stacked split-KV support.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Non-causal attention accepts sinks, softcap, and shuffled KV without reference tests validating these options on the 2D and split-KV paths.

1 open issue
2 resolved since last review

Review effort: Balanced

@yuychang
yuychang force-pushed the k3/unified-attn-noncausal branch from 29699c7 to 4757462 Compare October 31, 2026 08:55
Copilot AI balanced review requested due to automatic review settings October 31, 2026 08:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The rejection tests omit the new qq_bias and FP4 guards; add cases for qq_bias, uint8 Q, and uint8 KV at query lengths 1 and 2 so removing either guard causes a test failure.

2 open issues

Review effort: Balanced

@zufayu
zufayu requested review from a team and k50112113 November 2, 2026 01:20
Copilot AI balanced review requested due to automatic review settings November 2, 2026 03:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A minor docstring-conformance concern was omitted from the published review and needs human assessment.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 2, 2026 10:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Both test batches select the 3D kernel on gfx950, leaving sinks, softcap, and shuffled KV untested on the non-causal 2D path.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 3, 2026 02:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Reported GPU results cover only gfx950, leaving correctness, causal-regression, and performance validation for gfx942 and gfx1250 unresolved because this source-only review cannot run GPU checks.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 3, 2026 03:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The attention test helper’s four-sentence docstring violates the repository’s short-prose rule and needs to be reduced to two sentences.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 11, 2026 03:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The introduction in unified_attention.py repeats argument details and violates the short-prose guideline, leaving an unresolved review issue.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 11, 2026 09:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

GPU correctness and latency checks for the new attention paths and gfx1250 fallback could not be run independently, and no head-matched validation artifacts were available for inspection.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 12, 2026 01:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The attention masking and dispatch changes lack inspectable head-matched GPU correctness and latency results, and this source-only review cannot reproduce those checks.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 12, 2026 02:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

GPU masking and dispatch changes lack verification against an exact-head validation report, and the gfx1250 Triton fallback remains untested.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 13, 2026 09:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The helper docstring in test_unified_attention.py exceeds the documented two-sentence limit.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 13, 2026 12:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The non-causal GPU masks and backend routing lack head-matched runtime validation evidence, leaving correctness, performance, and unverified gfx1250 coverage for human review.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 20, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because non-causal single-token decode with Gluon requested on gfx942 can raise an availability assertion instead of falling back to Triton.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 21, 2026 12:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new non-causal dispatch reaches unvalidated gfx1250/RDNA paths, including a gfx1250 Triton 3D path with a documented reference mismatch, without exact-head validation or the ability to rerun GPU correctness and performance checks.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 21, 2026 12:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

GPU attention-mask and backend-dispatch changes lack reviewed-head correctness and latency evidence, and this environment cannot verify the enabled RDNA and gfx90a paths.

No open issues 🎉

Review effort: Balanced

- Add a CAUSAL constexpr (default True) to the Triton 2D and 3D kernels using shared key_* helpers.
- Route non-causal calls to Triton while keeping causal kernels (and Gluon when available) for decode.
- Raise ValueError for non-causal sliding window (left >= 0 or right > 0), ALiBi, qq_bias, fp4 Q/K/V, or gfx1250.
- Document unified_attention parameters and non-causal limits, and add -non_causal to bench_unified_attention.py.
- Add non-causal verify, prefill, decode, feature, backend-fallback, and validation tests in test_unified_attention.py.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

No head-matched GPU validation report was supplied, leaving correctness and causal-path performance risks unresolved, particularly for non-causal execution enabled on MI250X and RDNA.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants