Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow free_disk_space_for() remove arbitrary files from Petals cache #339

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

borzunov
Copy link
Collaborator

@borzunov borzunov commented Jul 5, 2023

Before this PR, free_disk_space_for() was able to remove (a) only entire cached revisions (= git commits/branches) and (b) only from the repository we're loading right now.

This PR allows this functions to remove arbitrary files separately from any repositories.

This is useful for transition to Petals 1.2.0+, since it now uses original repos instead of the ones with converted models (see #323). In particular, the cache for bigscience/bloom-petals is now deprecated and should be removed in favor of bigscience/bloom. This is also useful as a way to free space before loading LoRA adapters (#335).

@@ -33,15 +33,12 @@ def allow_cache_reads(cache_dir: Optional[str]):
return _blocks_lock(cache_dir, fcntl.LOCK_SH)


def allow_cache_writes(
cache_dir: Optional[str], *, reserve: Optional[int] = None, max_disk_space: Optional[int] = None
):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were some unused args.

@borzunov borzunov merged commit 4d9c26f into main Jul 5, 2023
7 checks passed
@borzunov borzunov deleted the fix-free-disk-space-for branch July 5, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant