Skip to content

[Transforms] Add constant_tensors_folding pass #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3d3308c
move codes from dnn-compiler
niuxiaog May 15, 2024
4f112c0
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog May 15, 2024
d50a3e8
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog May 27, 2024
6219935
Add single operand check
niuxiaog May 27, 2024
5eb0ac0
Add cache manager
niuxiaog May 27, 2024
c3e186d
Use llvm global [need to cowork with yijie/mainfunc_wrapper]
niuxiaog May 28, 2024
8c50b67
Rename; Add llvm dependence
niuxiaog May 28, 2024
25f611e
Change dtype
niuxiaog May 28, 2024
4363915
Fix visibility and type
niuxiaog May 29, 2024
94f2813
Support cpmplex topo
niuxiaog May 30, 2024
0f67f75
Rename
niuxiaog Jun 3, 2024
d7663a5
Split into short functions
niuxiaog Jun 4, 2024
3f34e97
Add a test
niuxiaog Jun 5, 2024
22c3d76
Adapt to constant PropertyType
niuxiaog Jun 11, 2024
5c92931
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog Jul 24, 2024
9218762
Revert "Adapt to constant PropertyType"
niuxiaog Jul 24, 2024
4e447dd
Fix link
niuxiaog Jul 24, 2024
d4d81a6
Fold arith.constant
niuxiaog Jul 25, 2024
afec52a
Add compile_time_fold and runtime_fold.
niuxiaog Jul 25, 2024
9c4fd70
Fix license and tidy
niuxiaog Jul 26, 2024
fad5f92
Fix link
niuxiaog Jul 26, 2024
57f887d
Only enable runtime folding
niuxiaog Jul 29, 2024
1fc3b9f
Rename and polish
niuxiaog Jul 29, 2024
aaa4ed4
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog Jul 31, 2024
bfc12c7
Add accuracy tests on mlp
niuxiaog Aug 7, 2024
346965f
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog Aug 7, 2024
75fcaed
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog Aug 19, 2024
f9c2425
Support MemRef args
niuxiaog Aug 20, 2024
d8d2d79
Add to pipeline
niuxiaog Aug 20, 2024
fc739e5
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog Aug 26, 2024
22c4474
Forbid buffer_to_tensor case
niuxiaog Aug 26, 2024
968677d
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog Sep 2, 2024
1473a88
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog Sep 5, 2024
e20d059
Add shape info to global
niuxiaog Sep 6, 2024
ad24768
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog Sep 14, 2024
edbb708
Clean tests.
niuxiaog Sep 14, 2024
fa30e4a
Updates
niuxiaog Sep 14, 2024
a255c7b
Merge branch 'main' into xgniu/constant_weights_folding
niuxiaog Sep 18, 2024
77e0f02
Merge into one pass
niuxiaog Sep 18, 2024
2df16c2
Skip case
niuxiaog Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Skip case
  • Loading branch information
niuxiaog committed Sep 18, 2024
commit 2df16c29b8dbadb4b31d812475599d166872b51e
3 changes: 3 additions & 0 deletions lib/gc/Transforms/ConstantTensorFolding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ void getArithConstantOutputs(Block &block, SmallVector<Type> &outputTypes,
[](Operation *child) {
return !isInConstantSubgraph(child);
})) {
if (valuesOnTheWay.size() == 1) {
continue;
}
if (std::find(outputValues.begin(), outputValues.end(), v) ==
outputValues.end()) {
outputTypes.push_back(v.getType());
Expand Down