Comments (5)
Sorry for the possible confusion. I see two reasons to resume the pre-training process.
- You have a time limit for your experiment and you can't fit the entire pre-training into the time limit and need to split it into > 1 jobs. Then resuming the pre-training is just as easy as doing
accelerator.load_state
which loads LR scheduler and all the states correctly and resumes the pre-training until it finished after 2^16 steps. - You have finished pre-training for the desired number of steps (2^16), but then you want to try to actually take the checkpoint after 2^16 steps and continue pre-training it for the next 2^16 steps. To do so you need to update the LR scheduler with the new desired number of steps (2^17) so that you properly decay your LR during the second half of your training.
Good luck and ask if you have any further questions
from nanot5.
@QizhiPei Hi. See my notebook for more details. Yes, you can resume training https://github.com/iSevenDays/nanoT5/blob/main/nanoT5/train.ipynb
from nanot5.
@QizhiPei Hi. See my notebook for more details. Yes, you can resume training https://github.com/iSevenDays/nanoT5/blob/main/nanoT5/train.ipynb
Thanks for your kindly help!
from nanot5.
Sorry for the late reply!
@QizhiPei I'm using HF Accelerator to save the state Code Pointer. It should be quite easy to load the state to resume the pre-training process, you can check out HF tutorial here. It should be basically a one-liner like: accelerator.load_state(path_to_checkpoint)
in the main.py before the train
call.
Continuing pre-training (besides 2**16 steps set by default) is slightly more complex because you'd need to adjust the LR scheduler appropriately.
Let me know if it works!
from nanot5.
Sorry for the late reply!
@QizhiPei I'm using HF Accelerator to save the state Code Pointer. It should be quite easy to load the state to resume the pre-training process, you can check out HF tutorial here. It should be basically a one-liner like:
accelerator.load_state(path_to_checkpoint)
in the main.py before thetrain
call.Continuing pre-training (besides 2**16 steps set by default) is slightly more complex because you'd need to adjust the LR scheduler appropriately.
Let me know if it works!
Thanks for you suggestions!
I successfully load the saved checkpoints. However, it seems that the accelerator.load_state
will also load the scheduler state. Could you kindly explain the detailed meaning of "adjust the LR scheduler appropriately" ?
Thanks again!
from nanot5.
Related Issues (20)
- RMS scaling issues HOT 15
- pre-train on long context. HOT 1
- How to run on CPU HOT 1
- Difficulty applying NanoT5 to different model and database HOT 2
- AttributeError: Can't pickle local object 'IterableDataset.map.<locals>.<lambda>' HOT 1
- About pre-training on another dataset HOT 7
- Pre-training fails at step 30155 out of 32768 steps every time HOT 7
- self-defined loss function failed to work (torch._dynamo.exc.InternalTorchDynamoError: ln_encoder) HOT 4
- nanoT5 initializes lm_head weights with 768x too much variance, probably HOT 19
- Transformation to HF model
- Pre-train on different Dataset than C4 HOT 1
- Flash attention HOT 2
- Larger models and training on the Pile HOT 5
- How to create pytorch_model.bin file? HOT 1
- Silly question: Why do you need to re-implement T5 model? HOT 3
- Question about implementing whole word masking in nanoT5 HOT 1
- Beginner Question : Would it be wise to use this as a backbone for custom seq2seq modeling fMRI data and custom encoder? HOT 2
- Learning rate for multi-GPUs training HOT 3
- Just a quick question to pretrain Flan-T5 HOT 5
- Continued pretraining from official models. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nanot5.