Skip to content

[oneshot] clean offload_dir during post-processing#2605

Draft
brian-dellabetta wants to merge 2 commits intomainfrom
bdellabe/offload-dir-prune
Draft

[oneshot] clean offload_dir during post-processing#2605
brian-dellabetta wants to merge 2 commits intomainfrom
bdellabe/offload-dir-prune

Conversation

@brian-dellabetta
Copy link
Copy Markdown
Collaborator

@brian-dellabetta brian-dellabetta commented Apr 10, 2026

SUMMARY:
Corequisite:

The DiskCache creates potentially several hundreds of intermediate files in user-provided offload_dir during normal operation with large models. These are either symlinks or intermediate tensors that are not necessary/valuable to keep around after successfully running oneshot.

PR adds an input to oneshot to allow user to clean the offload dir during post-processing.

Some open questions:

  • Do we want to run this in try/catch instead?

  • Do this with a context instead? with disk_cache as DiskCache(): ...

  • How to handle DistributedDiskCache?

TEST PLAN:
"please outline how the changes were tested"

Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 10, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: baa608f2-eca7-4fc3-9dc1-f1c1caa17c49

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bdellabe/offload-dir-prune

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a clean_offload_dir parameter to the oneshot entrypoint and the post_process utility, enabling the automatic cleanup of intermediate disk offload files. The changes include updating the Oneshot class, the oneshot function, and the post_process function to handle this new flag. Feedback was provided to correct a typo in a warning message and to refine the logic in post_process to prevent misleading warnings when an output directory is not provided.

Comment thread src/llmcompressor/entrypoints/utils.py
@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Brian Dellabetta <brian-dellabetta@users.noreply.github.com>
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.

1 participant