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

Calculation Procedure for GMACS #147

Closed
krkrkrrk opened this issue Jan 7, 2025 · 3 comments
Closed

Calculation Procedure for GMACS #147

krkrkrrk opened this issue Jan 7, 2025 · 3 comments

Comments

@krkrkrrk
Copy link

krkrkrrk commented Jan 7, 2025

Hello

In #75, you stated, “We manually added a flops method to calculate FLOPs for each block in our network in a top-down manner.” Could you please explain the specific calculation procedure for GMACS?

@tzzcl
Copy link
Collaborator

tzzcl commented Jan 9, 2025

For the specific code, we manually calculate the forward FLOPs of each module and accumulate into the final FLOPs.

@krkrkrrk
Copy link
Author

Let me confirm again as I haven't fully understood. Did you calculate everything manually without using any programs? Or did you calculate most of it using a program and only calculate certain modules manually? If you used any program, could you share it with me?

@happyharrycn
Copy link
Owner

Our implementation is similar to most FLOPS/GMACS counters (e.g., here and the PyTorch version). It enumerates all modules within a given model and calculates the theoretical FLOPS/GMACS for each module based on factors such as input size and the number of parameters. For reference, we refer to the aforementioned code.

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

No branches or pull requests

3 participants