Created
January 20, 2025 18:35
-
-
Save pashu123/d07c319549592fbf125f9bbdc22b3d17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#map = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d2, d4)> | |
#map1 = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d5, d4)> | |
#map2 = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d5, d3)> | |
#map3 = affine_map<(d0, d1, d2, d3, d4, d5) -> ()> | |
#map4 = affine_map<(d0, d1, d2, d3, d4, d5) -> (d0, d1, d2, d3)> | |
module { | |
func.func @attention(%arg0: tensor<1x32x128x512xf32>, %arg1: tensor<1x32x128x512xf32>, %arg2: tensor<1x32x128x512xf32>) -> tensor<1x32x128x512xf32> { | |
%cst = arith.constant 1.250000e-01 : f32 | |
%0 = tensor.empty() : tensor<1x32x128x512xf32> | |
%1 = iree_linalg_ext.attention {indexing_maps = [#map, #map1, #map2, #map3, #map4]} ins(%arg0, %arg1, %arg2, %cst : tensor<1x32x128x512xf32>, tensor<1x32x128x512xf32>, tensor<1x32x128x512xf32>, f32) outs(%0 : tensor<1x32x128x512xf32>) { | |
^bb0(%arg4: f32): | |
iree_linalg_ext.yield %arg4 : f32 | |
} -> tensor<1x32x128x512xf32> | |
return %1 : tensor<1x32x128x512xf32> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment