Skip to main content

deep-variance

GPU Virtual Memory Management SDK

CUDA virtual memory management (VMM) with physical chunk caching and DLPack-backed PyTorch tensors.

Ships as a pre-compiled wheel — no compiler or build tools required on install.

Requirements

Python 3.12 (cp312)
PyTorch any CUDA build
CUDA 12.x driver and runtime
Platform Linux x86_64 (glibc ≥ 2.34 — Ubuntu 22.04+, RHEL 9+)

Install

# 1. Install PyTorch for your CUDA version (https://pytorch.org)
pip install torch

# 2. On HPC, load CUDA if it is not in your path
module load cuda

# 3. Install deep-variance
pip install deep-variance

Usage

import torch
from deep_variance import (
    vmm_empty,
    vmm_empty_nd,
    set_cache_limit,
    cache_stats,
)

# 1-D allocation: 1 M float32 elements on CUDA device 0
t = vmm_empty(1_000_000, dtype=torch.float32, device="cuda:0")

# N-D allocation: (100, 1000) float32
t = vmm_empty_nd((100, 1000), dtype=torch.float32)

# Tune the physical chunk cache (2 GB per pool)
set_cache_limit(device_id=0, chunk_bytes=0, max_bytes=2 * 1024**3)

# Inspect cache utilisation
print(cache_stats())

Environment check

deep-variance-check                  # check C++, torch, CUDA
deep-variance-check --module-load    # also run `module load cuda` if CUDA not visible

Or from Python:

from deep_variance import check_environment, ensure_cuda_visible

ensure_cuda_visible(use_module=True)   # attempt `module load cuda` if needed
report = check_environment()
for name, (ok, msg) in report.items():
    print(f"{name}: {'ok' if ok else 'MISSING'} — {msg}")

Analytics (opt-out)

Usage telemetry is enabled by default. Events are sent from a background daemon thread and never block the caller. All network and I/O errors are silently ignored. No personally identifiable information is collected.

To opt out, set the environment variable before importing:

export DEEP_VARIANCE_NO_TELEMETRY=1

Or disable at runtime:

from deep_variance import disable_analytics, analytics_summary

disable_analytics()          # stop for this process
print(analytics_summary())  # inspect counts collected so far

To associate events with your account, provide an API key. This lets you view your usage history in the DeepVariance dashboard. No PII is attached.

# via environment variable (recommended — set once in your shell profile)
export DEEP_VARIANCE_API_KEY=your_api_key
# or at runtime before any allocations
from deep_variance import enable_analytics

enable_analytics(api_key="your_api_key")

Development

git clone <repo>
cd deepvariance-ms-sdk
pip install -e ".[dev]"
pytest                          # unit tests (no GPU required)
pytest --run-cuda-live          # + CUDA-live tests (requires CUDA GPU)

What's New

Version Change
1.0.6 Code improvements and bug fixes.
1.0.5 Fixed startup hook placement in wheel for correct import-time initialisation.
1.0.4 Fixed __version__ reporting in compiled wheel (yanks 1.0.3).
1.0.3 Code improvements; added psutil as a required dependency.
1.0.2 Added a dedicated PyPI documentation page separate from the GitHub README.
1.0.1 Stub fixes and README cleanup.
1.0.0 Initial release: CUDA VMM allocator with physical chunk caching and DLPack-backed PyTorch tensors.

License

MIT

Metadata

Release files for deep-variance 1.0.6

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

Built distribution (wheel)

Table of built distributions (wheels) for deep-variance 1.0.6
File Interpreter ABI Platform
deep_variance-1.0.6-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details

Release files / deep_variance-1.0.6-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL deep_variance-1.0.6-cp312-cp312-manylinux_2_34_x86_64.whl
Size 3.8 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
c78e6576acc2a330a7d4fe021b2f17541eebde2857c8444c07f5f608d34f4260
BLAKE2b-256 checksum
How to use checksums
cd6fa51be19b98152c50a2d99a109e7005afc303cbdf2da7fd4853d806e810ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Security for deep-variance 1.0.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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