[oneshot] clean offload_dir during post-processing#2605
[oneshot] clean offload_dir during post-processing#2605brian-dellabetta wants to merge 2 commits intomainfrom
Conversation
Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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.
|
👋 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>
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"