To set up the environment for this project, follow these steps:
-
Clone the repository:
git clone https://github.com/xie-lab-ml/Principal-Spectral-Regularization-For-LLM-Training.git cd Principal-Spectral-Regularization-For-LLM-Training -
Create a virtual environment with Conda:
conda create -n llm-psr python=3.10 conda activate llm-psr
-
Install dependencies:
pip install -r requirements.txt
To download the processed 100k-doc training sample dataset, run the following command:
# Download llama model data
wget https://bj.bcebos.com/paddlenlp/models/transformers/llama/data/llama_openwebtext_100k.bin
wget https://bj.bcebos.com/paddlenlp/models/transformers/llama/data/llama_openwebtext_100k.idxTo run the default pretraining experiment on LLaMA models, run the following command to invoke the script:
python -u -m paddle.distributed.launch --gpus 0,1,2,3,4,5,6,7 run_pretrain.py config/llama/pretrain_argument.json