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

Fail to obtain the reported MACs for performer-based models. #47

Open
blackfeather-wang opened this issue Apr 28, 2021 · 5 comments
Open

Comments

@blackfeather-wang
Copy link

blackfeather-wang commented Apr 28, 2021

Hi,

Thank you for this repo! It is really helpful. However, we fail to obtain the reported MACs for performer-based models (T2T-ViT-7/10/12). Importantly, we found a strange phenomenon.

Both the paper and the code indicate that T2T-ViT-7/10/12 have the same architectures for the T2T module and transformer layers, and differ from each other only on the number of transformer layers. From the reported MACs (shown below), one can observe that the MACs for a single transformer layer is (1.8 - 1.2) / 3 = (2.2 - 1.8) / 2 = 0.2G. As a consequence, for the T2T-ViT-7, we have 1.2 - 0.2*7 < 0, which indicates that the T2T module has negative MACs! Would you please to tell us if we miscalculate something?

image

@yuanli2333
Copy link
Collaborator

Hi, thanks for notice.

For the three lite variants of T2T-ViT, each layer of Transformer layer is 0.125G MACs.
image

The MACs of T2T-ViT-7 is 0.125*7+0.7, here 0.7 is for T2T module. So The MACs of T2T-ViT-7, T2T-ViT-10, T2T-ViT-12 are 1.57G, 1.9G and 2.2G, we will update the results in repo.

@blackfeather-wang
Copy link
Author

Thank you for your reply.

How are the MACs of the T2T modules obtained? In fact, we have tried to calculate the MACs following the code, but we got much smaller MACs (i.e., ~0.25G).

@Annbless
Copy link

Hi.
I got a similar 0.25G MACs for the T2T modules. I tried to calculate the MACs following the code and the repo as you suggested in another issue for exp, sum, and divide operations' MACs calculation. Can you give some hints? Thanks in advance.

@yuanli2333
Copy link
Collaborator

Hi,

We double checked the MACs of T2T module, and it should be ~0.25G, and we have updated the repo and will update the paper soon.

@ghjeong12
Copy link

Hi @yuanli2333, thanks for the great work. May I ask you to share the actual script that you used to calculate T2T and the original ViT as well? It would be very helpful if you do so .. I have found different papers report different MAC numbers for the original ViT as well.

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

4 participants