Are custom LoggerCallbacks only intended for use with Ray Tune or also for use with plain RLlib?

Hi folks,

Are custom LoggerCallbacks only intended for use with Ray Tune or also for use with plain RLlib?

How to use custom LoggerCallbacks in combination with Ray Tune is described in the docs, see here. But is there also a way to do this with plain RLlib using a Trainer? A Trainer accepts the logger_creator argument which does in my eyes not the same like the callbacks argument in tune.run(..., callbacks=...).

Yes, you are right. RLlib callback uses Logger interface (which logs results from Trainer) and Tune callback uses both Logger interface (legacy/logs from Trainable) and LoggerCallback interface (new/recommended, logs from driver).
See documentation here.
Tune’s per-trial Logger classes have been deprecated. They can still be used, but we encourage you to use our new interface with the LoggerCallback class instead.

We are trying to unify the entrypoint to Tune and RLlib. It seems like we are converging towards launching everything through Tune, so that RLlib’s behavior in terms of callback, checkpointing etc is consistent with Tune. Do you think it’s possible for you to launch RLlib through Tune in your case? Then you can use the same Tune LoggerCallback interface.

Let me know if this is helpful. Also cc @kai

2 Likes

Hello @xwjiang2010,

thanks for your feedback! I think it’s a good idea to unify entrypoints to Tune and RLlib and make things consistent. Perhaps there will be changes in one of the next releases.
So far, I’ve solved it by sub-classing tune.logger.py::Logger to define a custom logger. In a logger_creator function I put my custom logger together with the default loggers and then give it to the Trainer as an argument, see my post here.