Added support for lowvram argument for 'mps' devices. #14622
Added support for lowvram argument for 'mps' devices. #14622FromFirstByte wants to merge 3 commits into
Conversation
…ghts would not be loaded to VRAM completely. With modified GGUF loader it allows to keep memory-mapped weights on disk.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@comfy/model_management.py`:
- Around line 941-942: The new shared-lowvram fallback in the model memory
selection logic is applying too broadly and can affect CPU-loaded models. Update
the condition in the memory-setting block around the VRAMState check so the
shared-lowvram path only forces lowvram_model_memory when the current model’s
torch_dev is a non-CPU load device, preserving the existing behavior for CPU
loads. Keep the change localized to the lowvram memory decision in the relevant
model management function and avoid altering other VRAMState handling.
🪄 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 Plus
Run ID: 19caa59a-e498-497a-940f-0b0aba97665f
📒 Files selected for processing (1)
comfy/model_management.py
Right now VRAM-related args are ignored if cpu_state == CPUState.MPS
If --lowvram arg passed it would prevent from loading 100% of weights to VRAM. With modified GGUF loader it allows to keep memory-mapped weights on disk significantly reducing RAM usage. Modified GGUF loader - https://github.com/FromFirstByte/ComfyUI-GGUF