Skip to content

Commit

Permalink
Add region for attention
Browse files Browse the repository at this point in the history
  • Loading branch information
saienduri authored Oct 22, 2024
1 parent 0aa226d commit c74ba4f
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 c74ba4f

Please sign in to comment.