Skip to content

[AIROCMLIR-537] Add fusion check for attention with splitKV > 1#2254

Merged
justinrosner merged 4 commits intodevelopfrom
537-splitkv-disable-fusions
Feb 26, 2026
Merged

[AIROCMLIR-537] Add fusion check for attention with splitKV > 1#2254
justinrosner merged 4 commits intodevelopfrom
537-splitkv-disable-fusions

Conversation

@justinrosner
Copy link
Contributor

@justinrosner justinrosner commented Feb 25, 2026

Motivation

This PR adds some additional fusion checks to ensure that we always return a result of fusible: 0 for attention ops with splitKV > 1. This implements: https://amd-hub.atlassian.net/browse/AIROCMLIR-537

Technical Details

Added a new function called testFusionLegalityAttentionSplitKV that make sure that fusions are disabled with splitKV > 1

Test Plan

  • PR CI

Test Result

  • PR CI

Submission Checklist

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements fusion legality checks for attention operations with flash decoding (splitKV > 1) to ensure that fusions are properly disabled when partial results require LSE-based corrections in a subsequent stage.

Changes:

  • Added a new fusion legality check function testFusionLegalityAttentionSplitKV to prevent fusion for attention ops with splitKV > 1
  • Integrated the new check into the isModuleFusible function to be evaluated alongside other fusion legality checks
  • Added test coverage to verify that fusion is disabled when attention operations use splitKV > 1

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
mlir/test/fusion/fusability-attention-splitkv-output-fusion.mlir New test file that verifies fusion is disabled (fusible:0) for attention ops with splitKV = 4
mlir/lib/Dialect/Rock/utility/fusionUtils.cpp Implements testFusionLegalityAttentionSplitKV functions (FuncOp and ModuleOp overloads) following established patterns for fusion legality checks
mlir/lib/Dialect/Rock/Tuning/RockTuningImpl.cpp Integrates the new attention splitKV check into the isModuleFusible function
mlir/include/mlir/Dialect/Rock/utility/fusionUtils.h Declares the new fusion legality check functions with documentation explaining the constraint

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@justinrosner justinrosner force-pushed the 537-splitkv-disable-fusions branch from 5d51869 to 48ef22d Compare February 26, 2026 13:27
@justinrosner justinrosner merged commit 79185d3 into develop Feb 26, 2026
7 of 14 checks passed
@justinrosner justinrosner deleted the 537-splitkv-disable-fusions branch February 26, 2026 17:37
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.

4 participants