+
+
+ You signed in with another tab or window. Reload to refresh your session.
+ You signed out in another tab or window. Reload to refresh your session.
+ You switched accounts on another tab or window. Reload to refresh your session.
+
+ Dismiss alert
+
+
+
+
+
+
+ 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
+
+
+
+
Intel GPU's are detected with the prefix of xpu: instead of cuda:
+This PR allows the xpu: entries to show up in the selector.
+
Summary by Sourcery
+
Enable detection and selection of Intel XPU devices by adding torch.xpu availability checks, listing xpu devices, and updating allocation routines to include XPU alongside CUDA
+
New Features:
+
+
Add support for torch.xpu device availability alongside CUDA for main and text encoder device selection
+
Include xpu:{i} entries in the global device list
+
Extend VRAM allocation logic to consider XPU devices when building available device selections
This PR integrates support for the Intel GPU prefix “xpu:” by expanding device availability checks, updating the device list, and extending allocation logic to include xpu alongside cuda.
+
Class diagram for device selection and allocation changes
Include xpu availability in device selection functions
+
Add torch.xpu.is_available() to the get_torch_device_patched condition
Add torch.xpu.is_available() to the text_encoder_device_patched condition
+
__init__.py
+
+
+
Add xpu devices to the global device list
+
Extend get_device_list return value with f"xpu:{i}" entries based on torch.xpu.device_count()
+
__init__.py
+
+
+
Extend device filtering in VRAM allocation to include xpu
+
Include xpu-prefixed devices in available_devices filter in the first override block
Include xpu-prefixed devices in available_devices filter in the second override block
+
__init__.py
+
+
+
+
+
+Tips and commands
+
Interacting with Sourcery
+
+
Trigger a new review: Comment @sourcery-ai review on the pull request.
+
Continue discussions: Reply directly to Sourcery's review comments.
+
Generate a GitHub issue from a review comment: Ask Sourcery to create an
+issue from a review comment by replying to it. You can also reply to a
+review comment with @sourcery-ai issue to create an issue from it.
+
Generate a pull request title: Write @sourcery-ai anywhere in the pull
+request title to generate a title at any time. You can also comment
+@sourcery-ai title on the pull request to (re-)generate the title at any time.
+
Generate a pull request summary: Write @sourcery-ai summary anywhere in
+the pull request body to generate a PR summary at any time exactly where you
+want it. You can also comment @sourcery-ai summary on the pull request to
+(re-)generate the summary at any time.
+
Generate reviewer's guide: Comment @sourcery-ai guide on the pull
+request to (re-)generate the reviewer's guide at any time.
+
Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
+pull request to resolve all Sourcery comments. Useful if you've already
+addressed all the comments and don't want to see them anymore.
+
Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
+request to dismiss all existing Sourcery reviews. Especially useful if you
+want to start fresh with a new review - don't forget to comment
+@sourcery-ai review to trigger a new review!
+ The reason will be displayed to describe this comment to others. Learn more.
+
+
+
+
+
+
+
+
+
+
Hey @Nuitari - I've reviewed your changes - here's some feedback:
+
+
Wrap direct torch.xpu calls in hasattr or try/except blocks to avoid runtime errors on PyTorch builds without XPU support.
+
Extract the repeated (cuda or xpu) availability check and device-list construction into a shared helper to reduce duplication.
+
+
+Prompt for AI Agents
+
Please address the comments from this code review:
+## Overall Comments
+- Wrap direct torch.xpu calls in hasattr or try/except blocks to avoid runtime errors on PyTorch builds without XPU support.
+- Extract the repeated (cuda or xpu) availability check and device-list construction into a shared helper to reduce duplication.
+
+## Individual Comments
+
+### Comment 1
+<location> `__init__.py:40` </location>
+<code_context>
+ def get_torch_device_patched():
+ device = None
+- if (not torch.cuda.is_available() or mm.cpu_state == mm.CPUState.CPU or "cpu" in str(current_device).lower()):
++ if (not (torch.cuda.is_available() or torch.xpu.is_available()) or mm.cpu_state == mm.CPUState.CPU or "cpu" in str(current_device).lower()):
+ device = torch.device("cpu")
+ else:
+</code_context>
+
+<issue_to_address>
+Potential AttributeError if torch.xpu is not available in all environments.
+
+To avoid errors, use hasattr(torch, 'xpu') before accessing torch.xpu methods.
+</issue_to_address>
+
+### Comment 2
+<location> `__init__.py:48` </location>
+<code_context>
+ def text_encoder_device_patched():
+ device = None
+- if (not torch.cuda.is_available() or mm.cpu_state == mm.CPUState.CPU or "cpu" in str(current_text_encoder_device).lower()):
++ if (not (torch.cuda.is_available() or torch.xpu.is_available()) or mm.cpu_state == mm.CPUState.CPU or "cpu" in str(current_text_encoder_device).lower()):
+ device = torch.device("cpu")
+ else:
+</code_context>
+
+<issue_to_address>
+torch.xpu usage may not be safe on all platforms.
+
+Add a check like hasattr(torch, 'xpu') before using torch.xpu to prevent errors on systems where it is unavailable.
+</issue_to_address>
+
+### Comment 3
+<location> `__init__.py:328` </location>
+<code_context>
+ def get_device_list():
+ import torch
+- return ["cpu"] + [f"cuda:{i}" for i in range(torch.cuda.device_count())]
++ return ["cpu"] + [f"cuda:{i}" for i in range(torch.cuda.device_count())] + [f"xpu:{i}" for i in range(torch.xpu.device_count())]
+
+ class DeviceSelectorMultiGPU:
+</code_context>
+
+<issue_to_address>
+Unconditional torch.xpu.device_count() may cause errors if xpu is not present.
+
+Check for 'xpu' in torch with hasattr(torch, 'xpu') before calling torch.xpu.device_count() to avoid AttributeError on systems without xpu support.
+</issue_to_address>
+
+
+
+Sourcery is free for open source - if you like our reviews please consider sharing them ✨
+
+ if (not torch.cuda.is_available() or mm.cpu_state == mm.CPUState.CPU or "cpu" in str(current_text_encoder_device).lower()):
+
+
+
+
+
+
+
+
+
+
+ if (not (torch.cuda.is_available() or torch.xpu.is_available()) or mm.cpu_state == mm.CPUState.CPU or "cpu" in str(current_text_encoder_device).lower()):
+
+
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You can’t perform that action at this time.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/precompiled_binaries/linux/llama-quantize b/precompiled_binaries/linux/llama-quantize
deleted file mode 100755
index 04708cb..0000000
Binary files a/precompiled_binaries/linux/llama-quantize and /dev/null differ
diff --git a/precompiled_binaries/win64/llama-quantize.exe b/precompiled_binaries/win64/llama-quantize.exe
deleted file mode 100755
index 6c0eb2c..0000000
Binary files a/precompiled_binaries/win64/llama-quantize.exe and /dev/null differ
diff --git a/pyproject.toml b/pyproject.toml
index 1331023..02ac2a8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,7 @@
[project]
name = "comfyui-multigpu"
description = "Adds full multi-GPU support for WanVideoWrapper, enabling model loading and block-swapping on any device. Provides a suite of custom nodes to manage multiple GPUs for ComfyUI, including advanced GGUF offloading with DisTorch and device overrides for core nodes."
-version = "1.8.0"
+version = "1.8.1"
license = {file = "LICENSE"}
[project.urls]
@@ -11,4 +11,4 @@ Repository = "https://github.com/pollockjj/ComfyUI-MultiGPU"
[tool.comfy]
PublisherId = "pollockjj"
DisplayName = "ComfyUI-MultiGPU"
-Icon = "https://raw.githubusercontent.com/pollockjj/ComfyUI-MultiGPU/main/assets/multigpu_icon.png"
\ No newline at end of file
+Icon = "https://raw.githubusercontent.com/pollockjj/ComfyUI-MultiGPU/main/assets/multigpu_icon.png"
Intel GPU's are detected with the prefix of xpu: instead of cuda:
++This PR allows the xpu: entries to show up in the selector.
Summary by Sourcery
+Enable detection and selection of Intel XPU devices by adding torch.xpu availability checks, listing xpu devices, and updating allocation routines to include XPU alongside CUDA
+New Features:
++- Add support for torch.xpu device availability alongside CUDA for main and text encoder device selection
+- Include xpu:{i} entries in the global device list
+- Extend VRAM allocation logic to consider XPU devices when building available device selections
+
+