[tune] Tweaks to Trainable and Verbosity#2889
[tune] Tweaks to Trainable and Verbosity#2889richardliaw merged 23 commits intoray-project:masterfrom
Conversation
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
5aa5dca to
f8a2f52
Compare
|
Test FAILed. |
|
This is ready for review - not totally sure what we want for
|
|
Test FAILed. |
|
Test PASSed. |
|
Test PASSed. |
| def _save(self, checkpoint_dir): | ||
| """Subclasses should override this to implement save(). | ||
|
|
||
| See also: ray.tune.Trainable.save_dict. |
There was a problem hiding this comment.
I'm not super sure that's useful -- how about we say you can also return a dict, and if so it will be auto saved?
| would default to `checkpoint_dir`. | ||
| checkpoint_path: The checkpoint path that will be | ||
| passed to restore(). This can be different from | ||
| checkpoint_dir. |
There was a problem hiding this comment.
Do we actually have a use case for it being different? It would be nice to add a check that checkpoint_path is a child of checkpoint_dir.
|
Test PASSed. |
|
Test FAILed. |
ericl
left a comment
There was a problem hiding this comment.
Main question is whether the dict is correct since it needs to include the iteration id.
There was a problem hiding this comment.
The checkpoint path needs to include the current iteration right? Otherwise they will collide?
|
Test FAILed. |
| "episodes_total": self._episodes_total, | ||
| "saved_as_dict": saved_as_dict | ||
| }, open(checkpoint_path + ".tune_metadata", "wb")) | ||
| self._checkpoint_num += 1 |
There was a problem hiding this comment.
I'm not sure if that makes sense when you do checkpoint_at_end... you get something like experiment/checkpoint_433.pkl
|
The convention has always been iter in rllib though... Also did you
guarantee that id increases monotonically like iter does?
…On Wed, Oct 3, 2018, 6:01 PM Richard Liaw ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In python/ray/tune/trainable.py
<#2889 (comment)>:
> @@ -225,10 +228,16 @@ def save(self, checkpoint_dir=None):
"wb"))
else:
raise ValueError("Return value from `_save` must be dict or str.")
- pickle.dump([
- self._experiment_id, self._iteration, self._timesteps_total,
- self._time_total, self._episodes_total, saved_as_dict
- ], open(checkpoint_path + ".tune_metadata", "wb"))
+ pickle.dump({
+ "experiment_id": self._experiment_id,
+ "iteration": self._iteration,
+ "checkpoint_num": self._checkpoint_num,
+ "timesteps_total": self._timesteps_total,
+ "time_total": self._time_total,
+ "episodes_total": self._episodes_total,
+ "saved_as_dict": saved_as_dict
+ }, open(checkpoint_path + ".tune_metadata", "wb"))
+ self._checkpoint_num += 1
I'm not sure if that makes sense when you do checkpoint_at_end... you get
something like experiment/checkpoint_433.pkl
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#2889 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAA6SvFxmhsvE7GwmxftUIny2c6YFrosks5uhV4GgaJpZM4WqRfk>
.
|
|
Yep, all Trial ids increase monotonically now as of a previous PR (#2874)... how strongly do you feel about using |
|
Using iteration is a must.
…On Wed, Oct 3, 2018, 10:42 PM Richard Liaw ***@***.***> wrote:
Yep, all Trial ids increase monotonically now as of a previous PR... how
strongly do you feel about using self.iteration as checkpoint index?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#2889 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAA6SteN8_yzmTrPwe1zLjv19EZX4DrNks5uhZ_bgaJpZM4WqRfk>
.
|
|
Test FAILed. |
|
|
||
| test_trainable = TestTrain() | ||
| checkpoint_1 = test_trainable.save() | ||
| import ipdb; ipdb.set_trace(context=5) |
There was a problem hiding this comment.
(you reviewed an older version of the code), see most recent 2 commits
|
Test PASSed. |
|
Test PASSed. |
|
Errors unrelated |
Fix HyperOpt verbosity (hopefully), and tweak Trainable.
TODOs:
From Ray-dev discussion: We should increase the clarity on the docs.
https://groups.google.com/forum/#!topic/ray-dev/wx5zdzbgMfs
"Suggestion Algorithms like HyperOpt don't extend the VariantGenerator so
lambda spec: ..."Clean up HyperOptSearch (don't expose
add_configurations)Clean up HyperBand documentation
Provide a better error when a config is mis-specified.
#2870 #2888.