Skip to content
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

[circle2circle] Dredd test for fuse Add/Mul to FC and fold Mul #13444

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions compiler/circle2circle-dredd-recipe-test/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Add(MaxPoolWithArgmax_000 PASS resolve_customop_max_pool_with_argmax)
Add(MaxPoolWithArgmax_001 PASS resolve_customop_max_pool_with_argmax)
Add(MaxPoolWithArgmax_002 PASS resolve_customop_max_pool_with_argmax)
Add(Net_Add_FloorMod_Gather_000 PASS remove_gather_guard)
Add(Net_Add_FullyConnected_000 PASS fuse_add_to_fullyconnected_bias)
Add(Net_Add_FullyConnected_001 PASS fuse_add_to_fullyconnected_bias)
Add(Net_Add_FullyConnected_002 PASS fuse_add_to_fullyconnected_bias)
Add(Net_BroadcastTo_AddV2_000 PASS resolve_customop_add)
Add(Net_BroadcastTo_AddV2_001 PASS resolve_customop_add)
Add(Net_BroadcastTo_AddV2_002 PASS resolve_customop_add)
Expand Down Expand Up @@ -61,6 +64,9 @@ Add(Net_Mul_Add_002 PASS remove_unnecessary_add)
Add(Net_Mul_Add_003 PASS remove_unnecessary_add)
Add(Net_Mul_Div_000 PASS fuse_mul_with_div)
Add(Net_Mul_Div_001 PASS fuse_mul_with_div)
Add(Net_Mul_FullyConnected_000 PASS fuse_mul_to_fullyconnected_weights fold_mul)
Add(Net_Mul_FullyConnected_001 PASS fuse_mul_to_fullyconnected_weights fold_mul)
Add(Net_Mul_FullyConnected_002 PASS fuse_mul_to_fullyconnected_weights fold_mul)
Comment on lines +67 to +69
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused parameters..!?

Suggested change
Add(Net_Mul_FullyConnected_000 PASS fuse_mul_to_fullyconnected_weights fold_mul)
Add(Net_Mul_FullyConnected_001 PASS fuse_mul_to_fullyconnected_weights fold_mul)
Add(Net_Mul_FullyConnected_002 PASS fuse_mul_to_fullyconnected_weights fold_mul)
Add(Net_Mul_FullyConnected_000 PASS fuse_mul_to_fullyconnected_weights)
Add(Net_Mul_FullyConnected_001 PASS fuse_mul_to_fullyconnected_weights)
Add(Net_Mul_FullyConnected_002 PASS fuse_mul_to_fullyconnected_weights)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fold_mul is an option needed to constant fold Mul op,

  • this model has FC(Mul(input,scale), weights, bias).
  • fuse_mul_to_fullyconnected_weights will convert to FC(input, Mul(weights, scale), bias)
  • dredd test cannot detect the difference as there exist same number of FC and Mul
  • fold_mul will convert to FC(input, weights', bias) and we can detect absence of Mul

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand.
Thank you for the description =)

Add(Net_Preactivation_BN_000 PASS fuse_preactivation_batchnorm)
Add(Net_Reshape_Reshape_000 PASS remove_redundant_reshape)
Add(Net_Shape_Add_000 PASS fold_shape)
Expand Down
Loading