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

Add optimal model size and stopping time feature #4847

Closed
TevenLeScao opened this issue Jun 8, 2020 · 14 comments
Closed

Add optimal model size and stopping time feature #4847

TevenLeScao opened this issue Jun 8, 2020 · 14 comments
Assignees
Labels
Discussion Discussion on a topic (keep it focused or open a new issue though) Ex: LM (Pretraining) Related to language modeling pre-training High-Level feature wontfix

Comments

@TevenLeScao
Copy link
Contributor

🚀 Feature request

The calculator blog post presented an automated way to find scaling laws with model size and compute budget on language modeling tasks. Adding it to the library would help save on training costs by picking an optimal model size and training time.

Motivation

Estimating how big of a model to use and how long to train for is more of an art than a science. An automated tool to perform that task would allow researchers and practitioners to concentrate on the the high-level parts of their projects as opposed to parameter tweaking.

Your contribution

I can submit a PR with my existing work, probably integrating it within Trainer and/or knocknock.

@TevenLeScao TevenLeScao added Discussion Discussion on a topic (keep it focused or open a new issue though) High-Level feature Ex: LM (Pretraining) Related to language modeling pre-training labels Jun 8, 2020
@TevenLeScao TevenLeScao self-assigned this Jun 8, 2020
@lopuhin
Copy link

lopuhin commented Jun 8, 2020

Great stuff, thank you! The energy estimates look 1000 worse than reality though, V100 running for 12 h should not consume 5432 kWh I think, else we'd be all dead. 5.4 kWh looks more reasonable.

Screenshot 2020-06-09 at 00 26 45

@TevenLeScao
Copy link
Contributor Author

TevenLeScao commented Jun 8, 2020

Great stuff, thank you! The energy estimates look 1000 worse than reality though, V100 running for 12 h should not consume 5432 kWh I think, else we'd be all dead. 5.4 kWh looks more reasonable.

Screenshot 2020-06-09 at 00 26 45

Ah yes - I remembered having a doubt on that, I checked again the library we used to estimate those and there might have been a unit conversion error, I'll fix that ASAP tomorrow!

Edit: it's fixed, thank you @lopuhin !

@BramVanroy
Copy link
Collaborator

BramVanroy commented Jun 9, 2020

This is already looking very promising! Good stuff.

When clicking the "initialize in transformers" button, the code block should probably not center-align the code, but left align instead. That makes the code a lot more readable.

@TevenLeScao
Copy link
Contributor Author

This is already looking very promising! Good stuff.

When clicking the "initialize in transformers" button, the code block should probably not center-align the code, but left align instead. That makes the code a lot more readable.

Yeah that was a bit of an aesthetic choice to not break the flow of the web page, it definitely wouldn't be like this in a tool rather than a demo!

@stale
Copy link

stale bot commented Aug 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 9, 2020
@stale stale bot closed this as completed Aug 16, 2020
@julien-c
Copy link
Member

unstale, what's the status on this @TevenLeScao? Should we close?

@julien-c julien-c reopened this Aug 17, 2020
@stale stale bot removed the wontfix label Aug 17, 2020
@TevenLeScao
Copy link
Contributor Author

@julien-c we had originally decided not to go forward with this, but I started working on it amongst the discussions about the scale of GPT-3. I didn't get to finish it before leaving for holidays two weeks ago, but the PR will be ready this week.

@stale
Copy link

stale bot commented Oct 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 24, 2020
@stale stale bot closed this as completed Nov 1, 2020
@moinnadeem
Copy link

Hi! The "initialize in Huggingface" button is broken -- is there something I can do locally to solve it? I just wanted the lines of training code for a given wall-clock time.

@TevenLeScao
Copy link
Contributor Author

Hey! The page seems broken, not sure why, I'll relaunch it

@moinnadeem
Copy link

@TevenLeScao Thanks for the immediate reply! The button to launch in Huggingface Transformers still isn't working, but I'm happy to help debug / send any reports if it helps! Alternatively, do you think you could help me understand what the button does? i'm just hoping to generate the configuration string n_layers=N_LAYERS,n_ctx=N_CTX, with the variables filled in by the calculator.

Thanks for your time!

@TevenLeScao
Copy link
Contributor Author

I've relaunched, it should work now (just gotta figure why the page doesn't center on my desktop).

@moinnadeem
Copy link

@TevenLeScao Yes, it works -- thanks!

Out of curiosity, why did you use Transformer-XL as opposed to something like GPT-2? Does Transformer-XL reach a lower validation loss on Wikitext-103 as opposed to GPT-2 when training for the same number of steps?

@TevenLeScao
Copy link
Contributor Author

Yeah, it was the state-of-the-art at the time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Discussion on a topic (keep it focused or open a new issue though) Ex: LM (Pretraining) Related to language modeling pre-training High-Level feature wontfix
Projects
None yet
Development

No branches or pull requests

5 participants