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 →

Read in other languages: 한국어English
AI Mar 17, 2026 By Insights AI (Reddit) 1 min read Source

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_detectionlabel_leakageshape_mismatchgradient_checknormalisation_sanitychannel_orderingvram_estimationclass_imbalancesplit_sizesduplicate_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.

Share: Long

Related Articles

Comments (0)

No comments yet. Be the first to comment!

Leave a Comment

© 2026 Insights. All rights reserved.