Add device-agnostic gpu / gpu_full offload for CUDA and XPU - #6
Open
gaius-codius wants to merge 2 commits into
Open
gaius-codius wants to merge 2 commits into
gaius-codius wants to merge 2 commits into
Conversation
The cuda branch was hard-coded to cuda:0 and refused to run on this Arc stack, so LLaDA stayed on CPU. gpu uses ComfyUI's selected device and keeps the same INT8 staging / aux-swap lifecycle.
…tor. gpu keeps prompt encode on the host. gpu_full moves registered encoder params so dequant temps land in VRAM; mmap'd qweights stay on the CPU.
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.
Summary
cudaoffload path was hard-coded tocuda:0and refused to run whentorch.cudawas unavailable, so Intel XPU users were stuck on full-CPUoffload=cpu.gpudoes the same INT8 staging / aux-swap lifecycle on whatever device ComfyUI selected (comfy.model_management.get_torch_device()).cudastill means NVIDIA only.gpu_fullalso runs GGUF prompt encode on that device (mmap'd qweights stay on the host; encode scratch lands in VRAM). It is not a speed win on XPU; it is there so dequant temps are not anonymous host RAM.pipeline.transformer.device(includingxpu). Unload callstorch.xpu.empty_cache()when XPU is present. Noipc_collecton XPU.Test plan
offload=cudastill loads and generates (legacy path).offload=gpumatches the old CUDA lifecycle (preprocess → aux release → denoise → VAE decode).offload=gpu4-step Turbo T2I produces a real image, not noise/black/cast.offload=gpu_fulllogs that the text encoder device is the XPU and still produces a real image.offload=cpuunchanged.sequential_cpu_offload/model_cpu_offloadstill rejected by anyone who already knew they crash on the GGUF encoder (out of scope).Made with Cursor