trainsight is a sub-millisecond pre-flight data validation framework, CLI tool, and Kubernetes InitContainer. It profiles LLM pre-training and post-training dataset manifests (SFT, DPO, GRPO) before allocating GPUs, predicting HBM Out-of-Memory (OOM) crashes, padding memory waste, throughput degradation, and attention entropy dispersion in <0.01 ms CPU execution time.
TrainSight is built on the Two-Factor Law of LLM Compute (ICLR Submission Draft), proving that LLM compute efficiency and representation stability under hardware constraints are governed by two independent failure modes:
-
Failure Mode 1: Batch Padding Memory Waste
$\to$ Driven independently by sequence-length variance ratio ($\sigma/\mu$ ). -
Failure Mode 2: Throughput Collapse & Attention Entropy Inflation
$\to$ Driven independently by tail quantiles ($P_{99}$ ).
| Low |
High |
|
|---|---|---|
| Low |
Clean Execution (GSM8K, FineWeb) • Waste |
Throughput Collapse & Entropy Inflation (ShareGPT) • Waste |
| High |
Padding Memory Waste Only (Alpaca) • Waste |
Dual Catastrophic Failure / OOM Crash (Heavy-Tail Corpus) • Waste |
| Feature / Dimension | Before (Old Pre-Flight Heuristics) | After (TrainSight Two-Factor Framework) |
|---|---|---|
| Scientific Paradigm | Single-metric assumption (assumed |
Disentangled Two-Factor Law: |
| Failure Detection | Reactive: Jobs crash on GPUs after hours of execution. |
Proactive: Predicts OOM crashes & waste in |
| OOM Prediction Accuracy | Heuristic guesses / manual trial and error. |
Empirical |
| Representation Stability | Ignored representation quality; assumed static data is fine. | Tracks Attention Entropy Inflation ($H(A)$) caused by padding token dispersion. |
| Mitigation Strategy | Truncate sequences manually, risking data loss. |
Zero-Loss Length Packing / Sorting: Recovers |
| Production Integration | Standalone Python scripts. | CLI + Kubernetes InitContainer: Gates pod scheduling before GPU nodes are billed. |
Evaluated on EleutherAI/pythia-160m across controlled synthetic grids and 5 production datasets:
| Dataset | Realized |
|
TrainSight Risk | Actual Pad Waste % | Actual Attention Entropy |
Throughput (tok/s) | Empirical Status |
|---|---|---|---|---|---|---|---|
| GSM8K | 0.280 | 242 tok | MODERATE | 20.32% | 1.4544 | 1,961.7 | Clean Execution |
| HumanEval | 0.316 | 243 tok | MODERATE | 27.84% | 1.4045 | 1,798.3 | Clean Execution |
| FineWeb-Edu | 0.236 | 525 tok | LOW | 17.43% | 1.6037 | 1,649.7 | Clean Execution |
| ShareGPT | 0.377 | 1,077 tok | MODERATE | 26.56% | 1.8365 | 867.5 (-55.8%) | Throughput Collapse |
| Alpaca | 0.802 | 228 tok | CRITICAL | 41.51% | 1.1808 | 1,402.8 | Padding Memory Waste |
# Profile an SFT dataset manifest
trainsight profile --dataset sample_data/sample_sft.jsonl --type sft
# Profile a DPO preference dataset
trainsight profile --dataset sample_data/sample_dpo.jsonl --type dpo
# Profile GSM8K math reasoning data
trainsight profile --dataset sample_data/sample_gsm8k.jsonl --type sftinitContainers:
- name: trainsight-preflight-checker
image: trainsight/checker:latest
command: ["trainsight", "validate", "--manifest", "/data/sft_manifest.json", "--max-waste-pct", "30"]