How to prevent ray tune fit from printing redundent information?

Hi all,

I am using tune.fit to train an RL agent, but in each iteration, ray prints out a lot of information making tracking and debugging a bit difficult.

The default verbose in tune.fit(verbose=1) is 1 which prints out a lot of info shown in the following image.

If you set verbose to 0, it does not print anything, but it is not what I want.

I want the tune.fit to only print the following table, not the other information.

I wonder if anyone knows how to make it. Thanks :slight_smile:

This is internal to tune. RLlib onyl returns a results dictionary and tune will decide what to print from it. I’m moving this to the Ray AIR folks :slight_smile:

1 Like

Hi @deepgravity,

usually you should get the expected output with verbose=1. The default is 2, which matches the output you show.

We are refactoring the output engine, and you can try out the new layout by setting the environment variable RAY_AIR_NEW_OUTPUT=1. This works best on the nightly wheels. Do you want to give that a try and test it with AirVerbosity.DEFAULT?

For more details, see

https://docs.ray.io/en/latest/ray-air/experimental-features.html

2 Likes

If all of this does not lead to your goal, you can also write a custom callback to filter out metrics that you don’t need.

1 Like

Hi @kai,
Many thanks for your reply.

Yes, that worked for me. Indeed:

import os 
os.environ['RAY_AIR_NEW_OUTPUT'] = '1'

from ray.tune.experimental.output import AirVerbosity, get_air_verbosity 

run_config = air.RunConfig(verbose=get_air_verbosity(AirVerbosity.DEFAULT))

Now, I have the following log:

Only prints the most important measurements.

I think here episodes_total is equivalent to iters that we had before right?

I also have a suggestion. I would even be happier to have only one dynamic table that changes after like every 10 episodes; rather than having multiple new static tables.

This is because I am already tracking the progress on tensorboard or wandb. So I do not need to have the whole run history in the terminal. The terminal is good only for quick debugging. So, having only one dynamic table would be enough.

Thanks anyway :slight_smile:

Thanks @deepgravity, we’re actually working on this with out sticky layout. You can try it out already (RAY_AIR_RICH_LAYOUT=1) - but please note that it’s very experimental right now and probably has a few bugs :slight_smile: