-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Core] Centralize GPU Worker construction #4419
Conversation
Add _get_worker_kwargs _create_worker methods to GPUExecutor which construct Worker instances from the executor configurations, and make use of these in places where the logic is currently duplicated. This will also be used by the MultiprocessingGPUExecutor executor class.
Is this |
@youkaichao I don't think so, this is primarily centralizing how the GPU executor config is converted to the worker args. I don' think |
I mean, they can share the same code to reduce code duplication. You can include My design of |
@youkaichao maybe better to move that common logic to a static function in |
I think |
@youkaichao I'm using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
A side note @njhill : Initially, I would like to make single gpu executor more similar to multi-gpu executor, e.g. move I'm not sure if it is good to go. It will have some small overhead for single-gpu execution though, but I expect the overhead to be minimal. |
@youkaichao that does make sense from a unification pov, but the code was actually originally like this before @zhuohan123 refactored it to be as it is now in #3191. Perhaps the reason was so that we can streamline/optimize the single-gpu case which is potentially most common |
Thanks for pointing it out. Didn't notice it before. |
Add
_get_worker_kwargs
and_create_worker
methods toGPUExecutor
which constructWorker
instances from the executor configuration, and make use of these in places where the logic is currently duplicated.This will also be used by the to-be-added
MultiprocessingGPUExecutor
.