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

flops的计算问题 #14

Open
223hzz opened this issue Oct 16, 2024 · 1 comment
Open

flops的计算问题 #14

223hzz opened this issue Oct 16, 2024 · 1 comment

Comments

@223hzz
Copy link

223hzz commented Oct 16, 2024

Hi author, I really like your code, recently I was using it and I realized that the fvcore function is not provided in your code when calculating flops, e.g. : DilateAttention class “q @ k” or “attn @ v “ for multiplication or “nn.unflod” for flops.
” k = self.unfold(k)
attn = (q @ k) * self.scale # B,h,N,1,kk
v = self.unfold(v) # B,h,N,k
k,d
x = (attn @ v)“

attn = (q @ k.transpose(-2, -1))
x = (attn @ v).transpose(1, 2)

So are the flops calculated this way accurate?
捕获
捕获

@JIAOJIAYUASD
Copy link
Owner

Hello, thank you for your interest in my code. I haven't updated this code repository for a long time.

In fact, during the design process of the model, I did not pay attention to how fvcore calculated the parameters and flops of the model. I followed other people's code. UniFormer.

nn.fold does not produce calculations or parameters, but only increases memory latency.

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