Skip to content

Commit

Permalink
Remove oe-eval in docker image (#302)
Browse files Browse the repository at this point in the history
* Revert oe-eval-changes

* make sure to actually remove checkpoints if keep_last_n_checkpoints=0

* quick removal
  • Loading branch information
vwxyzjn authored Aug 28, 2024
1 parent 222af23 commit d950880
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 22 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/push-image-olmo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v3
with:
repository: vwxyzjn/learn-fsdp2 # dummy private repo to test out deploy keys
path: './oe-eval-internal'
ssh-key: ${{ secrets.OE_EVAL_GIT_CLONE_ACCESS_PRIVATE_SSH_DEPLOY_KEY }}

- name: Setup environment
uses: ./.github/actions/setup
with:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v3
with:
repository: vwxyzjn/learn-fsdp2 # dummy private repo to test out deploy keys
path: './oe-eval-internal'
ssh-key: ${{ secrets.OE_EVAL_GIT_CLONE_ACCESS_PRIVATE_SSH_DEPLOY_KEY }}

- name: Setup environment
uses: ./.github/actions/setup
with:
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ RUN pip install -r requirements.txt

# NLTK download
RUN python -m nltk.downloader punkt
COPY oe-eval-internal oe-eval-internal
COPY open_instruct open_instruct

# install the package in editable mode
Expand Down
1 change: 0 additions & 1 deletion Dockerfile.olmo
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ RUN pip install -r requirements-olmo.txt

# NLTK download
RUN python -m nltk.downloader punkt
COPY oe-eval-internal oe-eval-internal
COPY open_instruct open_instruct

# install the package in editable mode
Expand Down
14 changes: 6 additions & 8 deletions open_instruct/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,13 +565,12 @@ def is_checkpoint_folder(dir: str, folder: str) -> bool:

def clean_last_n_checkpoints(output_dir: str, keep_last_n_checkpoints: int) -> None:
# remove the last checkpoint to save space
if keep_last_n_checkpoints > 0:
folders = [f for f in os.listdir(output_dir) if is_checkpoint_folder(output_dir, f)]
# find the checkpoint with the largest step
checkpoints = sorted(folders, key=lambda x: int(x.split("_")[-1]))
if len(checkpoints) > keep_last_n_checkpoints:
for checkpoint in checkpoints[:len(checkpoints) - keep_last_n_checkpoints]:
shutil.rmtree(os.path.join(output_dir, checkpoint))
folders = [f for f in os.listdir(output_dir) if is_checkpoint_folder(output_dir, f)]
# find the checkpoint with the largest step
checkpoints = sorted(folders, key=lambda x: int(x.split("_")[-1]))
if len(checkpoints) > keep_last_n_checkpoints:
for checkpoint in checkpoints[:len(checkpoints) - keep_last_n_checkpoints]:
shutil.rmtree(os.path.join(output_dir, checkpoint))


# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -676,7 +675,6 @@ def submit_beaker_eval_jobs(
--workspace {workspace} \
--preemptible \
--use_hf_tokenizer_template \
--run_oe_eval_experiments \
--beaker_image {beaker_image} \
"""
if len(hf_repo_revision) > 0:
Expand Down

0 comments on commit d950880

Please sign in to comment.