Add promoted const_args to --fold-constant PASS#157
Add promoted const_args to --fold-constant PASS#157YanzhouTang merged 5 commits intocoredac:mainfrom
Conversation
What is the original #ops and II? |
Original ops are 33, and original II = 7 |
lib/NeuraDialect/Transforms/Optimizations/HwAgnosticOpt/FoldConstantPass.cpp
Outdated
Show resolved
Hide resolved
lib/NeuraDialect/Transforms/Optimizations/HwAgnosticOpt/FoldConstantPass.cpp
Outdated
Show resolved
Hide resolved
lib/NeuraDialect/Transforms/Optimizations/HwAgnosticOpt/FoldConstantPass.cpp
Outdated
Show resolved
Hide resolved
lib/NeuraDialect/Transforms/Optimizations/HwAgnosticOpt/FoldConstantPass.cpp
Outdated
Show resolved
Hide resolved
Cool, then next step is https://github.com/coredac/dataflow/blob/main/test/neura/for_loop/relu_test.mlir, IIRC, its II is 11, let's see whether ur optimization can help it, plz try before and after ur optimization on this test, and include After above done, let's move to your complex kernel. |
|
@YanzhouTang any blocker~? |
Sorry I'm busy with some school matters ddl yesterday. 😭 I've updated a version that rename the lhs_value and rhs_value, as well as test.mlir. I'll go on relu kernel optimization today. |
lib/NeuraDialect/Transforms/Optimizations/HwAgnosticOpt/FoldConstantPass.cpp
Outdated
Show resolved
Hide resolved
lib/NeuraDialect/Transforms/Optimizations/HwAgnosticOpt/FoldConstantPass.cpp
Outdated
Show resolved
Hide resolved
1f8c3ce to
d0656b1
Compare
|
Why the Github Action stops... Any idea? |
I found some testcases failed due to renaming in my local version. I'm fixing these cases one by one and I'll make a new commit after all tetscase clean |
d0656b1 to
d81a235
Compare
As we discussed in Issue #152 , after args being promoted to constant, they are not folded in the next
--fold-constantPASS.This PR add this feature based on simple_loop case.
neura.gep: its left operand represents base_pointer, we fold this operand if it is a constant.neura.store: its right operand represents destination address, we fold this operand if it is a constant.After leveraging
--promote-func-arg-to-constand--fold-constant, the final operations are reduced to 20, and II = 5 (equals to RecII = 5)