Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 32 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,95 +13,64 @@ TrainCheck catches silent training bugs by learning what a healthy run does, the

## Install

Install TrainCheck in the same Python environment that runs your training script:
Use Python 3.10 or newer. In the environment that runs your training script,
[install PyTorch](https://pytorch.org/get-started/locally/) for your CPU or GPU,
then install TrainCheck from [PyPI](https://pypi.org/project/traincheck/):

```bash
pip3 install traincheck
python -m pip install traincheck
traincheck-collect --help
```

For CUDA, conda, and source-install details, see the [Installation Guide](https://orderlab.io/TrainCheck/installation-guide/).
See the [Installation Guide](https://orderlab.io/TrainCheck/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](https://github.com/OrderLab/TrainCheck/pull/177) is not in PyPI 0.2.0.

## Use TrainCheck
## Quick Start

TrainCheck has four main steps.
New to TrainCheck? Start with the [guided example](https://orderlab.io/TrainCheck/5-min-tutorial/),
which provides both scripts and shows how to interpret a real training issue.

### 1. Collect a Reference Trace

Run `traincheck-collect` on a known-good training script. This should be a short run that covers the training behavior you want TrainCheck to learn.

```bash
traincheck-collect \
--pyscript reference.py \
--models-to-track model \
--output-dir reference_trace
```

### 2. Infer Invariants

Turn the reference trace into invariants:
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.

```bash
# 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
```

### 3. Collect a Target Trace

Run the target training script with the inferred invariants. Passing `--invariants` lets TrainCheck trace only the APIs and variables needed for those checks.

```bash
traincheck-collect \
--pyscript target.py \
--models-to-track model \
--invariants invariants.json \
--output-dir target_trace
```

For long target runs, trace fewer steps:

```bash
traincheck-collect \
--pyscript target.py \
--models-to-track model \
--invariants invariants.json \
--sampling-interval 10 \
--warm-up-steps 10 \
--output-dir target_trace
# 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
```

### 4. Check the Target Run

For live checking, start `traincheck-onlinecheck` while the target run is writing traces:

```bash
traincheck-onlinecheck -f target_trace -i invariants.json
```

The easier offline path is to wait for trace collection to finish, then run:

```bash
traincheck-check -f target_trace -i invariants.json
```
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.

Both checkers write a results directory with failure logs and a `report.html` summary.
The [workflow guide](https://orderlab.io/TrainCheck/usage-guide/) covers live
checking, step sampling, and how to choose a representative reference.

## Learn More

- [Use TrainCheck](https://orderlab.io/TrainCheck/usage-guide/) explains the full workflow and output files.
- [5-Minute Tutorial](./docs/5-min-tutorial.md) walks through a real silent training issue.
- [Installation Guide](https://orderlab.io/TrainCheck/installation-guide/) covers environment setup.
- [CLI reference](https://orderlab.io/TrainCheck/instr/) describes trace-collection options.
- [Technical Documentation](https://orderlab.io/TrainCheck/technical-doc/) describes invariants, trace representation, and implementation details.

## Status

TrainCheck is under active development. Please join our [Discord server](https://discord.gg/VwxpJDvB), file a GitHub issue, or email [traincheck@umich.edu](mailto:traincheck@umich.edu).
TrainCheck is under active development. Please join our [Discord server](https://discord.gg/ZvYewjsQ9D), [file a GitHub issue](https://github.com/OrderLab/TrainCheck/issues), or email [traincheck@umich.edu](mailto:traincheck@umich.edu).

## Contributing

We welcome contributions. See [Contributing to TrainCheck](./CONTRIBUTING.md) for setup and contribution guidance.
We welcome contributions. See [Contributing to TrainCheck](https://github.com/OrderLab/TrainCheck/blob/main/CONTRIBUTING.md) for setup and contribution guidance.

## License

TrainCheck is licensed under the [Apache License 2.0](./LICENSE).
TrainCheck is licensed under the [Apache License 2.0](https://github.com/OrderLab/TrainCheck/blob/main/LICENSE).

## Citation

Expand All @@ -122,4 +91,4 @@ If TrainCheck is relevant to your work, please cite our paper:

## Artifact Evaluation

OSDI AE members should use the [TrainCheck AE Guide](./docs/ae.md).
OSDI AE members should use the [TrainCheck AE Guide](https://github.com/OrderLab/TrainCheck/blob/main/docs/ae.md).
Loading