Repository navigation
Open
Description
Capped validation can contain no positives, and which rows it reads changes between runs
What happens
A binary-classification fit with max_val_steps set low enough fails or passes depending on the run, with the same commit, data and manual_seed. On a 100M-row payments graph (0.06% positive rate), max_val_steps=10 at batch 64 gave:
| Run | Validation rows read | Positives among them | Result |
|---|---|---|---|
| 1 | first 640 rows, starting in part 3 | 0 | val_auroc NaN, No valid trials found |
| 2 | first 640 rows, starting in part 6 | 1 | val_auroc 0.296, fit succeeds |
The training table was identical in both runs. Labels were checked against an independent recomputation, and the validation anchor has 1,020 positives in 1.70M rows.
Why
- Validation and test loaders are unshuffled (
kumo_core/diskgraph/lightning_data.py:2006,:2446), andmax_val_stepskeeps the first rows (:2616-2632). - Which rows come first depends on how training-table generation wrote its parts and on ingest order, not on
manual_seed. The first part read was part 3, 6 and 0 in three runs. - A 640-row window at a 0.06% positive rate contains no positives about 68% of the time, so AUROC and AP are undefined (
kumo_core/evaluation/classification.py:22-36).
The row order itself is not biased: positive rates are flat across entity-ID deciles, and contiguous windows behave like random draws.
Proposed changes
- Make capped validation and test reproducible. Draw the capped rows as a seeded sample controlled by
manual_seed, instead of taking the head of the ingested table. For binary tasks, the existing per-stagebinary_label_index(true and false node IDs) can guarantee a minimum number of positives in the sample. - Warn when the validation budget is too small. For binary tasks, warn when
max_val_steps × batch_size × positive rateis below about 10 expected positives. The per-stage counts are already inbinary_label_index.
A separate PR makes the error for the all-NaN case name this cause.
Guidance for smoke and scale tests until then
- Choose
max_val_stepsso that validation rows × positive rate is at least about 10. At 0.06% and batch 64 that is about 260 steps. 100 steps still gives no positives about 2–3% of the time. - Or set
tune_metric='loss'for runs that only check the pipeline. - With 1,920 training rows at 0.06%, training sees about 1 positive, so the AUROC from such a run says nothing about model quality. Set
majority_sampling_ratioif the metric matters. wheel_gpu_smoke.pyusesmax_val_steps=2000and is not affected.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Name the cause when every trial's tune metric is NaN (#230)