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

how do you calculate the gflops ? #6

Closed
victorygogogo opened this issue Sep 29, 2017 · 1 comment
Closed

how do you calculate the gflops ? #6

victorygogogo opened this issue Sep 29, 2017 · 1 comment

Comments

@victorygogogo
Copy link

how do you calculate the gflops ?

for example , you have 2 matrix A and B ,A.shape is 3X4 B.shape is 4X3, so the result is 3X3 ,the cost time is about 0.001ms, flops = 3X4x2/0.0001ms ?

@jianyuh
Copy link
Collaborator

jianyuh commented Oct 2, 2017

If the matrix sizes of A, B, C are mxk, kxn, mxn, separately, for matrix multiplication, then the GFLOPS = 2 x m x k x n / time * 10^(-9) (the total number of floating point operations divided by the running time in seconds, and G means Giga, or 10 ^ 9).
In your case, gflops = 2 x 3 x 4 x 3 / (0.001 * 10^(-3)) * 10(-9) = 0.072 (here 10 ^(-3) is translating ms to s)

@jianyuh jianyuh closed this as completed Oct 5, 2017
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

2 participants