Skip to content

[xegpu] Remove obsolete fused_attention_schedule - #312

Merged
tkarna merged 17 commits into
llvm:mainfrom
tkarna:xegpu-rm-fused-attn-schedule
Oct 23, 2026
Merged

tkarna merged 17 commits into
llvm:mainfrom
tkarna:xegpu-rm-fused-attn-schedule

Conversation

@tkarna

@tkarna tkarna commented Oct 22, 2026

Copy link
Copy Markdown
Contributor
  • Adds basic attention layer tile size inference to the new parameter-free xegpu pipeline (wg_tiling_schedule, annotate_layout_schedule, etc.).
  • Adds options to override tile sizes with user-defined values. In fused_attention.py example CLI parameters are propagated to the pipeline.
  • Removes now obsolete fused_attention_schedule.
  • extract_handle transform op supports parameter handles as well.

Assisted-by: Claude

@tkarna

tkarna commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Part of larger rewrite where the new gpu pipeline will also replace mlp_schedule and reduction_schedule. I'll address those next.

@tkarna

tkarna commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

FYI @charithaintc @nbpatel

"d_head": args.d_head,
"wg_tile": [1, args.wg_rows],
"sg_rows": args.sg_rows,
"subgroup_size": args.subgroup_size,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note that I'm dropping the subgroup_size option for now. It is essentially hard-coded to 16 in the attention schedule. We can turn it into a parameter when needed.

@charithaintc charithaintc 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.

LGTM. I would keep fused_attention.py is possible. usually its easier to debug perf/layout issues with it. maybe move it to an IR test from e2e test.

# Operand A shape is (wg_rows, d_head)
wg_rows, reduction_tile = ir.ShapedType(target_op.results[0].type).shape
wg_rows, d_head = ir.ShapedType(target_op.operands[0].type).shape
assert d_head == 64, "annotate_attention expects d_head to be 64"

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.

I think d_head = 32, 128 should also work (possibly with spill). if we really want to fix it maybe remove dhead option from fused_attention.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, we should add some tile size selection logic based on the problem size. I'll address this in another PR.

Comment thread examples/xegpu/fused_attention.py Resolved
@tkarna
tkarna merged commit 739f7ff into llvm:main Oct 23, 2026
3 checks passed
@tkarna
tkarna deleted the xegpu-rm-fused-attn-schedule branch October 23, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants