Skip to main content

Local-first experiment journal for the GPUPulse Mac and iPhone apps

Project description

GPUPulse Python SDK

GPUPulse is a local-first experiment journal for the GPUPulse Mac, iPhone and Android apps. Training writes only to an append-only file; it never waits for the Mac, a network request or a hosted tracking server.

Five-minute start

1. Install

python -m pip install gpupulse

During local development, install this checkout instead:

python -m pip install -e ./python

2. Add three calls

import gpupulse

run = gpupulse.init(
    project="lnet",
    name="fair-boundary",
    group="ablation-july",
    tags=["b200", "baseline"],
    notes="First run with the new sampler",
    config={"batch_size": 64, "learning_rate": 1e-4},
)

for step in range(100):
    loss, accuracy = train(step)
    gpupulse.log(
        {"loss": loss, "accuracy": accuracy},
        step=step,
        progress=(step + 1) / 100,
    )

gpupulse.finish()

The Mac collector discovers new events over the existing SSH connection. Progress, ETA, live metrics and completion alerts then appear in GPUPulse.

3. Confirm the agent

gpupulse status
gpupulse runs --limit 10

The default journal is ~/.gpupulse/journal/events.jsonl. Override it with GPUPULSE_JOURNAL.

Context manager

from gpupulse import Run

with Run(project="lnet", name="fair-boundary", tags=["nightly"]) as run:
    run.config({"batch_size": 64})
    for step in range(100):
        run.log({"loss": 1 / (step + 1)}, step=step, progress=(step + 1) / 100)

Exceptions and SIGTERM are recorded as failures. A normal context exit records success.

Decorator

import gpupulse

@gpupulse.track(project="research", tags=["quick-check"], inject_run=True)
def train_model(dataset, run=None):
    run.config({"dataset": dataset.name})
    ...

Both synchronous and async functions are supported. The original exception is always re-raised after it is journaled.

PyTorch Lightning

from gpupulse import GPUPulseLightningCallback

trainer = Trainer(callbacks=[
    GPUPulseLightningCallback(
        project="vision",
        name="resnet50",
        group="imagenet-sweep",
        tags=["lightning", "b200"],
    )
])

The callback reads callback_metrics, global_step and estimated_stepping_batches. GPUPulse does not import or install Lightning itself.

Hugging Face Trainer

from gpupulse import GPUPulseTrainerCallback

trainer = Trainer(
    ...,
    callbacks=[GPUPulseTrainerCallback(
        project="llm",
        name="lora-7b",
        tags=["transformers", "lora"],
    )],
)

on_log values become GPUPulse metrics and global_step / max_steps becomes progress.

Journal operations

gpupulse status --json
gpupulse runs --project lnet --limit 20 --json
gpupulse export --since 0 --format jsonl
gpupulse prune --keep-days 30

Set retention_days=30 on Run, or set GPUPULSE_RETENTION_DAYS=30, to prune at most once per day. Pruning changes the cursor generation so a Mac holding an older cursor safely re-reads retained events instead of skipping them.

Privacy and performance

  • No network dependency is added to training.
  • Metric calls use a bounded background queue and never wait for disk.
  • Config keys containing passwords, secrets, tokens, API keys or credentials are recursively redacted.
  • Use config_allowlist=[...] when only explicitly approved config keys should be stored.
  • SSH credentials, full commands and working directories are never written by this SDK.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpupulse-0.3.1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpupulse-0.3.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file gpupulse-0.3.1.tar.gz.

File metadata

  • Download URL: gpupulse-0.3.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gpupulse-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d201c513dcdf8ed6542dc623bc60ded8e77a2b957ea232e7f25cb5cb40e69a35
MD5 1148cf6e35df7022e92bb89f67f6cca7
BLAKE2b-256 53480c095def431bb7013a94aaa1e469eb6b0868b53ec4508b8c0d5ed2a772c6

See more details on using hashes here.

File details

Details for the file gpupulse-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: gpupulse-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gpupulse-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f044d0bb784845d50791e214e3d8fe43691e0a9a683829580801429e749f16b0
MD5 dc01d03b0a538db7adffc264f9741caa
BLAKE2b-256 046b393fd06130d9e70ae1c7165639e102333b3933038b69a58bfb762c3da5f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page