Skip to content

Conversation

@keshavvinayak01
Copy link
Contributor

Following the discussion at iree-org/iree-turbine#1224

keshavvinayak01 and others added 9 commits November 25, 2025 04:58
Signed-off-by: Keshav Vinayak Jha <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
2. Fixed op signature
3. Added DecomposeComplexOps template for (flash_attn, flash_attn_for_cpu) -> sdpa rewrite.
4. Lit test to check correct decomposition.

Signed-off-by: Keshav Vinayak Jha <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
Copy link

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 adds support for the _scaled_dot_product_flash_attention and _scaled_dot_product_flash_attention_for_cpu operations in the Torch-MLIR dialect. These operations are decomposed into the existing scaled_dot_product_attention operation.

Key Changes:

  • Added decomposition patterns to convert flash attention ops to standard scaled dot product attention
  • Registered the new operations in the ODS generator
  • Added comprehensive test coverage for both new operations

Reviewed changes

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

File Description
lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp Implements decomposition pattern template for both flash attention operations
include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td Defines the two new flash attention operation signatures and parsing/printing logic
projects/pt1/python/torch_mlir/jit_ir_importer/build_tools/torch_ods_gen.py Registers the new operations with their type signatures
test/Dialect/Torch/decompose-complex-ops.mlir Adds test cases verifying decomposition behavior for both operations

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

@keshavvinayak01 keshavvinayak01 marked this pull request as ready for review December 27, 2025 04:09
Signed-off-by: Keshav Vinayak Jha <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
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.

1 participant