From 6e9dfd9b87358e2776821a4408537fc8dd85ecd2 Mon Sep 17 00:00:00 2001 From: Kai Fricke Date: Tue, 23 May 2023 20:59:41 +0100 Subject: [PATCH] [air/output] Switch on per default (#35389) After #35129 prepared the switch, this PR actually flicks it: It enables the new context-aware output engine per default. This was moved into a separate PR so it's easily revertible and can be enabled quickly after branch cut. Signed-off-by: Kai Fricke --- doc/source/ray-air/experimental-features.rst | 4 ++-- python/ray/air/config.py | 10 +++++----- python/ray/tune/experimental/output.py | 5 ++++- python/ray/tune/tune.py | 10 +++++----- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/doc/source/ray-air/experimental-features.rst b/doc/source/ray-air/experimental-features.rst index b8c338fee2907..30945213d7b26 100644 --- a/doc/source/ray-air/experimental-features.rst +++ b/doc/source/ray-air/experimental-features.rst @@ -33,9 +33,9 @@ Context-aware progress reporting .. note:: - This feature is *disabled by default* in Ray 2.5. + This feature is *enabled by default* in Ray 2.6. - To enable, set the environment variable ``RAY_AIR_NEW_OUTPUT=1``. + To disable, set the environment variable ``RAY_AIR_NEW_OUTPUT=0``. A context-aware output engine is available for Ray Train and Ray Tune runs. diff --git a/python/ray/air/config.py b/python/ray/air/config.py index c1fa930ea67d0..fe97085fec807 100644 --- a/python/ray/air/config.py +++ b/python/ray/air/config.py @@ -727,12 +727,12 @@ class RunConfig: intermediate experiment progress. Defaults to CLIReporter if running in command-line, or JupyterNotebookReporter if running in a Jupyter notebook. - verbose: 0, 1, 2, or 3. Verbosity mode. - 0 = silent, 1 = only status updates, 2 = status and brief - results, 3 = status and detailed results. Defaults to 3. + verbose: 0, 1, or 2. Verbosity mode. + 0 = silent, 1 = default, 2 = verbose. Defaults to 1. If the ``RAY_AIR_NEW_OUTPUT=1`` environment variable is set, - uses the new context-aware verbosity settings: - 0 = silent, 1 = default, 2 = verbose. + uses the old verbosity settings: + 0 = silent, 1 = only status updates, 2 = status and brief + results, 3 = status and detailed results. log_to_file: Log stdout and stderr to files in trial directories. If this is `False` (default), no files are written. If `true`, outputs are written to `trialdir/stdout` diff --git a/python/ray/tune/experimental/output.py b/python/ray/tune/experimental/output.py index 75f661126a3e7..58c80b5201b47 100644 --- a/python/ray/tune/experimental/output.py +++ b/python/ray/tune/experimental/output.py @@ -99,6 +99,9 @@ class AirVerbosity(IntEnum): DEFAULT = 1 VERBOSE = 2 + def __repr__(self): + return str(self.value) + IS_NOTEBOOK = ray.widgets.util.in_notebook() @@ -106,7 +109,7 @@ class AirVerbosity(IntEnum): def get_air_verbosity( verbose: Union[int, AirVerbosity, Verbosity] ) -> Optional[AirVerbosity]: - if os.environ.get("RAY_AIR_NEW_OUTPUT", "0") == "0": + if os.environ.get("RAY_AIR_NEW_OUTPUT", "1") == "0": return None if isinstance(verbose, AirVerbosity): diff --git a/python/ray/tune/tune.py b/python/ray/tune/tune.py index 877d954439acb..3060c539556cd 100644 --- a/python/ray/tune/tune.py +++ b/python/ray/tune/tune.py @@ -449,12 +449,12 @@ def run( training workers. checkpoint_upload_from_workers: Whether to upload checkpoint files directly from distributed training workers. - verbose: 0, 1, 2, or 3. Verbosity mode. - 0 = silent, 1 = only status updates, 2 = status and brief - results, 3 = status and detailed results. Defaults to 3. + verbose: 0, 1, or 2. Verbosity mode. + 0 = silent, 1 = default, 2 = verbose. Defaults to 1. If the ``RAY_AIR_NEW_OUTPUT=1`` environment variable is set, - uses the new context-aware verbosity settings: - 0 = silent, 1 = default, 2 = verbose. + uses the old verbosity settings: + 0 = silent, 1 = only status updates, 2 = status and brief + results, 3 = status and detailed results. progress_reporter: Progress reporter for reporting intermediate experiment progress. Defaults to CLIReporter if running in command-line, or JupyterNotebookReporter if running in