Skip to content

Experimental features in Ray AIR #36949

Closed

Description

@krfricke

Experimental features in Ray AIR

The Ray Team is testing a number of experimental features in Ray AIR.

During development, the features are disabled per default. You can opt-in by setting a feature-specific environment variable.

After some time, the Ray Team enables the feature by default to gather more feedback from the community. In that case, you can still disable the feature using the same environment variable to fully revert to the old behavior.

If you run into issues with experimental features, open an issue on GitHub. The Ray Team considers feedback before removing the old implementation and making the new implementation the default.

Note

Experimental features can undergo frequent changes, especially on the master branch and the nightly wheels.

Context-aware progress reporting

Note

This feature is enabled by default in Ray 2.6.
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.

This output engine affects how the training progress is printed in the console. The output changes depending on the execution context: Ray Tune runs will be displayed differently to Ray Train runs.

The features include:

  • Ray Train runs report status relevant to the single training run. It does not use the default Ray Tune table layout from previous versions.
  • The table format has been updated.
  • The format of reporting configurations and observed metrics is different from pervious versions.
  • Significant reduction in the default metrics displayed in the console output for runs (e.g., RLlib runs).
  • Decluttered the output to improve readability.

This output feature only works for the regular console. It is automatically disabled when you use Jupyter Notebooks or Ray client.

Rich layout (sticky status)

Note
This feature is disabled by default.
To enable, set the environment variable RAY_AIR_RICH_LAYOUT=1.

The context-aware output engine exposes an advanced layout using the rich library.

The rich layout provides a sticky status table: The regular console logs are still printed as before, but the trial overview table (in Ray Tune) is stuck to the bottom of the screen and periodically updated.

This feature is still in development. You can opt-in to try it out.

To opt-in, set the RAY_AIR_RICH_LAYOUT=1 environment variable and install rich (pip install rich).

Event-based trial execution engine

Note
This feature is enabled by default starting Ray 2.5.
To disable, set the environment variable TUNE_NEW_EXECUTION=0.

Ray Tune has an updated trial execution engine. Since Ray Tune is also the execution backend for Ray Train, the updated engine affects both tuning and training runs.

The update is a refactor of the TrialRunner which uses a generic Ray actor and future manager instead of the previous RayTrialExecutor. This manager exposes an interface to react to scheduling and task execution events, which makes it easier to maintain and develop.

This is a drop-in replacement of an internal class, and you shouldn’t see any change to the previous behavior.

However, if you notice any odd behavior, you can opt out of the event-based execution engine and see if it resolves your problem.

In that case, please open an issue on GitHub, ideally with a reproducible script.

Things to look out for:

  • Less trials are running in parallel than before
  • It takes longer to start new trials (or goes much faster)
  • The tuning run finishes, but the script does not exit
  • The end-to-end runtime is much slower than before
  • The CPU load on the head node is high, even though the training jobs don’t require many resources or don’t run on the head node

Any exceptions are raised that indicate an error in starting or stopping trials or the experiment

Note that some edge cases may not be captured in the regression tests. Your feedback is welcome.

Activity

  1. pinned this issue on Jun 29, 2023
  2. unpinned this issue on Jul 7, 2023
  3. spacegoing commented on Aug 20, 2023

    @spacegoing
    Contributor

    @krfricke I'm using a customized progress reporter. with new feature enabled, how do I customize it? I couldn't find docs. help pls:D

  4. alex3s commented on Oct 24, 2023

    @alex3s

    I think that when using RAY_AIR_RICH_LAYOUT=1
    It looks great!
    One issue is that the numbers are sometimes displayed like this 0.0999999999 instead of 0.1
    I suggest changing line 894
    in python/ray/tune/experimental/output.py
    from this:

                for trial_info in trial_infos:
                    table_trial.add_row(*[str(_) for _ in trial_info])
    

    to this:

                for trial_info in trial_infos:
                    table_trial.add_row(*[f'{_:.6}' if isinstance(_, float) else str(_) for _ in trial_info])
    

    Voila! they all looking great!

  5. dennymarcels commented on Feb 20, 2024

    @dennymarcels

    Where exactly should I set up the environmental variables? Local machine? Head node? Worker nodes? All of them?

  6. spark-tdy commented on Feb 28, 2024

    @spark-tdy

    Where exactly should I set up the environmental variables? Local machine? Head node? Worker nodes? All of them?

    Set them as a variable in the ray.init(runtime_env={"env_vars": {"<variable>": "<value>"}})

  7. rclough commented on Aug 14, 2024

    @rclough
    Contributor

    I tried setting my environment variable in both ways:

    # Set it for the current notebook environment
    os.environ['RAY_AIR_RICH_LAYOUT'] = '1'
    
    ray.init(
        ...
        runtime_env={"env_vars": {"RAY_AIR_RICH_LAYOUT": "1"}},
    )

    But when I run training, there's no interface, and I still get the warnings linking to this issue. I'm on ray 2.23, any idea why it's not working?

  8. dennymarcels commented on Aug 14, 2024

    @dennymarcels

    I tried setting my environment variable in both ways:

    # Set it for the current notebook environment
    os.environ['RAY_AIR_RICH_LAYOUT'] = '1'
    
    ray.init(
        ...
        runtime_env={"env_vars": {"RAY_AIR_RICH_LAYOUT": "1"}},
    )

    But when I run training, there's no interface, and I still get the warnings linking to this issue. I'm on ray 2.23, any idea why it's not working?

    I could only make env_vars work by setting them on the OS itself.

  9. stale commented on Jan 22, 2025

    @stale

    Hi, I'm a bot from the Ray team :)

    To help human contributors to focus on more relevant issues, I will automatically add the stale label to issues that have had no activity for more than 4 months.

    If there is no further activity in the 14 days, the issue will be closed!

    • If you'd like to keep the issue open, just leave any comment, and the stale label will be removed!
    • If you'd like to get more attention to the issue, please tag one of Ray's contributors.

    You can always ask for help on our discussion forum or Ray's public slack channel.

  10. added
    stale
    on Jan 22, 2025
  11. stale commented on Apr 25, 2025

    @stale

    Hi again! The issue will be closed because there has been no more activity in the 14 days since the last message.

    Please feel free to reopen or open a new issue if you'd still like it to be addressed.

    Again, you can always ask for help on our discussion forum or Ray's public slack channel.

    Thanks again for opening the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions