V2 Semantic AST Linter, C++ GPU VRAM Profiler, Binary Search Auto-Tuner & ML Diagnostics
ML Doctor (mldoct)
AI Developer Tools & ML Infrastructure
Enterprise-grade PyTorch developer tool bridging static inspection and live GPU execution. Combines a V2 AST Data-Flow linter with automated code patching (--fix), C++ background VRAM watchdog, binary search pre-flight batch auto-tuner, and an embedded HistGradientBoostingClassifier diagnosing loss curves with 99.88% accuracy.

System Implementation
ELIMINATING SILENT BUGS & RUNAWAY GPU COMPUTE IN PYTORCH
Deep learning development is fraught with silent mathematical bugs, costly memory leaks, and unpredictable loss dynamics. Unlike conventional software where syntax bugs raise immediate exceptions, PyTorch pipelines often fail quietly—accumulating tensors in computational graphs until an OOM crash hours into training, or plateauing while consuming expensive cloud compute. ML Doctor (mldoct) was engineered as an autonomous safety net: analyzing AST data-flows compile-time, stress-testing GPU VRAM pre-flight, supervising live runs with a C++ watchdog thread, and diagnosing training collapses post-mortem.
Metrics & Architecture
Production Results
98.4%
OPTIMAL VRAM SATURATION
Pre-flight binary search stress-tests GPU memory to lock optimal batch sizes without trial-and-error OOM crashes.





99.88%
DIAGNOSTIC ACCURACY
Embedded gradient boosting classifier trained on 70,000 steps categorizes loss anomalies and outputs Markdown post-mortems.
Technical Architecture
4-PILLAR ARCHITECTURAL SAFETY NET & RUNTIME SUPERVISION
Engineered as an end-to-end command-line toolkit and programmatic Python API. Features a V2 AST rewriting engine with automated source-file patching, an nvidia-smi IPC monitoring daemon with automated Early Stopping cost protection, and HistGradientBoostingClassifier decision boundaries.
Key Technologies
- PyTorch 2.x
- Python AST (NodeVisitor)
- CUDA & nvidia-smi
- C++ IPC Daemon
- Scikit-Learn
- HistGradientBoostingClassifier
- Rich Terminal Engine
- Binary Search Auto-Tuner


Developer Focus
COMPILER-LEVEL VERIFICATION & ZERO-OVERHEAD HARDWARE PROFILING
Enforces zero-overhead runtime guarantees: compile-time AST scans execute in under 50ms, the GPU watchdog runs decoupled from the training thread to avoid throughput degradation, and pre-flight auto-tuning sweeps batch sizes mathematically before DataLoader memory allocation.
Architecture Patterns
- AST NodeVisitor Data-Flow Analysis
- Binary Search Saturation Probe
- Decoupled IPC Daemon Monitoring
- Plateau-Triggered Automated Cloud Early Stopping
- 11-Dimensional Failure Vector Classification
Installation & Execution Guide
Run ML Doctor on Your Machine
Execute compile-time AST linting with automated --fix patching, launch the background C++ GPU VRAM watchdog daemon, diagnose loss dynamics, or auto-tune batch sizes directly via Python.
Install via PyPI (Global or VirtualEnv)
Deploy the production package directly from PyPI into your Python 3.9+ / PyTorch environment.
$ pip install mldoct Collecting mldoct Downloading mldoct-1.0.0-py3-none-any.whl (28 kB) Requirement already satisfied: torch>=2.0.0 in ./site-packages Requirement already satisfied: rich>=13.0.0 in ./site-packages Requirement already satisfied: scikit-learn>=1.3.0 in ./site-packages Installing collected packages: mldoct Successfully installed mldoct-1.0.0