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

About MM size in paper and demo #28

Closed
sato-imo opened this issue Nov 17, 2023 · 1 comment
Closed

About MM size in paper and demo #28

sato-imo opened this issue Nov 17, 2023 · 1 comment
Labels
question Further information is requested

Comments

@sato-imo
Copy link

Could you please describe what is your input size of the original model, especially for ViT and BERT.
And how do you organize the matrices to form the MxK and KxN matrices as shown in Table 5.
image

@JinmingZhuang
Copy link
Collaborator

  • For BERT, we set batch_size = 6, Seqence_len = 512, Embed_dim = 1024, Heads=16, MLP_ratio=4

  • For ViT, we set batch_size = 48, Seqence_len = 64, Embed_dim = 1024, Heads=16, MLP_ratio=4

  1. For QKV and Projection layer M = (batch_size * Seqence_len), N = Embed_dim, K = Embed_dim.
  2. For MLP layers, N or K should further multiply with "MLP_ratio".
  3. For batch dot or multi-head attention, M = Seqence_len, N (K) = Embed_dim//Heads, K (N) = Seqence_len; batch dot size = batch_size *Heads.

Hope this will help!

@peipeizhou-eecs peipeizhou-eecs added the question Further information is requested label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants