Skip to content

ops: handle multi-compute of the same weight (CORE-153)#13705

Merged
comfyanonymous merged 1 commit into
Comfy-Org:masterfrom
rattus128:prs/multi-use-weight-prefetch
May 4, 2026
Merged

ops: handle multi-compute of the same weight (CORE-153)#13705
comfyanonymous merged 1 commit into
Comfy-Org:masterfrom
rattus128:prs/multi-use-weight-prefetch

Conversation

@rattus128
Copy link
Copy Markdown
Contributor

If the same weight is used multiple times within the same prefetch window, it should only apply compute state mutations once. Mark the weight as fully resident on the first pass accordingly.

Example Test Conditions:

RTX5090, Linux, LTX2.3 + Content Lora + KJNodes LTXV Chunk FF
"A group of old men in suits dance in a new york street."

Before:

image

After:

image

Regression Tests:

RTX5090, Linux, LTX2.0 T2V ✅
RTX5090, Linux, LTX2.0 T2V --disable-async-offload ✅
RTX5090, Linux, WAN2.2 ✅
RTX5090, Linux, Stable cascade -> flux 2 ✅

If the same weight is used multiple times within the same prefetch
window, it should only apply compute state mutations once. Mark the
weight as fully resident on the first pass accordingly.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8dc0a245-547e-43ab-88e5-d7cfc20657dd

📥 Commits

Reviewing files that changed from the base of the PR and between f3ea976 and 8c584e2.

📒 Files selected for processing (1)
  • comfy/ops.py

📝 Walkthrough

Walkthrough

The resolve_cast_module_with_vbar() function in comfy/ops.py now includes a conditional statement that sets the prefetch["resident"] flag to True when prefetch["signature"] is not None. This assignment occurs immediately after the weight casting operation and before bias handling. The change modifies the control flow for subsequent function calls to treat module weights as resident based on the presence of a signature value, affecting the caching behavior during the casting process.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: handling multi-compute of the same weight, which matches the core functionality modification in the changeset.
Description check ✅ Passed The description explains the issue being fixed (same weight used multiple times should only apply mutations once) and provides test conditions and regression results demonstrating the fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

Copy link
Copy Markdown
Collaborator

@kijai kijai left a comment

Choose a reason for hiding this comment

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

Tested that this resolves the issue for me as well.

@comfyanonymous comfyanonymous merged commit 1265955 into Comfy-Org:master May 4, 2026
14 checks passed
@alexisrolland alexisrolland changed the title ops: handle multi-compute of the same weight ops: handle multi-compute of the same weight (CORE-153) May 5, 2026
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.

3 participants