Skip to content

Commit a785eee

Browse files
Merge pull request #104 from EleutherAI/memorization-evals
Add Memorization Evals to repo
2 parents 4f1367b + 4ee17ab commit a785eee

File tree

4 files changed

+13758
-0
lines changed

4 files changed

+13758
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,24 @@ We also provide benchmark 0-shot and 5-shot results on a variety of NLP datasets
203203

204204
Evaluations were performed in GPT-NeoX using the [LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness), and are viewable by model and step at `results/json/v1.1-evals/*` in this repository.
205205

206+
## Reproducing Memorization Results
207+
The memorization evaluation script `memorization/eval_memorization.py` assumes that you are running the script in a distributed process, ideally in slurm. If you want to reproduce the evaluation, consider the following steps.
208+
209+
1. Change `prefix` and `idx_path` local variables of `generate_function()` to point to the right document and index path.
210+
211+
2. If you are not using [Slurm](https://slurm.schedmd.com/documentation.html), You need to change global variables inside the script, like `RANK` and `NUM_PROCS` (world size) to point to the right environment variables.
212+
213+
3. Change `cache_dir` of model being loaded (line 172) to point to locally saved directory of the model. This is necessary as we **donot** want to load the same model multiple times. Doing so will lead to errors.
214+
215+
4. This script additionally saves results to aws s3 buckets (line 205). If you would like to save the results locally instead, you can do so by saving `memorization_evals` as a csv instead.
216+
217+
5. You should ideally be able to run this script now on slurm (see `memorization/multinode_runner.sbatch`) for an example sbatch script.
218+
219+
6. If you are using a different distributed client instead, you will need to pass `MODEL` and `CHECKPOINT` variables appropriately (see `memorization/multinode_runner.sbatch`) for an example
220+
221+
7. These csvs can then be combined by simple pandas concatenation. See `memorization/eda.ipynb` for an example.
222+
223+
8. You can now generate plots too by following `memorization/eda.ipynb`.
206224

207225

208226
## Citation Details

0 commit comments

Comments
 (0)