Skip to content

Commit

Permalink
Add region for attention. (#27)
Browse files Browse the repository at this point in the history
Related IREE commit:
iree-org/iree@a488d38
  • Loading branch information
saienduri authored Oct 24, 2024
1 parent 0aa226d commit 1fc710a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions attentionbench/attention_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ def generate_mlir(config: AttentionConfig, tuning: Optional[TuningSpec] = None):
{{ indexing_maps = [#Q, #K, #V, #S, #O]
{",compilation_info = #tuning" if tuning and config.dtype == "f16" else ""}
}}
ins(%Q, %K, %V, %scale : !Q, !K, !V, !dtype)
outs(%empty : !O) -> !O
ins(%Q, %K, %V, %scale : !Q, !K, !V, !dtype) outs(%empty : !O) {{
^bb0(%score: f32):
iree_linalg_ext.yield %score : f32
}} -> !O
return %O : !O
}}
"""
Expand Down

0 comments on commit 1fc710a

Please sign in to comment.