[Java] Support direct actor call in Java worker#5504
[Java] Support direct actor call in Java worker#5504raulchen merged 32 commits intoray-project:masterfrom
Conversation
|
Test PASSed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
4f953f7 to
3586456
Compare
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test FAILed. |
|
Test PASSed. |
raulchen
left a comment
There was a problem hiding this comment.
Thanks. Looks good overall. We can merge this when some small comments are addressed.
| public static final int NO_RECONSTRUCTION = 0; | ||
| public static final int INFINITE_RECONSTRUCTIONS = (int) Math.pow(2, 30); | ||
| public static final boolean DEFAULT_IS_DIRECT_CALL = "1" | ||
| .equals(System.getenv("ACTOR_CREATION_OPTIONS_DEFAULT_IS_DIRECT_CALL")); |
There was a problem hiding this comment.
document that this env var is only used for tests. Users should use setIsDirectCall.
|
|
||
| // Since direct call is not fully supported yet, users are not allowed to set the option to true. | ||
| // TODO (kfstorm): uncomment when direct call is ready. | ||
| // public Builder setIsDirectCall(boolean isDirectCall) { |
There was a problem hiding this comment.
Can you add the issue number to the TODO comment?
src/ray/core_worker/context.h
Outdated
|
|
||
| const ActorID &GetCurrentActorID() const; | ||
|
|
||
| bool IsDirectCallActor() const; |
There was a problem hiding this comment.
| bool IsDirectCallActor() const; | |
| bool CurrentActorUseDirectCall() const; |
src/ray/raylet/actor_registration.cc
Outdated
| const auto actor_handle_id = task->GetTaskSpecification().ActorHandleId(); | ||
| const auto dummy_object = task->GetTaskSpecification().ActorDummyObject(); | ||
| // Extend its frontier to include the most recent task. | ||
| // Note(hchen): this is needed because this method is called before |
There was a problem hiding this comment.
| // Note(hchen): this is needed because this method is called before | |
| // NOTE(hchen): For non-direct-call actors, this is needed because this method is called before |
src/ray/raylet/actor_registration.cc
Outdated
| // Extend its frontier to include the most recent task. | ||
| // Note(hchen): this is needed because this method is called before | ||
| // `FinishAssignedTask`, which will be called when the worker tries to fetch | ||
| // the next task. |
There was a problem hiding this comment.
| // the next task. | |
| // the next task. For direct-call actors, checkpoint data doesn't contain frontier info, so we don't need to do `ExtendFrontier` here. |
|
Test PASSed. |
|
Test FAILed. |
|
Test PASSed. |
|
Test FAILed. |
|
Test PASSed. |
Why are these changes needed?
Worker/driver can submit task directly to an actor without going through raylet for better performance.
What do these changes do?
#5183 introduced direct actor call in core worker as a transport. This PR adds the option
isDirectCallinActorCreationOptoinsto make it possible to turn on direct actor call mode for actors.TODO:
Related issue number
#5029
Linter
scripts/format.shto lint the changes in this PR.