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.

[tune] Unique trial identifier

See original GitHub issue

ray version 0.7.3

I am looking for a nice solution to create and access a unique identifier (UID) inside the ray.tune.Trainable class that is restored when resuming the model. It needs to be present when calling ray.tune.Trainable._setup, also when resuming the model.

The problem I want to solve: I use wandb to monitor the model training. To restore the wandb logger, I need a UID that is accessible from within the ray.tune.Trainable class such that wandb.init(..., id=UID) appends to an existing trial. wandb is initialized and resumed in ray.tune.Trainable._setup, not in ray.tune.Trainable.resume(...).

Is there an easy way to achieve this? So far I just came up with ugly hacks (e.g. deriving the UID from config passed to ray.tune.Trainable._setup). I am sure there are other use-cases for this.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
richardliawcommented, Aug 26, 2019

There is a unique id Trainable._experiment_id currently available but using it in _setup doesn’t quite fit your bill, as Eric mentioned.

The way I would do this right now if I didn’t want to modify the framework would be to do the initialization in either _train or _log_result, where you initialize the wandb logger only if you haven’t initialized already…

Maybe we can expose a “before_training” hook on Trainable, but that seems a bit cumbersome?

1reaction
ericlcommented, Aug 26, 2019

Why not re-initialize wandb after restore()? Currently there is no unique id available at setup time, nor does it really make sense to add it since we don’t know the id ahead of time prior to resume.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tune Internals — Ray 2.2.0 - the Ray documentation
Unique identifier for the trial. local_dir#. local_dir as passed to air.RunConfig() joined with ...
Read more >
tune.trial | FLAML
tune.trial ... A trial object holds the state for one model training run. ... trial_id str - Unique identifier for the trial. local_dir...
Read more >
NEP-TUNE: Neuropathic Pain - Treatment With Pregabalin ...
A type of intervention model describing a clinical trial in which groups of participants receive two or more interventions in a specific order....
Read more >
Python API Reference of Auto Tune — An open source AutoML ...
Contents. Python API Reference of Auto Tune. Trial. Tuner. Assessor ... In one experiment, both trial job ID and sequence number are unique...
Read more >
Unambiguous trial identification
Unambiguous trial identification. Clinical trials usually involve participants from more than one institution, and often more than one country.
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