Can I pretrain LLaMA from scratch?

I have a small ‘Llama’ model (~1M parameters) by changing the config and trying to train it with my data. However, the model performs terribly on a small dataset(cannot overfit), and I don’t know why. Here is the link to my problem: Failed to train Llama model
If possible, can I have a small demo code on how to train it?