mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #162] [MERGED] Manage persistent RoPE allocations #187
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-kitchen#187
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/162
Author: @rattus128
Created: 9/7/2026
Status: ✅ Merged
Merged: 9/7/2026
Merged by: @comfyanonymous
Base:
main← Head:prs/cache-lifecycles📝 Commits (1)
fe791daManage persistent RoPE allocations📊 Changes
4 files changed (+31 additions, -12 deletions)
View changed files
📝
comfy_kitchen/__init__.py(+2 -0)➕
comfy_kitchen/allocation.py(+15 -0)📝
comfy_kitchen/backends/cuda/__init__.py(+7 -6)📝
comfy_kitchen/backends/hip/__init__.py(+7 -6)📄 Description
Comfy Kitchen has long lived caches of the RoPE artifacts for the new sparse attention implementation.
These force the comfy memory compiler to register rogue allocations / graph breaks which is non ideal.
Firstly demote the strong ref of the original RoPE to a weakref so that can just be freed by the caller (inside the graph).
Secondly we add an API that lets comfy register a context that will be with:ed when kitchen does stray caching allocations that exceed the lifetime of the CK call.
This gets the comfy-compiler for minamax H3 down to 0 graph breaks in al sparse attention modes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.