-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
```bash | ||
python analyze.py --factor_batch_size 32 \ | ||
--train_batch_size 64 \ | ||
--factor_strategy ekfac | ||
``` | ||
# OpenWebText & Llama-3-8B Example | ||
|
||
This repository contains scripts for computing influence scores on the subset of OpenWebText dataset. | ||
The pipeline is inspired by [the LoggIX](https://github.com/logix-project/logix/tree/main/examples/language_modeling). | ||
Install the necessary packages: | ||
|
||
```bash | ||
torchrun --standalone --nnodes=1 --nproc-per-node=2 analyze.py --factor_batch_size 8 \ | ||
--factor_strategy ekfac | ||
pip install -r requirements.txt | ||
``` | ||
|
||
## Training | ||
|
||
We will use the pre-trained model [from HuggingFace](https://huggingface.co/meta-llama/Meta-Llama-3-8B). | ||
|
||
## Computing EKFAC Factors | ||
|
||
```bash | ||
torchrun --standalone --nnodes=1 --nproc-per-node=4 fit_factors.py --factor_batch_size 4 | ||
``` | ||
``` | ||
|
||
|
||
The `generate.py` folder contains a code to generate response of the Llama-3-8B model given certain prompt. | ||
I saved some prompt and completition pair to the directory `data/data.json`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters