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 payloadstrainsight/core/bus.py- Synchronous event bustrainsight/core/async_bus.py- Non-blocking async event bustrainsight/core/dispatcher.py- Collector orchestrationtrainsight/collectors/gpu_collector.py- NVIDIA GPU metricstrainsight/analyzers/- Anomaly and bottleneck detectiontrainsight/predictors/oom_predictor.py- OOM predictiontrainsight/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf54feb7fbc1e68129a5fe25c33076da8e4d161603e5f3c056985c3062630b2d
|
|
| MD5 |
696faa93695eb8f77cf3491525bcf241
|
|
| BLAKE2b-256 |
49fc51682fad5f108aa8b2db47d6dcc5b82d0fedf0baa2903a39749559dc66d8
|
Provenance
The following attestation bundles were made for trainsight-0.2.0.tar.gz:
Publisher:
publish.yml on modalgrasp/trainsight
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trainsight-0.2.0.tar.gz -
Subject digest:
bf54feb7fbc1e68129a5fe25c33076da8e4d161603e5f3c056985c3062630b2d - Sigstore transparency entry: 972910992
- Sigstore integration time:
-
Permalink:
modalgrasp/trainsight@0e0bb8fd635c9649f685f8b2b65b91abed6c007b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/modalgrasp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e0bb8fd635c9649f685f8b2b65b91abed6c007b -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
043837d009848a9102940d81cd51ebd8e104d33db30e447a9a7bb8ce83024454
|
|
| MD5 |
6cea895b6e5aabe6cf4c46dea92bfff1
|
|
| BLAKE2b-256 |
ae49e86aef49c36d39827053b9b03972e53c6af43a8a6022238aec61ddf3e69f
|
Provenance
The following attestation bundles were made for trainsight-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on modalgrasp/trainsight
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trainsight-0.2.0-py3-none-any.whl -
Subject digest:
043837d009848a9102940d81cd51ebd8e104d33db30e447a9a7bb8ce83024454 - Sigstore transparency entry: 972911007
- Sigstore integration time:
-
Permalink:
modalgrasp/trainsight@0e0bb8fd635c9649f685f8b2b65b91abed6c007b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/modalgrasp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e0bb8fd635c9649f685f8b2b65b91abed6c007b -
Trigger Event:
release
-
Statement type: