Change policy name

Hi there,

Is there an easy way to edit policy name in the saved checkpoint?

My current setup consists of loading a checkpoint:

data = load(
    open(
        checkpoint_path,
        "rb",
    )
)

And editing these fields:

data["train_exec_impl"]
data["worker"]

For train_exec_impl it works smoothly, because the whole content of that structure is a dict.
For worker it’s not that easy, however. It’s content is being stored as a binary string and RLlib operates on that string as a whole, using only setstate() and getstate() methods.

Is there any decoder I could use to decode that string and make a change that would allow to change the policy name?

I’m not familiar with the specifics how checkpoints are laid out. But how about loading the policy from the checkpoint, changing its name and checkpointing it again?
What version are you on? Loading and checkpointing Policy and Algorithm has become a little easier recently (Ray 2.2).

Thank you @arturn , this should work ^^

Nevertheless, I would opt to have the whole checkpoint as a dictionary. This functionality would allow for more flexible approach to checkpoints handling and have a potential for development usability.

1 Like

Thanks for the feedback! Whatever we establish as a long-term solution, we need workflows to modify all parts of a checkpoint without much hassle. We can’t make everything jsonesque obviously put configuration and naming seem like things one should be able to modify by hand.
I’ll keep this post in mind.