Skip to content

Omni: Account whole LoRA weights in ComfyUI memory budgets - #613

Merged
xiangyuT merged 5 commits into
intel:mainfrom
xiangyuT:feature/comfyui-omnixpu-lora-memory-budget
Aug 15, 2026
Merged

Omni: Account whole LoRA weights in ComfyUI memory budgets#613
xiangyuT merged 5 commits into
intel:mainfrom
xiangyuT:feature/comfyui-omnixpu-lora-memory-budget

Conversation

@xiangyuT

Copy link
Copy Markdown
Contributor

No description provided.

@xiangyuT
xiangyuT marked this pull request as ready for review August 13, 2026 07:04
@xiangyuT
xiangyuT requested a lite review from Copilot August 13, 2026 07:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new ComfyUI-OmniXPU adapter that caches whole-LoRA tensor sizes on ModelPatcher attachments and applies the cached staging budget to ComfyUI model load memory requirements, with an optional runtime trace mode for per-layer staging behavior.

Changes:

  • Introduces lora_memory adapter to compute/dedupe LoRA tensor sizes, persist them on patchers, and add the cached budget to load_models_gpu memory requirements.
  • Registers the adapter as a patch component and wires a new OMNIXPU_LORA_MEMORY config flag.
  • Adds documentation and tests covering cache behavior, stacking, deduplication, and optional staging trace logging.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
omni/ComfyUI-OmniXPU/adapters/lora_memory.py New adapter that caches LoRA tensor budgets and applies them to model load requests; optional dynamic staging trace.
omni/ComfyUI-OmniXPU/config.py Adds lora_memory feature flag controlled by OMNIXPU_LORA_MEMORY.
omni/ComfyUI-OmniXPU/patches/init.py Registers the new adapter component in the patch registry.
omni/ComfyUI-OmniXPU/README.md Documents the new adapter and environment variables, including trace mode.
omni/tests/test_comfyui_omnixpu_lora_memory.py New unit tests validating budget computation, caching, stacking, and tracing behavior.
omni/tests/test_comfyui_omnixpu_bootstrap.py Verifies adapter registration and config default behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +224 to +234
if "minimum_memory_required" in new_kwargs:
minimum = new_kwargs["minimum_memory_required"]
if minimum is not None:
new_kwargs["minimum_memory_required"] = minimum + budget
elif len(new_args) > 2:
minimum = new_args[2]
if minimum is not None:
new_args[2] = minimum + budget
else:
minimum = None
effective_minimum = None if minimum is None else minimum + budget
Comment on lines +60 to +66
Component(
"lora_memory_budget",
"lora_memory",
"adapter",
"ComfyUI-OmniXPU",
"adapters/lora_memory.py",
),
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.

2 participants