Skip to main content

AI Training Intelligence Dashboard - Live GPU telemetry, anomaly detection, and training diagnostics

Project description

TrainSight

AI Training Intelligence Dashboard for live GPU telemetry, anomaly detection, and training-oriented diagnostics.

Features

  • Live GPU Monitoring: Real-time GPU utilization, memory, temperature, and power metrics
  • Anomaly Detection: Automatic detection of thermal throttling, memory leaks, and training anomalies
  • OOM Prediction: Predict Out-of-Memory errors before they crash your training
  • Framework Integrations: Native support for PyTorch, Lightning, HuggingFace, DeepSpeed, Accelerate, Ray Train
  • Experiment Tracking: Bridge to MLflow and Weights & Biases
  • Production Ready: Prometheus exporter, Kubernetes GPU pod monitoring, cloud cost estimation
  • Batch Size Optimization: Automatic batch size recommendation based on GPU memory

Installation

From PyPI (Recommended)

pip install trainsight

From GitHub

pip install git+https://github.com/modalgrasp/trainsight.git

Optional Dependencies

Install only what you need:

# PyTorch integration
pip install "trainsight[pytorch]"

# PyTorch Lightning integration
pip install "trainsight[lightning]"

# DeepSpeed integration
pip install "trainsight[deepspeed]"

# HuggingFace Accelerate integration
pip install "trainsight[accelerate]"

# Ray Train integration
pip install "trainsight[ray]"

# Experiment tracking
pip install "trainsight[mlflow]"
pip install "trainsight[wandb]"

# Kubernetes monitoring
pip install "trainsight[kubernetes]"

# Install everything
pip install "trainsight[all]"

Quick Start

CLI Dashboard

trainsight

Programmatic Usage

from trainsight import Dashboard
from trainsight.core.bus import EventBus
from trainsight.collectors.gpu_collector import GPUCollector

# Create event bus and collector
bus = EventBus()
collector = GPUCollector()

# Subscribe to GPU events
def on_gpu_stats(event):
    print(f"GPU Util: {event.payload['utilization']}%")

bus.subscribe("gpu.stats", on_gpu_stats)

# Start dashboard
# dashboard = Dashboard(bus, collector)
# dashboard.run()

PyTorch Integration

import torch
from trainsight.integrations.pytorch import TrainSightHook

model = torch.nn.Linear(100, 10)
hook = TrainSightHook(model)

# Hook automatically monitors gradients and activations
output = model(torch.randn(32, 100))
output.backward()

PyTorch Lightning Integration

import pytorch_lightning as pl
from trainsight.integrations.lightning import TrainSightCallback

trainer = pl.Trainer(
    callbacks=[TrainSightCallback()],
    max_epochs=10,
)
trainer.fit(model)

HuggingFace Transformers Integration

from transformers import Trainer, TrainingArguments
from trainsight.integrations.huggingface import TrainSightCallback

training_args = TrainingArguments(
    output_dir="./output",
    callbacks=[TrainSightCallback],
)
trainer = Trainer(model=model, args=training_args)

Architecture

Collectors -> EventBus -> Analyzers -> Predictors -> Dashboard / CLI / Logger

Core modules:

  • trainsight/core/event.py - Event types and payloads
  • trainsight/core/bus.py - Synchronous event bus
  • trainsight/core/async_bus.py - Non-blocking async event bus
  • trainsight/core/dispatcher.py - Collector orchestration
  • trainsight/collectors/gpu_collector.py - NVIDIA GPU metrics
  • trainsight/analyzers/ - Anomaly and bottleneck detection
  • trainsight/predictors/oom_predictor.py - OOM prediction
  • trainsight/integrations/ - Framework integrations

Configuration

Default config: trainsight/config/default.yaml

mode: full
enable_behavior_learning: true
oom_model: statistical
thermal_limit: 85
refresh_rate: 30

Prometheus Exporter

Enable in config:

enable_prometheus: true
prometheus_port: 9108

Metrics endpoint: http://127.0.0.1:9108/metrics

Official Build Verification

  • Soft check (default): warns on signature/hash mismatch.
  • Strict mode: refuses startup when verification fails.

Enable strict mode:

export TRAINSIGHT_OFFICIAL_ONLY=1

Or in config:

strict_official_build: true

Plugin System

Create ~/.trainsight/plugins/my_plugin.py:

def register(bus):
    bus.subscribe("gpu.stats", custom_handler)

def custom_handler(event):
    print("Custom plugin:", event.payload)

Debug / Simulation / Replay

trainsight --debug
trainsight --simulate
trainsight --replay gpu_usage_log.csv

Textual inspector:

TEXTUAL_DEVTOOLS=1 trainsight --debug

Testing

Install dev dependencies and run tests:

pip install -e ".[dev]"
pytest -q

Tests are hardware-independent and use pure logic paths.

License

TrainSight Community License v1.0 - See LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

trainsight-0.2.0.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

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

trainsight-0.2.0-py3-none-any.whl (51.8 kB view details)

Uploaded Python 3

File details

Details for the file trainsight-0.2.0.tar.gz.

File metadata

  • Download URL: trainsight-0.2.0.tar.gz
  • Upload date:
  • Size: 42.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trainsight-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bf54feb7fbc1e68129a5fe25c33076da8e4d161603e5f3c056985c3062630b2d
MD5 696faa93695eb8f77cf3491525bcf241
BLAKE2b-256 49fc51682fad5f108aa8b2db47d6dcc5b82d0fedf0baa2903a39749559dc66d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for trainsight-0.2.0.tar.gz:

Publisher: publish.yml on modalgrasp/trainsight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trainsight-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: trainsight-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 51.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trainsight-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 043837d009848a9102940d81cd51ebd8e104d33db30e447a9a7bb8ce83024454
MD5 6cea895b6e5aabe6cf4c46dea92bfff1
BLAKE2b-256 ae49e86aef49c36d39827053b9b03972e53c6af43a8a6022238aec61ddf3e69f

See more details on using hashes here.

Provenance

The following attestation bundles were made for trainsight-0.2.0-py3-none-any.whl:

Publisher: publish.yml on modalgrasp/trainsight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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