Skip to main content

gpu-shift

English · Türkçe

Shift slow CPU loops onto any GPU - no CUDA, no guesswork.
Point it at your script: it finds the hotspot, captures real CPU truth, and verifies every GPU port
for accuracy, zero VRAM leaks, and real end-to-end speedup before turning it on.

PyPI - wgpu-shift Python 3.11+ Works on NVIDIA, AMD, Intel, and Apple Silicon without CUDA MIT license

Install · Live demo · Real-world ports · How it works · Eval suite · Decisions

1:1 real-time benchmark comparing original scikit-image and SciPy CPU functions against gpu-shift GPU ports: GPU completes in 0.04 to 0.07 s while CPU takes 5.01 to 5.11 s, with all 24 captured cases matching and 0 VRAM leaks.
1:1 real-time run on an RTX 4060 Laptop GPU, data transfers included. How it was measured.

gpu-shift (PyPI package: wgpu-shift) is not an auto-compiler. You (or your coding agent) write the GPU shader one function at a time; gpu-shift finds what is slow, proves outputs match CPU, checks for 0 B VRAM leaks, and keeps small or transfer-bound inputs on CPU automatically. Built on wgpu-py, so the same port runs on NVIDIA, AMD, Intel, and Apple Silicon without CUDA.

Upstream library, same output as CPU Original CPU With gpu-shift
scikit-image denoise_bilateral (512x512, 50 frames) 5.01 s 0.04 s (121x)
scipy.signal.convolve2d (1024x1024, 20 frames) 5.06 s 0.06 s (88x)
scipy.spatial.distance.cdist (2048x128, 20 calls) 5.11 s 0.07 s (72x)

Reproduce locally: uv run --with scipy --with scikit-image python benchmarks/real_world/run_all.py

Try it now

Test your own GPU in 15 seconds, no clone required:

uvx wgpu-shift demo

(Windows Smart App Control: uv run --with wgpu-shift python -m gpu_shift demo)

Use it on your code

Install once from PyPI (wgpu-shift installs both gpu-shift and wgpu-shift commands) and wire it into your coding agent (Claude Code, Antigravity/Gemini, Codex, Cursor, or OpenCode):

pip install wgpu-shift   # or: uv tool install wgpu-shift
gpu-shift setup          # backs up existing configs; undo anytime with `gpu-shift setup --remove`

Or run directly from the terminal without touching your source file until checks pass:

gpu-shift run -- python app.py        # 1. scans hotspot, captures CPU truth + edge traps, writes TASK.md
# implement kernels/<fn>/kernel.wgsl + port.py (yourself or via your agent), then re-run:
gpu-shift run -- python app.py        # 2. runs diff, VRAM check, transfer-inclusive bench, enables if faster
gpu-shift disable kernels/<fn>        # reverts the original file byte-for-byte

At runtime, GPU_SHIFT_MODE=auto|cpu|shadow|gpu lets you compare or force either backend, and machines without a hardware GPU fall back to CPU silently. Full CLI reference (scan, stage, capture, diff, bench, check, report) and built-in examples live in How it works.

gpu-shift check verifying source freshness, WGSL compilation, 8/8 numerical diff, and 0 B VRAM growth, followed by gpu-shift run keeping tiny_add on CPU when transfer cost dominates.
check enforces parity and 0 B VRAM growth; run keeps lightweight ops on CPU when transfer cost dominates.

Languages

Language Status Notes
Python / NumPy Ready (v0.1) CLI, MCP server, SKILL.md, 8-task eval suite, and runtime safety guards
TypeScript / JavaScript Planned Same WGSL kernel and verification loop for Node.js / Deno / Bun
Rust Planned wgpu crate bridge sharing kernel.wgsl and checks
C / C++ Planned wgpu-native C ABI bridge for hot numerical loops

Also planned: optional triton / mlx backends. Contributions welcome.

Docs

  • How it works - CLI reference, agent setup paths, runtime modes, and built-in examples
  • Real-world ports - scikit-image and SciPy timings, optimizations, and upstream quirks caught by diff
  • Python eval suite - 8 labeled tasks covering 1D/2D/3D arrays, multi-output tuples, and CPU/serial-loop traps
  • Design decisions - trade-offs and non-goals
  • Contributing - local dev setup and codebase layout

License

MIT. Shaders and ports generated in your own repository belong to you.

Metadata

Release files for wgpu-shift 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wgpu-shift 0.1.0
File Size Uploaded Provenance Actions
wgpu_shift-0.1.0.tar.gz 588.8 kB With provenance Details for wgpu_shift-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wgpu-shift 0.1.0
File Interpreter ABI Platform Actions
wgpu_shift-0.1.0-py3-none-any.whl Python 3 none any Details for wgpu_shift-0.1.0-py3-none-any.whl

Total release size: 653.4 kB

Release files / wgpu_shift-0.1.0.tar.gz

Download URL wgpu_shift-0.1.0.tar.gz
Size 588.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7a64d1d47c45bd3bdcaa4265f79bd4d809a2d390088b2d531caa0196dc74a983
BLAKE2b-256 checksum
How to use checksums
f589173b28c052d5f381c3e079e79069ee7fd79e32e6782fd025115a58144e44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / wgpu_shift-0.1.0-py3-none-any.whl

Download URL wgpu_shift-0.1.0-py3-none-any.whl
Size 64.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1fbf21889b6f4c9e85bc0f11d5ac09a6206fe6dc0e8acdadd43c9ee2cbf7937
BLAKE2b-256 checksum
How to use checksums
33bb944476ba36ff7775d94eb754f45b192757ffc1a276073d1bcda8fc683ce5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for wgpu-shift 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wgpu_shift-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page