Skip to content

About

An Observability Framework for AI Training

Topics

Resources

Contributing

Stars

75 stars

Watchers

1 watching

Forks

Repository files navigation

TrainCheck logo

TrainCheck: Invariant Checking for AI Training

Chat on Discord Ask DeepWiki

TrainCheck catches silent training bugs by learning what a healthy run does, then checking a new run against those learned invariants. It works by tracing PyTorch API calls and model state changes, so you can inspect training behavior before a loss curve or final metric tells you something went wrong.

Install

Use Python 3.10 or newer. In the environment that runs your training script, install PyTorch for your CPU or GPU, then install TrainCheck from PyPI:

python -m pip install traincheck
traincheck-collect --help

See the Installation Guide for environment setup and a source install. If you use model tracking with SGD momentum, install from main for now. The fix in #177 is not in PyPI 0.2.0.

Quick Start

New to TrainCheck? Start with the guided example, which provides both scripts and shows how to interpret a real training issue.

For your own pipeline, choose a short reference run that you trust and a comparable target run. In the commands below, reference.py and target.py are your scripts (or the same script run with different settings), and model is the Python variable that holds your model. Replace these names to match your code.

# Record a known-good run and infer its invariants.
traincheck-collect --pyscript reference.py --models-to-track model --output-dir reference_trace
traincheck-infer -f reference_trace -o invariants.json

# Record the target run, then check it offline.
traincheck-collect --pyscript target.py --models-to-track model --invariants invariants.json --output-dir target_trace
traincheck-check -f target_trace -i invariants.json --output-dir check_results

Open check_results/report.html for a summary. A rule that never triggered did not establish that the target run behaved correctly. Start with short runs and inspect which rules actually ran before moving to a long training job.

The workflow guide covers live checking, step sampling, and how to choose a representative reference.

Learn More

Status

TrainCheck is under active development. Please join our Discord server, file a GitHub issue, or email traincheck@umich.edu.

Contributing

We welcome contributions. See Contributing to TrainCheck for setup and contribution guidance.

License

TrainCheck is licensed under the Apache License 2.0.

Citation

If TrainCheck is relevant to your work, please cite our paper:

@inproceedings{TrainCheckOSDI2025,
  author = {Jiang, Yuxuan and Zhou, Ziming and Xu, Boyu and Liu, Beijie and Xu, Runhui and Huang, Peng},
  title = {Training with Confidence: Catching Silent Errors in Deep Learning Training with Automated Proactive Checks},
  booktitle = {Proceedings of the 19th USENIX Symposium on Operating Systems Design and Implementation},
  series = {OSDI '25},
  month = {July},
  year = {2025},
  address = {Boston, MA, USA},
  publisher = {USENIX Association},
}

Artifact Evaluation

OSDI AE members should use the TrainCheck AE Guide.

About

An Observability Framework for AI Training

Topics

Resources

Contributing

Stars

75 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages