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

Error in FLOPS Calculation #1093

Closed
passaglia opened this issue Dec 6, 2023 · 0 comments · Fixed by #1094
Closed

Error in FLOPS Calculation #1093

passaglia opened this issue Dec 6, 2023 · 0 comments · Fixed by #1094
Labels
bug Something isn't working

Comments

@passaglia
Copy link

passaglia commented Dec 6, 2023

There's a bug in the GPT-NeoX flops calculation here:

flops_calc2 = vocab_size / (16.0 * num_layers * hidden_size)

The term proportional to the vocab_size, flops_calc2 , should share all the same prefactors as flops_calc_1. See page 12 of 2104.04473

Since this term scales inversely with both hidden_dim and num_layers, it is more significant for small models and less important for large models: for Pythia-70m the error is roughly 50257/(16 \times 6 \times 512) = 102% while for GPT-NeoX-20B it is only 50257/(16 \times 44 \times 6144) = 1.2%.

This bug seems to have been introduced only ~3 months ago in #1044 so it may not have had an impact on, e.g., any tests done while training Pythia.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant