dynamic_vram: Fix windows Aimdo crash + Fix LLM performance#12408
Merged
comfyanonymous merged 3 commits intomasterfrom Feb 11, 2026
Merged
dynamic_vram: Fix windows Aimdo crash + Fix LLM performance#12408comfyanonymous merged 3 commits intomasterfrom
comfyanonymous merged 3 commits intomasterfrom
Conversation
This reverts commit 12028af.
These tensors cosntructed from aimdo-allocations are CPU expensive to make on the pytorch side. Add a cache version that will be valid with signature match to fast path past whatever torch is doing.
Move as much as possible inside the not resident if block and cache the formed weight and bias rather than the flat intermediates. In extreme layer weight rates this adds up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#12401
On windows, torch can assert against Tensor construction if the VRAM for a tensor is absent physical backing. This means we cannot pre-create aimdo tensors at load time (see revert).
To get the CPU perf closure previously attempted, instead create the tensor on non-resident cache hit (usually the first step) so its validity just runs parallel to signature.
Following that, do a perf push to fully minimize the fast path through the comfy caster to speed up CPU bound LLM inference on high-end GPUs. Primary commit message:
dynamic_vram: Minimize fast path CPU work
Move as much as possible inside the not resident if block and cache
the formed weight and bias rather than the flat intermediates. In
extreme layer weight rates this adds up.
Example test conditions:
Ace step 1.5 Template workflow, 195s
Linux, RTX6000 Blackwell Pro, AMD Ryzen 5 9600X
--fast dynamic_vram
Before (15.5s):
After (14.0s):
Without dynamic_vram (14.6s):
Example test conditions (crash-fix):
Windows, RTX3060, LTX2 I2V.
Before:
After: