TylerYep / torchinfo

View model summaries in PyTorch!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Percentage FLOPS or Multiply Adds - inspired by #199

mert-kurttutan opened this issue · comments

Option for column representing Percentage FLOPS or Multiply Adds. (similar to #199)

I think this option would be really useful to see which part of model should be optimized if necessary. It also useful to have an idea about the scaling of the model as make your model bigger and bigger.

At first sight, it seems that this could be implemented in a way similar to that of #199.

If this seems reasonable enough, I can come up with PR.

This seems like a good idea, PRs appreciated :)

I would prefer some cleaner way of providing the percentage form of all of these measurements though. If we keep going we'll have 2x the options for all columns (num_params, percent_params), (num_macs, percent_macs), etc.

But if we can't think of anything better, adding a few extra params would be fine.

I agree that there should be prettier API to deal with these.
I think there are several ways to do it:

  1. As you suggested, just add new settings params for each option
  2. (Maybe more uniform) Add percentage settings for all params that return percentage for all of them
  3. Use option 2) and add other options for individual percentage settings. For instance, say I only want percentage for all info except for Multiply Add. I would turn on all_percentage settings and turn off percentage for Multiply Add, which will overwrite the setting by all_precentage

Just brainstorming, some of them may seem unnecessarily complex:)
After having more clear idea about this API, I can start with some PR.

Sorry, maybe it was not clear. Do you any feedback on the list of formats I suggested? I will move on based on a particular choice of format.

I guess 1) is okay for now. From the options, I think anything else will make the API more confusing