Installation
Install with TUI support:requirements-dev.txt.
Launch the TUI
Start the interactive dashboard:Interface overview
The TUI provides six main tabs:- Overview
- PyTorch
- TensorFlow
- Monitoring
- Visualizations
- CLI & Actions
Live system summary showing:
- Platform information (OS, Python version)
- PyTorch/TensorFlow versions
- GPU availability and configuration
- Current memory snapshot
- Backend detection (CUDA, ROCm, MPS, CPU)
r to refreshKeyboard shortcuts
Global shortcuts available in all tabs:| Key | Action |
|---|---|
r | Refresh overview tab |
f | Focus the log panel |
g | Log gpumemprof info output |
t | Log tfmemprof info output |
q | Quit the TUI |
Live tracking workflow
Configure thresholds
Adjust warning and critical thresholds using the sliders:
- Warning threshold: Default 80%
- Critical threshold: Default 95%
Enable auto cleanup (optional)
Toggle Auto Cleanup to enable
MemoryWatchdog:- Monitors memory thresholds
- Triggers
torch.cuda.empty_cache()on warnings - Runs garbage collection on critical alerts
- Force Cleanup: Clear CUDA cache
- Aggressive Cleanup: Cache clear + GC
Start tracking
Click Start Live Tracking button.The TUI:
- Creates
MemoryTrackerinstance - Begins sampling at configured interval
- Streams events to log panel
- Updates statistics table
Monitor in real-time
Watch the stats table update every second:
- Current memory allocation
- Peak memory reached
- Utilization percentage
- Total alert count
Export data
While tracking is active or after stopping:
- Export CSV: Save to
./exports/tracking_TIMESTAMP.csv - Export JSON: Save to
./exports/tracking_TIMESTAMP.json
Visualization workflow
Refresh timeline
Click Refresh Timeline to generate ASCII visualization:
- Reads current tracking session data
- Renders memory timeline as text graph
- Shows summary statistics
Generate static plot
Click Generate PNG Plot to create Matplotlib visualization:
- Saves to
./visualizations/memory_timeline_TIMESTAMP.png - Includes allocated and reserved memory
- High-resolution (300 DPI)
- X-axis: Time (seconds)
- Y-axis: Memory (GB)
- Two subplots: Allocated vs Reserved
CLI automation workflow
Use quick actions
Click preset buttons:Diagnose:Generates diagnostic bundle in seconds.OOM Scenario:Runs safe OOM flight recorder test.Capability Matrix:Executes smoke test suite.
Profile inspection workflow
Refresh profiles in TUI
Switch to PyTorch or TensorFlow tab and click Refresh Profiles.The TUI queries global profiler instances used by decorators.
Review profiling results
Profile table shows:
- Function name from decorator
- Peak memory during execution
- Memory delta (allocated - freed)
- Average execution duration
GPU-less environments
The TUI gracefully handles systems without GPU:CPU-only systems
CPU-only systems
When no GPU is detected:
- Overview tab shows “GPU Available: No”
- Displays CPU count and memory instead
- Monitoring tab uses
CPUMemoryTracker - CLI commands automatically use CPU mode
Apple Silicon (MPS)
Apple Silicon (MPS)
On macOS with Apple Silicon:
- Detects MPS backend availability
- Shows Metal plugin installation status
- Provides installation hints if missing
- Uses single logical device
ROCm systems
ROCm systems
For AMD GPUs with ROCm:
- Detects ROCm backend
- Shows ROCm version
- Full profiling support
- Same interface as CUDA
Terminal requirements
For optimal TUI experience:- Minimum size: 100x30 characters
- Color support: 256 colors or true color
- Unicode support: UTF-8 encoding
- Terminal: Modern terminal emulators
- iTerm2 (macOS)
- Windows Terminal
- GNOME Terminal
- Alacritty
- Kitty
Troubleshooting
Missing dependency error
Missing dependency error
GPU metrics unavailable
GPU metrics unavailable
Terminal too small warning
Terminal too small warning
TUI layout appears compressed.Solution:
- Maximize terminal window
- Zoom out (Cmd/Ctrl + -)
- Use fullscreen mode
- Minimum recommended: 100x30
Tracking not starting
Tracking not starting
“Start Live Tracking” button doesn’t respond.Check:
- PyTorch installed correctly
- No other profilers running
- Check error in log panel
- Restart TUI
Next steps
CLI usage
Learn command-line profiling tools
Visualization
Generate plots outside the TUI
PyTorch guide
PyTorch profiling APIs
TensorFlow guide
TensorFlow profiling APIs