-
Notifications
You must be signed in to change notification settings - Fork 124
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
API: summary mode=None
keeps current mode (#331)
#337
Conversation
Are there other modes besides train and eval? I'm wondering why we are deleting the enum - we should probably keep that around. |
To my knownledge, no.
Well, I feel like with the new behaviour, it does not make sense to create this class which would only be used exacly once. I think it brings more confusion than clarity or simplicity (as can probably be seen by the fact that PR removes ~15 lines of code). |
torchinfo is typed, so I prefer passing enum values over strings when possible. To most callers, it makes no difference, but I think it makes the internals easier to maintain in the long term, since it clearly states what string values are allowed from the API spec. Could you also update the README with this typing change as well? Thanks! |
I followed your preference and implemented the change using If this is an issue, feel free to build on this PR! Also, I couldn't run pre-commit because of my proxy issue, so I commited with All the best. Note: I noticed that the |
up |
Thanks for the bump. I think None is preferable over "same", but I can update that in a followup. Aiming for a version release at the start of 2025 where this will be included. |
Closes #331.
Changes the behaviour of
mode=None
insummary
.Before: used global default
Mode.EVAL
Now: keeps current model mode.
Note that this changes the default behaviour.
I couldn't pass
tests/torchinfo_xl_test.py::test_flan_t5_small
because my proxy didn't allow model downloading. Also, I didn't test on GPU so GPU tests were not ran.Side questions: While running the tests, I noticed that depending on the mode (
"train"
or"eval"
), the summary would sometimes show or not show the top level number of parameters:Is there a specific reason to this behaviour?
Furthermore, in this case, the top level shows 6.4M params, while the total count shows 13M params and Google claims around 6.xM params. Any lead to understand this?
Thanks!