[Core] Ability to specify resource requirements on Actor methods #39910
Labels
core
Issues that should be addressed in Ray Core
core-api
enhancement
Request for new feature and/or capability
P1
Issue that should be fixed within a few weeks
Description
Currently it's possible to specify resource requirements for Actors:
It would be useful to also be able to specify resource requirements on the
Actor
's methods. Something like:Currently to work around it I can create a separate task:
This is not super intuitive, and ends up returning retrieving the results in that task in order to return them, which is not ideal.
I was told to tag @rkooo567
Use case
Initially asked here: https://discuss.ray.io/t/specifying-extra-resources-for-functions-tasks-running-inside-an-actor/12265
PyTorch initialization is costly, so we're keeping an Actor running with the models loaded in memory. We can specify resource constraints on the
Actor
(in our case a customgpu_memory
resource), however the methods on theActor
will consume more resources, and we don't want to preallocate those to theActor
for a host of reasons.The text was updated successfully, but these errors were encountered: