Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup ProxyActor Config [1/N] #132

Merged
merged 12 commits into from
Jun 21, 2023
Merged

Setup ProxyActor Config [1/N] #132

merged 12 commits into from
Jun 21, 2023

Conversation

NKcqx
Copy link
Collaborator

@NKcqx NKcqx commented Jun 13, 2023

This is the first step of #134

This PR provides cross_silo_send_resource_label and cross_silo_recv_resource_label config in fed.init and convert them to the "resources" field of ActorClass.options.

@NKcqx NKcqx added the p0 label Jun 13, 2023
@NKcqx NKcqx requested a review from a team June 13, 2023 17:15
@NKcqx NKcqx self-assigned this Jun 13, 2023
Signed-off-by: paer <[email protected]>
@NKcqx

This comment was marked as outdated.

paer added 2 commits June 14, 2023 01:35
Signed-off-by: paer <[email protected]>
Signed-off-by: paer <[email protected]>
Copy link
Collaborator

@fengsp fengsp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

fed/api.py Outdated Show resolved Hide resolved
fed/api.py Outdated
cross_silo_serializing_allowed_list: Dict = None,
cross_silo_send_options: Dict = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cross_silo_send_options equals actor options?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the "cross_silo" prefix may be more clear to user, what do u think ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming is ok, but cross_silo_send_options == actor.options is worth discussing.

Copy link
Collaborator

@jovany-wang jovany-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At high level, I don't think it's a good idea to allow users setting the options for proxies, as:
It's not that all options should be exposed to users. For instances:

  1. Why we need expose name?
  2. max_concurrency is what rayfed should control under the hood.

What I recommend is to expose the specific APIs.

@zhouaihui
Copy link
Member

zhouaihui commented Jun 14, 2023

+1.
Expose some common options is more maintainable and extensible instead of the options of ray.Actor. SendProxy could be ray.actor or something else.

@NKcqx
Copy link
Collaborator Author

NKcqx commented Jun 14, 2023

Make sense, I'll use a class to only expose certain options

@jovany-wang
Copy link
Collaborator

This PR remove the original cross_silo_send_max_retries argument in fed.init, because it has become the field "max_task_retries" of cross_silo_xx_options, which is what cross_silo_send_max_retries stands for under the hood, keeping it will cause conflicts.

Move this to PR description?

paer added 7 commits June 14, 2023 12:10
Signed-off-by: paer <[email protected]>
Signed-off-by: paer <[email protected]>
Signed-off-by: paer <[email protected]>
Signed-off-by: paer <[email protected]>

Conflicts:
	fed/barriers.py
@NKcqx NKcqx changed the title expose Proxy actor options Setup ProxyActor Config [1/N] Jun 20, 2023
@NKcqx NKcqx requested review from jovany-wang and zhouaihui June 21, 2023 02:47
@@ -131,6 +133,14 @@ def init(
cross_silo_serializing_allowed_list: The package or class list allowed for
serializing(deserializating) cross silos. It's used for avoiding pickle
deserializing execution attack when crossing solis.
cross_silo_send_resource_label: Customized resource label, the SendProxyActor
Copy link
Collaborator

@fengsp fengsp Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are trying to limit the user facing proxy configs, maybe exposing ProxyActorConfig would give us more extensibility?If we would like to add another config, this might look tedious, also, send_max_retries could merge into ProxyActorConfig?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1.
And I vote for a name ProxyConfig, which not exposing more details on the ray actor implementation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the advice~ @fengsp @jovany-wang

That's also what I plan to do in [2/N]: merge cross-silo RPC related config into ProxyActorConfig, and then expose it as a parameter of fed.init.

[1/N] is just trying to enable placing the ProxyActor according to its resource label.

@jovany-wang ProxyConfig is indeed a better name when exposing it to users 👍

@jovany-wang jovany-wang assigned fengsp and zhouaihui and unassigned NKcqx Jun 21, 2023
@NKcqx NKcqx requested a review from fengsp June 21, 2023 06:37
Copy link
Collaborator

@jovany-wang jovany-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, this PR LGTM.

And you may need file an issue to trace the related coming items.

@NKcqx
Copy link
Collaborator Author

NKcqx commented Jun 21, 2023

As discussed offline, this PR LGTM.

And you may need file an issue to trace the related coming items.

Sure

Copy link
Collaborator

@fengsp fengsp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NKcqx NKcqx merged commit e98fd36 into main Jun 21, 2023
@NKcqx NKcqx deleted the proxy_actor_options branch June 21, 2023 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants