mirror of
https://github.com/Comfy-Org/pyisolate.git
synced 2026-11-05 00:27:34 +00:00
[PR #2] [CLOSED] WIP Add Robust Multi-GPU and Cross-Device Support for PyIsolate Benchmarks #3
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/pyisolate#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/pyisolate/pull/2
Author: @billybasass
Created: 7/14/2025
Status: ❌ Closed
Base:
main← Head:main📝 Commits (10+)
6ed3376Add multi-GPU, Intel/AMD support, robust device selection, and linter fixesa9ebed1main change is device type was a integer and changed it to a string some you can still pick cpu only testingea59404fix redundant torch requirements and correct wheels60afae5set python to 3.12 because 3.13 does not have all wheels and make the array writable before converting to a tensora01c1f4ruff and lint checks14c2605fix: venv isolation for extension imports, ensure only venv site-packages are used; codebase ruff clean7de4668intel testing addedca3ced1venv isolation has been applied42728edadded GPU share results for intel GPUs1b55f5bThe memory benchmark will now loop over all available backends (including xpu for Intel GPUs)📊 Changes
12 files changed (+996 additions, -533 deletions)
View changed files
📝
benchmarks/benchmark.py(+219 -36)📝
benchmarks/memory_benchmark.py(+460 -322)➕
cleanup_pyisolate.ps1(+32 -0)📝
pyisolate/_internal/client.py(+12 -3)➕
pyisolate/_internal/gpu_utils.py(+67 -0)📝
pyisolate/_internal/host.py(+39 -10)📝
pyisolate/_internal/shared.py(+50 -33)📝
pyisolate/shared.py(+6 -0)📝
pyproject.toml(+0 -1)📝
run_benchmarks_windows.ps1(+50 -13)📝
tests/test_benchmarks.py(+46 -114)📝
tests/test_torch_tensor_integration.py(+15 -1)📄 Description
This PR adds, cross-vendor GPU support to the PyIsolate benchmarking suite, enabling seamless benchmarking on NVIDIA (CUDA), AMD (ROCm), and Intel (XPU/oneAPI) GPUs, as well as CPU. It also improves device selection, serialization, and reporting for all supported platforms.
Key Features & Changes
Multi-GPU Device Selection:
Detects all available GPUs (NVIDIA, AMD, Intel) in the system.
Prompts the user to select which GPU to use if more than one is present.
Prints the name of the selected device at the start of each benchmark run.
Device-Aware Tensor Serialization:
CPU and CUDA: Uses PyTorch’s native (zero-copy) serialization for inter-process communication.
Intel XPU: Implements a fallback serialization for XPU tensors:
XPU tensors are moved to CPU, serialized as a buffer (with shape and dtype), sent through the multiprocessing queue, and reconstructed as XPU tensors on the receiving side.
This avoids PyCapsule/pickle errors and ensures all tests run on Intel GPUs, even though the transfer is not zero-copy.
All benchmarks (including shared-torch and RPC) now run on Intel GPUs.
Benchmark Script Enhancements:
Benchmarks are run on all available backends (CPU, CUDA, XPU).
Status messages and results include the backend and device name for clarity and reproducibility.
Extension Venv and Dependency Handling:
Extension venvs now install the correct PyTorch wheel and index for each backend.
Ensures correct torch version and index for Intel GPUs, and removes invalid version specifiers.
Linter and Syntax Fixes:
Fixed all linter and syntax errors, including stray else: statements and indentation issues.
Codebase is now linter-clean and CI-ready.
Motivation
Enable robust benchmarking and extension support across all major GPU vendors.
Ensure that all tests run on all supported hardware, with clear device selection and reporting.
Provide a future-proof serialization mechanism for device tensors, especially for Intel XPU, until native support is available in PyTorch.
Testing
Benchmarks were run on systems with NVIDIA, AMD, and Intel GPUs.
All tests pass, and results are correctly reported for each device.
No PyCapsule/pickle errors on Intel GPUs.
Closes Issues
Fixes device selection and reporting for multi-GPU systems.
Fixes XPU tensor serialization for multiprocessing.
Fixes linter and syntax errors in the codebase.
Ready for review!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.