Last active
July 3, 2022 01:25
-
-
Save jackalcooper/17b28acf15c2cedfa0bb3fd905e954d0 to your computer and use it in GitHub Desktop.
Revisions
-
jackalcooper revised this gist
Jul 3, 2022 . No changes.There are no files selected for viewing
-
jackalcooper revised this gist
Jul 3, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -18,6 +18,7 @@ pattern replace_multi_add_op( # but I am wondering how to not use the :bound here? # there should be a more elegant way to prevent generating IR for this unbound variable # I have tried to use ^res but it is not working # Also any advice on the general pattern expression (especially regarding nesting) is appreciated. ], results: [res1] } -
jackalcooper revised this gist
Jul 3, 2022 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # I’m working on compiling Elixir pattern to MLIR (the PDL dialect), # so that it could be used to manipulate another piece of IR. # If we want to rewrite res = TOSA.add(a, b) >>> Type.ranked_tensor([2, 3], Type.f32()) @@ -14,7 +14,8 @@ pattern replace_multi_add_op( operands: [ {:bound, res}, {:bound, b} # the code is working now (including the codegen and IR manipulation), # but I am wondering how to not use the :bound here? # there should be a more elegant way to prevent generating IR for this unbound variable # I have tried to use ^res but it is not working ], -
jackalcooper revised this gist
Jul 3, 2022 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,20 @@ # I’m working on compiling Elixir pattern to MLIR (the PDL dialect). # So that it could be used to manipulate another piece of IR. # If we want to rewrite res = TOSA.add(a, b) >>> Type.ranked_tensor([2, 3], Type.f32()) res1 = TOSA.add(res, b) >>> Type.ranked_tensor([2, 3], Type.f32()) # to res1 = TOSA.sub(res, b) >>> Type.ranked_tensor([2, 3], Type.f32()) # We can declare a pattern like this pattern replace_multi_add_op( %TOSA.Add{operands: [a, b], results: [res]}, _t = %TOSA.Add{ operands: [ {:bound, res}, {:bound, b} # the code is working now (including the codegen and IR manipulation), but I am wondering how to not use the :bound here? # there should be a more elegant way to prevent generating IR for this unbound variable # I have tried to use ^res but it is not working ], -
jackalcooper revised this gist
Jul 3, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # I’m working on compiling Elixir pattern to MLIR (the PDL dialect) so that it could be used to manipulate another piece of IR. res = TOSA.add(a, b) >>> Type.ranked_tensor([2, 3], Type.f32()) res1 = TOSA.add(res, b) >>> Type.ranked_tensor([2, 3], Type.f32()) # will be rewrite to -
jackalcooper revised this gist
Jul 3, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ pattern replace_multi_add_op( operands: [ {:bound, res}, {:bound, b} # the code is working now, but I am wondering how to not use the :bound here? # there should be a more elegant way to prevent generating IR for this unbound variable # I have tried to use ^res but it is not working ], -
jackalcooper created this gist
Jul 3, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ res = TOSA.add(a, b) >>> Type.ranked_tensor([2, 3], Type.f32()) res1 = TOSA.add(res, b) >>> Type.ranked_tensor([2, 3], Type.f32()) # will be rewrite to res1 = TOSA.sub(res, b) >>> Type.ranked_tensor([2, 3], Type.f32()) pattern replace_multi_add_op( %TOSA.Add{operands: [a, b], results: [res]}, _t = %TOSA.Add{ operands: [ {:bound, res}, {:bound, b} # the code is working now, but I am wondering how to not using the :bound here? # there should be a more elegant way to prevent generating IR for this unbound variable # I have tried to use ^res but it is not working ], results: [res1] } ) do %TOSA.Sub{operands: [a, b]} end