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 the calculation of overhead. #19

Open
znsoftm opened this issue Jul 10, 2023 · 4 comments
Open

About the calculation of overhead. #19

znsoftm opened this issue Jul 10, 2023 · 4 comments

Comments

@znsoftm
Copy link

znsoftm commented Jul 10, 2023

ggerganov/ggml#356

@znsoftm
Copy link
Author

znsoftm commented Jul 10, 2023

or BERT mode, its overhead is calculated as :

model_mem_req += (5 + 16 * n_layer) * 256; // object overhead

Can anyone explain the meaning 5 is extra tensors, 16 means each layer has 16 tensor, and 256 for what?

Is it the sizeof ggml_tensor struct ? The actual size is 208 bytes, so 256 is rounded size?

@skeskinen
Copy link
Owner

My memory is a little hazy on this subject.
Like you said 5 should be the extra model wise tensors not tied to any layer. I think I tried smaller number than 256 for the size but it crashed with OOM.
Probably the real size of C structs is always rounded up to the next power of 2?

@znsoftm
Copy link
Author

znsoftm commented Jul 10, 2023

thanks for your answer:)

@znsoftm
Copy link
Author

znsoftm commented Jul 11, 2023

I have tested the latest ggml, should alter the 256 to 512. Do not understand why:(

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