Repository navigation
Bound windowed GQA workspace allocations - #32602
Ti-Tai Wang (titaiwangms) merged 4 commits into
Conversation
c9a579a to
c5cf405
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The Flash regression geometry never changes its split workspace, so it cannot detect restoration of unbounded sizing.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Bounds windowed GQA Flash and unfused workspace usage to the resident or staged KV extent.
Changes:
- Adds effective KV-length calculation and applies it to runtime sizing and launches.
- Completes graph-free GQA workspace recipes.
- Adds host/CUDA tests and design documentation.
File summaries
| File | Description |
|---|---|
group_query_attention_workspace_test.cc |
Tests preparation and effective KV lengths. |
group_query_attention_workspace_mea_unfused_test.cc |
Tests backend and complete-route recipes. |
group_query_attention_workspace_header_test.cc |
Extends standalone-header checks. |
group_query_attention_op_test.cc |
Adds windowed CUDA regressions. |
group_query_attention.cc |
Bounds Flash and unfused allocations. |
group_query_attention_workspace.h |
Defines workspace APIs and recipe types. |
group_query_attention_workspace.cc |
Models preparation and past preservation. |
group_query_attention_workspace_routes.cc |
Composes selected-route recipes. |
group_query_attention_workspace_mea_unfused.cc |
Implements MEA and unfused recipes. |
group_query_attention_impl.cu |
Launches unfused attention with effective length. |
attention_workspace_estimation.md |
Documents GQA workspace composition. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
a2d9c95 to
e9bc47e
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new single-token windowed regression calculates an expected cache layout inconsistent with the runtime’s drifting eviction algorithm.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Balanced
There was a problem hiding this comment.
🟢 Approval recommended
The bounded runtime dimensions, recipe calculations, validation, and regression coverage are consistent with the physical cache layout.
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 0 new
- Review effort level: Balanced
|
Found two actionable issues:
|
b189e6c to
fbc8dad
Compare
|
Addressed both P2 findings in
Validation:
|
Use the resident or staged cache extent when sizing Flash and unfused workspace for sliding-window GQA, while preserving non-windowed behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose the selected Flash split count in debug output and assert that staged C+S sizing avoids raw-length split workspace. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assert the zero runtime encoding used when staged windowed KV sizing avoids split-KV workspace. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply the runtime windowed KV-length bound when composing Flash and unfused workspace recipes, and expose the effective allocation length in debug output. Cover staged, decode, below-capacity, and non-windowed route semantics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fbc8dad to
dac27b1
Compare
0b48778
into
microsoft:main
## Description Adds conservative Level-1 and Level-2 workspace estimation for CUDA contrib `GroupQueryAttention`, tracking #29775. This is PR4, the final GQA workspace-estimation PR in the current stack. It depends on #32602, which bounds windowed runtime workspace by the resident/staged KV extent. The estimator: - inventories all reachable GQA CUDA backend routes over dynamic shape bounds; - composes checked preparation and backend workspace recipes; - uses `C` for single-token windowed decode and checked `C + S` for multi-token staging; - bounds Flash split workspace independently of the non-monotonic split heuristic; - reports non-windowed and reachable cuDNN cases as unavailable when no sound graph-free bound exists; - reports Level-1 `runtime_workspace_bytes`; and - declares one operator-owned slot-0 Level-2 root with 256-byte alignment. This PR does not change runtime allocation topology, opt into planner-owned allocation, or slice a planned root. Those remain follow-up integration work. ## Validation - Fresh Release CUDA build on A100 (SM80) - CUDA internal module: 264 passed, 2 unrelated LeanAttention skips - GQA workspace estimate/bounds tests: 18/18 passed - GQA workspace recipe/arithmetic tests: 19/19 passed - Lintrunner and `git diff --check` passed - Deep route-dominance review swept 2.7M complete routes and 25.6M Flash boundary points with no underestimation ## Stack - Depends on #32602 - Tracks #29775 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
T >> Con unfused and multi-token staged Flash routes.Stack
Depends on #32454. The new change for this PR is commit
c9a579a6e8; earlier commits belong to the existing GQA workspace-recipe stack.This is a runtime allocation-reduction prerequisite for the subsequent GQA Level-1/Level-2 workspace-estimation PR. It does not add planner opt-in, planned-pointer access, root slicing, or estimator wiring.
Validation
T=64, C=8and staged FlashT=64, C=8, S=3.git diff --checkpassed.