Modifying existing @ray.remote-decorated Actor

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.

I have an existing third-party library that uses Ray under the hood, and I would like to modify the behavior of (one method of) one specific Ray Actor class (decorated with @ray.remote) from that code. So this looks something like this:

class some_class(parent_class):
    ... init and other methods ...
    def method_i_want_to_modify(self, args):
    ... more methods ...

Ideally I’d like to change the behavior of method_i_want_to_modify() without having to change anything else. Usually I’d try to monkey-patch that method only, but this doesn’t seem to have any effect.

from library import some_class
def my_patched_method(self,args):
    print("my patched method")
some_class.method_i_want_to_modify = my_patched_method

my_patched_method never gets called.

Class inheritance would be another option, but again doesn’t work on @ray.remote decorated classes.

Is there another way to do modify already-decorated remote Ray Actors? The only way I see right now is to maintain my own patched fork of the underlying library, but that wouldn’t be ideal.