r/MachineLearning: preflight、label leakageやNaNを学習前に止めるPyTorch pre-training validator
Original: [P] preflight, a pre-training validator for PyTorch I built after losing 3 days to label leakage View original →
GPU時間を燃やす前に、silent failureを止めるための小さなtool
2026年3月15日、r/MachineLearningではpreflightの紹介postが56 points、13 commentsを集めた。背景はとても現実的で、training run自体はcrashせずcodeも動いていたのに、数日後になってmodelが何も学習していなかったと分かったというものだ。作者によれば原因はtrainとvalidationのlabel leakageで、その経験から、長いjobを始める前にsilent failureをまとめて検査するCLIを作った。
GitHub READMEでは、preflightは preflight run --dataloader my_dataloader.py のようなcommandで動くquick gateとして説明されている。checkは全部で10個あり、severityはFATAL、WARN、INFOの3段階。FATAL failureが1つでもあればexit code 1を返してCIを止める。公開されているcheckには nan_inf_detection、label_leakage、shape_mismatch、gradient_check、normalisation_sanity、channel_ordering、vram_estimation、class_imbalance、split_sizes、duplicate_samples が含まれる。READMEにはJSON output、GitHub Actions integration、modelやlossを追加してshapeやgradientを調べる例も載っている。
このprojectの良さはscopeの切り方にある。作者はpytestやDeepchecks、Great Expectations、WandB、MLflow、PyTorch Lightning sanity checkを置き換えるつもりはないと明言している。preflightが狙うのは、codeは動くがtrainingとしては壊れている、という狭いが非常に高価な失敗領域だ。NaN、leaking split、channel order mismatch、dead gradient、深刻なclass imbalanceのような問題は例外を投げずにcompute budgetだけを消費することが多い。そのため、学習前に最低限の安全確認を差し込む価値がある。
設定も重すぎない。thresholdは .preflight.toml で調整でき、個別checkの無効化も可能だ。roadmapには --fix によるauto-fix、dataset drift comparison、dry-run extensionなどが挙がっている。まだv0.1.xの初期toolだが、communityが関心を示した理由は明快で、長いPyTorch jobにGPUを渡す前に低コストで安全バーを上げたいという需要がはっきり存在するからだ。
Primary source: preflight GitHub repository. Community discussion: r/MachineLearning.
Related Articles
2026年3月15日のr/MachineLearningでは、PyTorch学習前に10種類のチェックを走らせるCLI「preflight」が紹介された。label leakage、NaN、gradient異常、VRAM不足見込みなどを訓練開始前に止める狙いだ。
r/MachineLearning postでは、単一のcontext managerでPyTorch runを計測し、training中にtiming、memory、rank skewを可視化するopen-source tool TraceMLが紹介された。狙いはheavyweight profilerではなく、実務向けのreal-time observabilityにある。
2026年3月15日のr/MachineLearningでは、graph topologyとfeaturesをSSDからmemory-mapし、大規模GNN datasetをRAMの外に置くC++エンジン GraphZero が注目された。
Comments (0)
No comments yet. Be the first to comment!