Skip to content

Capped validation can contain no positives, and which rows it reads changes between runs #229

Open

Description

@Vedaant-J

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

  1. Validation and test loaders are unshuffled (kumo_core/diskgraph/lightning_data.py:2006, :2446), and max_val_steps keeps the first rows (:2616-2632).
  2. 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.
  3. 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

  1. 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-stage binary_label_index (true and false node IDs) can guarantee a minimum number of positives in the sample.
  2. Warn when the validation budget is too small. For binary tasks, warn when max_val_steps × batch_size × positive rate is below about 10 expected positives. The per-stage counts are already in binary_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_steps so 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_ratio if the metric matters.
  • wheel_gpu_smoke.py uses max_val_steps=2000 and is not affected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions