Skip to content

Multi fidelity is not "multi" for some fidelity boundaries #138

@AwePhD

Description

@AwePhD

Hi,

The multi-fidelity by PriorBand is not applied correctly, probably because I did not configure the Optimizer. I would like to know if it's normal or I misunderstood something about the multi-fidelity setup in NePS.

Here a Python script that reproduces the behaviour with neps 0.12.2:

from pathlib import Path
from neps import IntegerParameter, FloatParameter, run

MIN_EPOCH, MAX_EPOCH, TOTAL_BUDGET_EPOCHS = ..., ..., ...

pipeline_space = {
    "epoch": IntegerParameter(lower=MIN_EPOCH, upper=MAX_EPOCH, is_fidelity=True),
    "p1": IntegerParameter(lower=5, upper=15, default=10),
    "p2": FloatParameter(lower=.5, upper=5, default=3),
}


def run_pipeline(epoch, p1, p2) -> dict | float:
    loss = (p1 + p2) / epoch

    return {"loss": loss, "cost": epoch}


def main():
    run(
        run_pipeline=run_pipeline,
        pipeline_space=pipeline_space,
        root_directory=Path("/tmp/debug_neps_fidelity"),
        max_cost_total=TOTAL_BUDGET_EPOCHS,
    )


if __name__ == '__main__':
    main()

When I run with various values for the boundaries I have different numbers of fidelity (it's called rungs, right?):

# 9 configs, all with 200 epochs
MIN_EPOCH, MAX_EPOCH, TOTAL_BUDGET_EPOCHS = 80, 200, 2_000
# 11 configs and 2 configs reach 3 trials, 2 reach 2 trials and the rest have one trial 
MIN_EPOCH, MAX_EPOCH, TOTAL_BUDGET_EPOCHS = 1, 10, 40

The first example is important for debugging when I take a tiny subset of my dataset for debugging purpose. I need a lot of epochs to overfit the model (+300M parameters) on few samples, before 80 epochs the model is not learning at all. It seems that the fidelity starts at 80 is a problem? Is it an expected ((multi-))fidelity strategy? Is it because the ratio for computing the number of rungs is max_fidelity/min_fidelity? (I read that from PriorBand paper if I remember well).

Should I setup the eta parameter? By the way, I am happy about the second example, which represents an actual training on the whole dataset.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions