Skip to main content

Taeda Logo

Taeda

A lightweight Python library for GPU utilities, performance estimation, and memory management.

Taeda is a Python package that adds useful functions to PyTorch, including GPU monitoring, theoretical performance estimation, and CPU RAM-to-GPU VRAM tensor management.

Features

  • Detect available NVIDIA CUDA GPUs.
  • Retrieve GPU clock speeds in real time.
  • Calculate CUDA core counts.
  • Estimate theoretical FP32 TFLOPS.
  • Support multiple NVIDIA GPUs.
  • Retrieve GPU information and memory statistics.
  • RAMVRAM: Manage tensor storage between system RAM and GPU VRAM.
  • RAMVRAMModel: Experimental model wrapper for layer-by-layer CPU/GPU transfers.
  • Automatic VRAM usage monitoring.
  • CPU RAM offloading when GPU memory is limited.
  • Configurable VRAM usage limits.
  • Experimental autograd-compatible activation offloading.
  • Support for PyTorch backward passes and optimizer updates.
  • Simple Python API.

Installation

pip install taeda

Requirements

  • Python 3.9+
  • PyTorch
  • NVIDIA GPU (for CUDA features)
  • NVIDIA drivers
  • nvidia-ml-py

Usage

import torch
import taeda


# ============================================================
# GPU PERFORMANCE
# ============================================================

# Get theoretical GPU performance
tflops = taeda.get_tflops(0)
print(f"GPU Performance: {tflops:.3f} TFLOPS")


# ============================================================
# GPU STATISTICS
# ============================================================

# Get GPU information and statistics
stats = taeda.get_gpu_stats(0)
print(stats)


# ============================================================
# RAMVRAM
# ============================================================

# Initialize RAMVRAM
memory = taeda.RAMVRAM(max_vram_percent=80)

# Store tensors
a = memory.store(torch.randn(5000, 5000))
b = memory.store(torch.randn(5000, 5000))

# Retrieve a tensor
tensor = memory.get(a)

# Display RAMVRAM memory information
memory.report()

# ============================================================
# VRAM Allocation
# ============================================================

# Allocate 256 MB of VRAM
taeda.alloc_vram(256)

# Get allocated VRAM
allocated = taeda.get_allocated_vram()
print(f"Allocated VRAM: {allocated:.2f} MB")

# Free allocated VRAM
taeda.free_vram()

RAMVRAMModel Usage

RAMVRAMModel is an experimental PyTorch model wrapper designed to keep master model parameters in system RAM and transfer layers to GPU for computation.

import torch
import torch.nn as nn
import taeda

# Create a sequential model
model = nn.Sequential(
    nn.Linear(512, 1024),
    nn.ReLU(),
    nn.Linear(1024, 512),
    nn.ReLU(),
    nn.Linear(512, 10)
)

# Wrap the model
model = taeda.RAMVRAMModel(
    model,
    max_vram_percent=80
)

# Optimizer operates on CPU master parameters
optimizer = torch.optim.Adam(
    model.parameters(),
    lr=0.001
)

criterion = nn.CrossEntropyLoss()

# Training loop
for epoch in range(10):
    x = torch.randn(32, 512)
    y = torch.randint(0, 10, (32,))

    optimizer.zero_grad(set_to_none=True)

    output = model(x)
    loss = criterion(output, y.to(output.device))

    loss.backward()
    optimizer.step()

    print(f"Epoch {epoch + 1}: {loss.item():.5f}")

# Display memory information
model.report()

Limitations

  • TFLOPS values are theoretical estimates, not measured benchmark results.
  • Clock speeds fluctuate depending on GPU load, temperature and power limits.
  • CUDA core counts depend on GPU architecture.
  • Currently intended for supported NVIDIA CUDA GPUs.
  • Actual application performance depends on memory bandwidth, workload and other hardware limitations.
  • GPU memory statistics depend on PyTorch CUDA availability.
  • RAM is significantly slower than GPU VRAM.
  • RAMVRAM requires explicit tensor retrieval through memory.get().
  • RAMVRAMModel currently supports nn.Sequential architectures.
  • RAMVRAMModel is experimental and does not guarantee a strict VRAM usage limit.
  • Individual layers must fit into available GPU memory.
  • Optimizer states and gradients can consume substantial system RAM.
  • Performance may decrease significantly due to CPU/GPU transfers.

License

MIT License.

Metadata

Release files for taeda 0.5.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 taeda 0.5.0
File Size Uploaded Provenance Actions
taeda-0.5.0.tar.gz 7.9 kB Without provenance Details for taeda-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for taeda 0.5.0
File Interpreter ABI Platform Actions
taeda-0.5.0-py3-none-any.whl Python 3 none any Details for taeda-0.5.0-py3-none-any.whl

Total release size: 15.2 kB

Release files / taeda-0.5.0.tar.gz

Download URL taeda-0.5.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3c59df1c682f229da8a0811f3c2c4e29bfd7396a7f06575642724eec35cb3610
BLAKE2b-256 checksum
How to use checksums
aee5fc79894f2e325d88c0c020589c824cd0652aef6b016fb3c03034a0819787
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release files / taeda-0.5.0-py3-none-any.whl

Download URL taeda-0.5.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0aaf72308c8599daf5b7cc41e44852eb5fab80cd9e20dbacc64053bf7383d8c
BLAKE2b-256 checksum
How to use checksums
4900a63e094a474ffde29079a51b28ec9b5afc94a3515cffd527cf1548ab4a42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Security for taeda 0.5.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.

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.

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

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