Skip to content

Commit 1265955

Browse files
authored
ops: handle multi-compute of the same weight (#13705)
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.
1 parent 1ac7818 commit 1265955

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

comfy/ops.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ def to_dequant(tensor, dtype):
253253
if bias is not None:
254254
bias = post_cast(s, "bias", bias, bias_dtype, prefetch["resident"], update_weight)
255255

256+
if prefetch["signature"] is not None:
257+
prefetch["resident"] = True
258+
256259
return weight, bias
257260

258261

0 commit comments

Comments
 (0)