[Offload] Add print_offload_folder util - #738
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughA new public helper function Changesprint_offload_folder utility and docs
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The quality checks have failed. Please run |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/compressed_tensors/offload/__init__.py (1)
323-334: ⚡ Quick winMake output deterministic by sorting directory entries.
os.listdir(offload_folder)is not ordered, so table/unknown-file output can vary across runs. Sorting improves debuggability and reproducibility.Suggested diff
- for file_name in os.listdir(offload_folder): + for file_name in sorted(os.listdir(offload_folder)): file_path = os.path.join(offload_folder, file_name) if file_path in file_path_to_param_info: info = file_path_to_param_info[file_path] print(f"{info['path']:<60} {str(info['shape']):<25} {info['dtype']:<10}") else: unknown_paths.append(file_path)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/compressed_tensors/offload/__init__.py` around lines 323 - 334, The os.listdir(offload_folder) call returns entries in non-deterministic order, causing the output table and unknown files list to vary across runs. Wrap the os.listdir() call with the sorted() function to ensure the file_name iteration happens in alphabetical order, making the printed output deterministic and reproducible for debugging purposes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/compressed_tensors/offload/README.md`:
- Around line 534-541: The code fence block displaying the parameter table
(containing Parameter Path, Shape, and Dtype columns) is missing a language tag
on the opening fence. Add the language identifier `text` immediately after the
opening triple backticks (change ` ``` ` to ` ```text `) to satisfy markdown
linting requirements and ensure consistent rendering.
---
Nitpick comments:
In `@src/compressed_tensors/offload/__init__.py`:
- Around line 323-334: The os.listdir(offload_folder) call returns entries in
non-deterministic order, causing the output table and unknown files list to vary
across runs. Wrap the os.listdir() call with the sorted() function to ensure the
file_name iteration happens in alphabetical order, making the printed output
deterministic and reproducible for debugging purposes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 52a32b54-bb4c-4e18-b1b4-6ce1e1ae5967
📒 Files selected for processing (2)
src/compressed_tensors/offload/README.mdsrc/compressed_tensors/offload/__init__.py
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Require one maintainer reviewAll PRs must have at least one approving review from a maintainer before merging.
|
No description provided.