You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the scripts in the examples/ folder of Accelerate or an officially supported no_trainer script in the examples folder of the transformers repo (such as run_no_trainer_glue.py)
My own task or dataset (give details below)
Reproduction
Simple enough, training a LLM with multinode setup using deepspeed and accelerate.
This is my deepspeed config file config (Using Zero3 optimization).
I am saving the model checkpoints on a central storage (NAS) and no FDSP.
My question is: When saving the model checkpoint, there is a default model.safetensors file. Is this the final model after the weights have been gathered from each node?
Usually I would just run zero_to_fp32.py file to create the final model but I want to know what exactly is the safetensors file created by default when saving the model.
Found out it was the final model. Probably accelerate creates the final model when saving the checkpoint as well.
What i did (maybe helpful for someone else):
Create a pytorch_model.bin using zero_to_fp32.py (did not use safetensor flag because I have tied weights of embedding and lm head which causes error when running with safetensor flag)
Load model using pytorch_model.bin and save model as model.safetensor
Compare the weights and keys using torch.allclose()
Only problem is that the weights change slightly at the floating point decimals 0.0001-0.0003 diff. I still dont know how much it will effect model performance but well, i can just use model.safetensor directly now.
System Info
Information
Tasks
no_trainer
script in theexamples
folder of thetransformers
repo (such asrun_no_trainer_glue.py
)Reproduction
Simple enough, training a LLM with multinode setup using deepspeed and accelerate.
This is my deepspeed config file config (Using Zero3 optimization).
I am saving the model checkpoints on a central storage (NAS) and no FDSP.
My question is:
When saving the model checkpoint, there is a default model.safetensors file. Is this the final model after the weights have been gathered from each node?
Usually I would just run zero_to_fp32.py file to create the final model but I want to know what exactly is the safetensors file created by default when saving the model.
Expected behavior
No model.safetensor file.
The text was updated successfully, but these errors were encountered: