question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preemptible instances support of `optuna tell`.

See original GitHub issue

Motivation

When using optuna ask&tell on preemptible instances, optuna tell can raise RuntimeError on preemption because the trial can be already in one of finished state after preemption.

... # Some codes
optuna tell --storage $OPTUNA_STORAGE --study-name mystudy --trial-number 0 --values 1.0  # error in the second run
# <- preemption in the first run
... # Other codes

Description

Return a different exit code when the trial is already in a finished state so that users can distinguish errors caused by preemption and others (e.g., connection error to DB).

Alternatives

  • Check the trial’s state and values first and avoid calling study.tell() when the requested (state, values) are identical to the current value of the trial.
    • Concern: Comparison of values can be problematic due to precision issues of numerical values.
  • Guide users to write python script and use study.tell + try-catch on preemptible instances. (I’m currently using this.)

Additional context

I’m not quite sure a common way to handle this kind of situation and love to hear others’ voice.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
hvycommented, Nov 29, 2021

It should be easy to implement, let me work on that.

1reaction
ytsmilingcommented, Nov 29, 2021

Thank you for creating the PR! Let me take a look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ask-and-Tell Interface — Optuna 3.0.5 documentation
Optuna has an Ask-and-Tell interface, which provides a more flexible interface for hyperparameter optimization. This tutorial explains three use-cases when ...
Read more >
Running an Experiment - Kubeflow
This guide describes how to configure and run a Katib experiment. The experiment can perform hyperparameter tuning or a neural architecture ...
Read more >
RubberBand: cloud-based hyperparameter tuning
It is worth noting that scheduling hyperparameter optimization jobs will not be considered as single job optimization, because it involves a ...
Read more >
Optuna Guide: How to Monitor Hyper-Parameter Optimization ...
For k hyper-parameters, after N experiments, we use the best, say, 25% of the trials (best here is decided according to the metric...
Read more >
University of Groningen Text Similarity Between Concepts Extracted ...
support, sponsorship, and collaboration from Springer LNCS are also greatly ... percentage between the number of instances of the most represented class and....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found