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

TF 2.x Feature: Flops calculation #552

Closed
mohantym opened this issue Jun 20, 2022 · 7 comments
Closed

TF 2.x Feature: Flops calculation #552

mohantym opened this issue Jun 20, 2022 · 7 comments
Assignees

Comments

@mohantym
Copy link
Contributor

If you open a GitHub issue, here is our policy:
It must be a bug, a feature request, or a significant problem with the documentation (for small docs fixes please send a PR instead).
The form below must be filled out.

Here's why we have that policy:.

Keras developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.

System information.

TensorFlow version (you are using):
2.8
Are you willing to contribute it (Yes/No) :
No

Describe the feature and the current behavior/state.
Transferring the issue #32809 from TF Core repo to here as @bhack suggested. Currently we don't have a dedicated api to calculate flops of models or functions. It would be great to have a dedicated api to calculate flops.

Describe the feature clearly here. Be sure to convey here why the requested feature is needed. Any brief description about the use-case would help.
Earlier tf.compat.v1.profiler.profile was being used in 1.x version to calculate flops from graphs of model files. But this approach is not working accurately for 2.x code base . A 2.x api for flops calculation will be very useful for community.

Will this change the current api? How?
No

Who will benefit from this feature?
It will largely benefit those who are looking to calculate floating point operations for their models and methods.

Contributing

  • Do you want to contribute a PR? (yes/no):
  • If yes, please read this page for instructions
  • Briefly describe your candidate solution(if contributing):
@chenmoneygithub
Copy link
Contributor

There seems to be a new API tf.profiler.experimental.Profile, would this work for you?

@mohantym
Copy link
Contributor Author

Hi @chenmoneygithub !
It would be great if you also share an implementation of the above for calculation of flops.
Thank you!

@chenmoneygithub
Copy link
Contributor

@mohantym Hi! I will need to follow up the specific team to find more details. To make clear, are you looking for how to calculate flops using [tf.profiler.experimental.Profile](https://www.tensorflow.org/api_docs/python/tf/profiler/experimental/Profile),, or the specific code in tf.profiler.experimental.Profile doing flops computation?

@mohantym
Copy link
Contributor Author

mohantym commented Jul 12, 2022

@chenmoneygithub !
Apology for the late reply. Yes! I am looking for a Colab gist to calculate flops of model/functions with reference to #32809. Could you please point towards one.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@sidml
Copy link

sidml commented Sep 12, 2022

@mohantym
Did you find a solution ?

@mohantym
Copy link
Contributor Author

@sidml !
I have not found any solution yet from my side yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants