trainlint: static checks for silent bugs in ML training code
trainlint is an open-source static checker that parses PyTorch and scikit-learn code with ast to catch 14 non-crashing bugs, such as preprocessing leakage before the train/test split, missing eval(), and softmax before CrossEntropyLoss. On pytorch/examples…
Why it matters
Silent training bugs are costly, and this catches common ones without data, a model or a GPU.
What happened
1 min readtrainlint is an open-source static checker that parses PyTorch and scikit-learn code with ast to catch 14 non-crashing bugs, such as preprocessing leakage before the train/test split, missing eval(), and softmax before CrossEntropyLoss. On pytorch/examples, the author reports 20 real issues out of 22 findings.
Our analysis
The author is upfront about limits: name-based matching, single-file analysis, and no recall numbers, with evaluation done by the author on one tutorial repo. Linters like this complement rather than replace tests. Because it is cheap and dependency-light, it is a low-risk addition to CI for teams training PyTorch or scikit-learn models.