Skip to content

Handle WeightAdapters in ops.move_patch_to_device - #461

Open
blepping wants to merge 1 commit into
city96:mainfrom
blepping:fix_move_patch_to_device
Open

Handle WeightAdapters in ops.move_patch_to_device#461
blepping wants to merge 1 commit into
city96:mainfrom
blepping:fix_move_patch_to_device

Conversation

@blepping

Copy link
Copy Markdown
Contributor

move_patch_to_device hasn't done anything in a really long time since patches are basically never bare torch.Tensor instances anymore and are instances of WeightAdapterBase instead. The current move_patch_to_device is a no-op.

I am not positive this approach is the correct one or will handle something like an exotic custom instance of the weight adapter base class that behaves differently. I have been using it in my local version for months now without any problems.

model_management.cast_to_device automatically determines of non-blocking transfers are supported and enables that when appropriate. copy=true might not be necessary, but it seemed like the safe choice. I haven't tried with that disabled.

Note: I said this works for me but I have been using it/testing with other local patches like the Triton kernels. I don't see how that could make a difference but like the jerk I am, I haven't actually tested it in a vanilla setup.

ChrisColeTech added a commit to ChrisColeTech/ComfyUI-GGUF-Loader that referenced this pull request Aug 12, 2026
Cherry-pick production fixes from city96/ComfyUI-GGUF open PRs:
- city96#472 dequant device-constant cache (major LTX/sampling speedup)
- city96#433 IQ1/IQ2/IQ3 torch dequant (extra TE quants)
- city96#470 QK-norm .scale→.weight (silent NaN/black Flux-compat)
- city96#467 dequant bare nn.Parameters (LTX learnable_registers)
- city96#392 lumina2/zimage pad token shape fix
- city96#456/city96#468 GGMLTensor dtype + dequantize() for core cast path
- city96#461 WeightAdapter-aware move_patch_to_device
- city96#469 force_patch on partial load/unload
- city96#440/city96#436 mistral3 TE, city96#438 qwen35, qwen2 allowlist
- city96#473 partial: Qwen3-VL deepstack mmproj map for MiniMax H3 TE

Skipped mega/draft rewrites (city96#459, full city96#473 LazyGGUFReader, city96#336 Triton).
See PR_BACKPORT.md for the full matrix.
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.

1 participant