-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix calculate_macs() for Linear layers. (#318)
* Fix calculate_macs() for Linear layers. Fix MACs in lst.out and lstm_half.out. * Add test for torch.nn.Linear. * Change groud-truth Total mult-adds in flan_t5_small.out. MACs increased from 280.27M to 18.25G because of the Linear layer fix. --------- Co-authored-by: Andrew Lavin <[email protected]>
- Loading branch information
1 parent
29166cc
commit 38ab72b
Showing
6 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
======================================================================================================================== | ||
Layer (type:depth-idx) Input Shape Output Shape Param # Mult-Adds | ||
======================================================================================================================== | ||
Linear [32, 16, 8] [32, 16, 64] 576 294,912 | ||
======================================================================================================================== | ||
Total params: 576 | ||
Trainable params: 576 | ||
Non-trainable params: 0 | ||
Total mult-adds (M): 0.29 | ||
======================================================================================================================== | ||
Input size (MB): 0.02 | ||
Forward/backward pass size (MB): 0.26 | ||
Params size (MB): 0.00 | ||
Estimated Total Size (MB): 0.28 | ||
======================================================================================================================== |
This file contains 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
This file contains 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
This file contains 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
This file contains 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